From bf7b5d51cc0bb6aa9fa2d62bbaef29d2199ee1cc Mon Sep 17 00:00:00 2001 From: Jeff Storey Date: Mon, 28 Mar 2016 08:11:30 -0400 Subject: [PATCH] PR fixes --- controller/build.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/controller/build.go b/controller/build.go index 02df76f7..41cf3617 100644 --- a/controller/build.go +++ b/controller/build.go @@ -228,16 +228,22 @@ func PostBuild(c *gin.Context) { c.String(500, err.Error()) return } + if build.Event == model.EventPush || + build.Event == model.EventPull || + build.Event == model.EventTag || + build.Event == model.EventDeploy { + build.Event = c.DefaultQuery("event", build.Event) + } + build.Deploy = c.DefaultQuery("deploy_to", build.Deploy) } + // todo move this to database tier // and wrap inside a transaction build.Status = model.StatusPending build.Started = 0 build.Finished = 0 build.Enqueued = time.Now().UTC().Unix() - build.Event = c.DefaultQuery("event", build.Event) - build.Deploy = c.DefaultQuery("deploy_to", build.Deploy) for _, job := range jobs { job.Status = model.StatusPending job.Started = 0