included more plugin inputs

This commit is contained in:
Brad Rydzewski 2016-04-25 09:41:53 -07:00
parent 6fffa7af26
commit 2b7f46de08

View file

@ -83,6 +83,11 @@ func (r *pipeline) run() error {
}) })
} }
var lastStatus string
if w.BuildLast != nil {
lastStatus = w.BuildLast.Status
}
trans := []compiler.Transform{ trans := []compiler.Transform{
builtin.NewCloneOp("git", true), builtin.NewCloneOp("git", true),
builtin.NewCacheOp( builtin.NewCacheOp(
@ -105,7 +110,7 @@ func (r *pipeline) run() error {
builtin.NewAliasOp(prefix), builtin.NewAliasOp(prefix),
builtin.NewPullOp(r.config.pull), builtin.NewPullOp(r.config.pull),
builtin.NewFilterOp( builtin.NewFilterOp(
model.StatusSuccess, // TODO(bradrydzewski) please add the last build status here lastStatus,
w.Build.Branch, w.Build.Branch,
w.Build.Event, w.Build.Event,
w.Build.Deploy, w.Build.Deploy,
@ -236,11 +241,13 @@ func toEnv(w *queue.Work) map[string]string {
"DRONE_COMMIT_BRANCH": w.Build.Branch, "DRONE_COMMIT_BRANCH": w.Build.Branch,
"DRONE_COMMIT_LINK": w.Build.Link, "DRONE_COMMIT_LINK": w.Build.Link,
"DRONE_COMMIT_MESSAGE": w.Build.Message, "DRONE_COMMIT_MESSAGE": w.Build.Message,
"DRONE_AUTHOR": w.Build.Author, "DRONE_COMMIT_AUTHOR": w.Build.Author,
"DRONE_AUTHOR_EMAIL": w.Build.Email, "DRONE_COMMIT_AUTHOR_EMAIL": w.Build.Email,
"DRONE_AUTHOR_AVATAR": w.Build.Avatar, "DRONE_COMMIT_AUTHOR_AVATAR": w.Build.Avatar,
"DRONE_BUILD_NUMBER": fmt.Sprintf("%d", w.Build.Number), "DRONE_BUILD_NUMBER": fmt.Sprintf("%d", w.Build.Number),
"DRONE_BUILD_EVENT": w.Build.Event, "DRONE_BUILD_EVENT": w.Build.Event,
"DRONE_BUILD_STATUS": w.Build.Status,
"DRONE_BUILD_LINK": fmt.Sprintf("%s/%s/%d", w.System.Link, w.Repo.FullName, w.Build.Number),
"DRONE_BUILD_CREATED": fmt.Sprintf("%d", w.Build.Created), "DRONE_BUILD_CREATED": fmt.Sprintf("%d", w.Build.Created),
"DRONE_BUILD_STARTED": fmt.Sprintf("%d", w.Build.Started), "DRONE_BUILD_STARTED": fmt.Sprintf("%d", w.Build.Started),
"DRONE_BUILD_FINISHED": fmt.Sprintf("%d", w.Build.Finished), "DRONE_BUILD_FINISHED": fmt.Sprintf("%d", w.Build.Finished),