From 7f162c80b922a7a7c9dbb9bc41c588b712b1c6dd Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Sat, 9 May 2015 20:14:01 -0700 Subject: [PATCH] post-commit hook should trigger commit status update --- server/hooks.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/server/hooks.go b/server/hooks.go index d95a0c954..49e52aed1 100644 --- a/server/hooks.go +++ b/server/hooks.go @@ -1,10 +1,12 @@ package server import ( + "fmt" "strings" log "github.com/Sirupsen/logrus" "github.com/drone/drone/common" + "github.com/drone/drone/common/httputil" "github.com/drone/drone/parser" "github.com/drone/drone/parser/inject" "github.com/drone/drone/parser/matrix" @@ -147,6 +149,17 @@ func PostHook(c *gin.Context) { c.JSON(200, build) + link := fmt.Sprintf( + "%s/%s/%d", + httputil.GetURL(c.Request), + repo.FullName, + build.Number, + ) + err = remote.Status(user, repo, build, link) + if err != nil { + log.Errorf("error setting commit status for %s/%d", repo.FullName, build.Number) + } + queue_.Publish(&queue.Work{ User: user, Repo: repo,