Expose parent build number

This commit is contained in:
Lucas Lara 2017-05-12 21:31:08 +02:00
parent 823175605f
commit c1b500665f
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,