Skip to content

Commit

Permalink
update secret order of operations
Browse files Browse the repository at this point in the history
  • Loading branch information
bradrydzewski committed May 19, 2017
1 parent 298d78e commit 108e3fe
Show file tree
Hide file tree
Showing 14 changed files with 981 additions and 12 deletions.
4 changes: 2 additions & 2 deletions server/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func PostApproval(c *gin.Context) {
// get the previous build so that we can send
// on status change notifications
last, _ := store.GetBuildLastBefore(c, repo, build.Branch, build.ID)
secs, err := Config.Services.Secrets.SecretList(repo)
secs, err := Config.Services.Secrets.SecretListBuild(repo, build)
if err != nil {
logrus.Debugf("Error getting secrets for %s#%d. %s", repo.FullName, build.Number, err)
}
Expand Down Expand Up @@ -476,7 +476,7 @@ func PostBuild(c *gin.Context) {
// get the previous build so that we can send
// on status change notifications
last, _ := store.GetBuildLastBefore(c, repo, build.Branch, build.ID)
secs, err := Config.Services.Secrets.SecretList(repo)
secs, err := Config.Services.Secrets.SecretListBuild(repo, build)
if err != nil {
logrus.Debugf("Error getting secrets for %s#%d. %s", repo.FullName, build.Number, err)
}
Expand Down
20 changes: 10 additions & 10 deletions server/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,6 @@ func PostHook(c *gin.Context) {
}
}

secs, err := Config.Services.Secrets.SecretList(repo)
if err != nil {
logrus.Debugf("Error getting secrets for %s#%d. %s", repo.FullName, build.Number, err)
}

regs, err := Config.Services.Registries.RegistryList(repo)
if err != nil {
logrus.Debugf("Error getting registry credentials for %s#%d. %s", repo.FullName, build.Number, err)
}

// update some build fields
build.RepoID = repo.ID
build.Verified = true
Expand All @@ -211,6 +201,16 @@ func PostHook(c *gin.Context) {
return
}

secs, err := Config.Services.Secrets.SecretListBuild(repo, build)
if err != nil {
logrus.Debugf("Error getting secrets for %s#%d. %s", repo.FullName, build.Number, err)
}

regs, err := Config.Services.Registries.RegistryList(repo)
if err != nil {
logrus.Debugf("Error getting registry credentials for %s#%d. %s", repo.FullName, build.Number, err)
}

// get the previous build so that we can send
// on status change notifications
last, _ := store.GetBuildLastBefore(c, repo, build.Branch, build.ID)
Expand Down
21 changes: 21 additions & 0 deletions vendor/github.com/kr/pretty/License

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions vendor/github.com/kr/pretty/Readme

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

265 changes: 265 additions & 0 deletions vendor/github.com/kr/pretty/diff.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 108e3fe

Please sign in to comment.