post-commit hook should trigger commit status update

This commit is contained in:
Brad Rydzewski 2015-05-09 20:14:01 -07:00
parent fb2999c35d
commit 7f162c80b9

View file

@ -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,