Merge pull request #2039 from lucaslorentz/expose-parent-number

Expose parent build number
This commit is contained in:
Brad Rydzewski 2017-05-14 11:11:43 +02:00 committed by GitHub
commit 02f9cf4bd6
2 changed files with 6 additions and 0 deletions

View file

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

View file

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