From f7caf5f309ee6f73bea09a7de42a37904538be03 Mon Sep 17 00:00:00 2001 From: Jeff Storey Date: Sun, 27 Mar 2016 18:41:34 -0400 Subject: [PATCH 1/5] #470 initial pipeline support --- controller/build.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/controller/build.go b/controller/build.go index bc457fc42..35e474423 100644 --- a/controller/build.go +++ b/controller/build.go @@ -236,6 +236,8 @@ func PostBuild(c *gin.Context) { build.Started = 0 build.Finished = 0 build.Enqueued = time.Now().UTC().Unix() + build.Event := c.DefaultQuery("event", build.Event)deploy_to + build.Deploy := c.DefaultQuery("deploy_to", build.Deploy) for _, job := range jobs { job.Status = model.StatusPending job.Started = 0 From 177c3000b6d240fd36b1356568619e0ab6b439a5 Mon Sep 17 00:00:00 2001 From: Jeff Storey Date: Sun, 27 Mar 2016 19:12:57 -0400 Subject: [PATCH 2/5] fixing syntax error --- controller/build.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controller/build.go b/controller/build.go index 35e474423..02df76f7c 100644 --- a/controller/build.go +++ b/controller/build.go @@ -236,8 +236,8 @@ func PostBuild(c *gin.Context) { build.Started = 0 build.Finished = 0 build.Enqueued = time.Now().UTC().Unix() - build.Event := c.DefaultQuery("event", build.Event)deploy_to - build.Deploy := c.DefaultQuery("deploy_to", build.Deploy) + 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 From bf7b5d51cc0bb6aa9fa2d62bbaef29d2199ee1cc Mon Sep 17 00:00:00 2001 From: Jeff Storey Date: Mon, 28 Mar 2016 08:11:30 -0400 Subject: [PATCH 3/5] PR fixes --- controller/build.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/controller/build.go b/controller/build.go index 02df76f7c..41cf3617a 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 From 01f3dbdb23f71366b3437c256bffbe80586341fa Mon Sep 17 00:00:00 2001 From: Jeff Storey Date: Mon, 28 Mar 2016 08:18:18 -0400 Subject: [PATCH 4/5] removing extra blank line --- controller/build.go | 1 - 1 file changed, 1 deletion(-) diff --git a/controller/build.go b/controller/build.go index 41cf3617a..43f85bc81 100644 --- a/controller/build.go +++ b/controller/build.go @@ -237,7 +237,6 @@ func PostBuild(c *gin.Context) { build.Deploy = c.DefaultQuery("deploy_to", build.Deploy) } - // todo move this to database tier // and wrap inside a transaction build.Status = model.StatusPending From 7991a8932a4fc815cfd6f11f344c2e168e4f2d55 Mon Sep 17 00:00:00 2001 From: Jeff Storey Date: Mon, 28 Mar 2016 16:50:51 -0400 Subject: [PATCH 5/5] PR fixes --- controller/build.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/controller/build.go b/controller/build.go index 43f85bc81..96e7ffd45 100644 --- a/controller/build.go +++ b/controller/build.go @@ -228,11 +228,13 @@ 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) + + event := c.DefaultQuery("event", build.Event) + if event == model.EventPush || + event == model.EventPull || + event == model.EventTag || + event == model.EventDeploy { + build.Event = event } build.Deploy = c.DefaultQuery("deploy_to", build.Deploy) }