This commit is contained in:
Jeff Storey 2016-03-28 08:11:30 -04:00
parent 177c3000b6
commit bf7b5d51cc

View file

@ -228,16 +228,22 @@ func PostBuild(c *gin.Context) {
c.String(500, err.Error()) c.String(500, err.Error())
return 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 // todo move this to database tier
// and wrap inside a transaction // and wrap inside a transaction
build.Status = model.StatusPending build.Status = model.StatusPending
build.Started = 0 build.Started = 0
build.Finished = 0 build.Finished = 0
build.Enqueued = time.Now().UTC().Unix() 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 { for _, job := range jobs {
job.Status = model.StatusPending job.Status = model.StatusPending
job.Started = 0 job.Started = 0