lib, gapi: Display deploy ID to add some clarity

This should make it easier to understand exactly when a new deploy
starts.
This commit is contained in:
James Shubin
2019-04-16 18:11:32 -04:00
parent 272fd3edc3
commit eba45e6207
2 changed files with 5 additions and 0 deletions

View File

@@ -34,6 +34,7 @@ func init() {
// TODO: add staged rollout functionality to this struct // TODO: add staged rollout functionality to this struct
// TODO: add proper authentication with gpg key signing // TODO: add proper authentication with gpg key signing
type Deploy struct { type Deploy struct {
ID uint64
Name string // lang, puppet, yaml, etc... Name string // lang, puppet, yaml, etc...
//Sync bool // wait for everyone to close previous GAPI before switching //Sync bool // wait for everyone to close previous GAPI before switching
Noop bool Noop bool

View File

@@ -529,6 +529,9 @@ func (obj *Main) Run() error {
continue continue
} }
mainDeploy = deploy // save this one mainDeploy = deploy // save this one
if id := mainDeploy.ID; id != 0 {
Logf("deploy: got id: %d", id)
}
gapiObj := mainDeploy.GAPI gapiObj := mainDeploy.GAPI
if gapiObj == nil { if gapiObj == nil {
Logf("deploy: received empty gapi") Logf("deploy: received empty gapi")
@@ -891,6 +894,7 @@ func (obj *Main) Run() error {
Logf("deploy: error decoding deploy: %+v", err) Logf("deploy: error decoding deploy: %+v", err)
continue continue
} }
deploy.ID = latest // store the ID
select { select {
case deployChan <- deploy: case deployChan <- deploy: