mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-10-21 16:15:52 +00:00
Merge pull request #1586 from bradrydzewski/master
fully functioning builds using 0.5 agents, secrets and yaml (behind feature flag)
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
log "github.com/Sirupsen/logrus"
|
||||
"github.com/drone/drone/bus"
|
||||
"github.com/drone/drone/engine"
|
||||
"github.com/drone/drone/model"
|
||||
"github.com/drone/drone/queue"
|
||||
@@ -204,6 +205,7 @@ func PostHook(c *gin.Context) {
|
||||
// get the previous build so that we can send
|
||||
// on status change notifications
|
||||
last, _ := store.GetBuildLastBefore(c, repo, build.Branch, build.ID)
|
||||
secs, _ := store.GetSecretList(c, repo)
|
||||
|
||||
// IMPORTANT. PLEASE READ
|
||||
//
|
||||
@@ -212,6 +214,7 @@ func PostHook(c *gin.Context) {
|
||||
// enabled using with the environment variable CANARY=true
|
||||
|
||||
if os.Getenv("CANARY") == "true" {
|
||||
bus.Publish(c, bus.NewBuildEvent(bus.Enqueued, repo, build))
|
||||
for _, job := range jobs {
|
||||
queue.Publish(c, &queue.Work{
|
||||
User: user,
|
||||
@@ -223,6 +226,7 @@ func PostHook(c *gin.Context) {
|
||||
Netrc: netrc,
|
||||
Yaml: string(raw),
|
||||
YamlEnc: string(sec),
|
||||
Secrets: secs,
|
||||
System: &model.System{
|
||||
Link: httputil.GetURL(c.Request),
|
||||
Plugins: strings.Split(os.Getenv("PLUGIN_FILTER"), " "),
|
||||
|
@@ -46,6 +46,8 @@ func GetRepoEvents2(c *gin.Context) {
|
||||
return false
|
||||
}
|
||||
|
||||
// TODO(bradrydzewski) This is a super hacky workaround until we improve
|
||||
// the actual bus. Having a per-call database event is just plain stupid.
|
||||
if event.Repo.FullName == repo.FullName {
|
||||
|
||||
var payload = struct {
|
||||
|
Reference in New Issue
Block a user