Skip to content

Commit

Permalink
Expose parent build number
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaslorentz committed May 12, 2017
1 parent 8231756 commit c1b5006
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drone/exec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ var Command = cli.Command{
Name: "build-number",
EnvVar: "DRONE_BUILD_NUMBER",
},
cli.IntFlag{
Name: "parent-build-number",
EnvVar: "DRONE_PARENT_BUILD_NUMBER",
},
cli.Int64Flag{
Name: "build-created",
EnvVar: "DRONE_BUILD_CREATED",
Expand Down Expand Up @@ -389,6 +393,7 @@ func metadataFromContext(c *cli.Context) frontend.Metadata {
},
Curr: frontend.Build{
Number: c.Int("build-number"),
Parent: c.Int("parent-build-number"),
Created: c.Int64("build-created"),
Started: c.Int64("build-started"),
Finished: c.Int64("build-finished"),
Expand Down
1 change: 1 addition & 0 deletions server/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ func metadataFromStruct(repo *model.Repo, build, last *model.Build, proc *model.
},
Curr: frontend.Build{
Number: build.Number,
Parent: build.Parent,
Created: build.Created,
Started: build.Started,
Finished: build.Finished,
Expand Down

0 comments on commit c1b5006

Please sign in to comment.