mirror of
https://github.com/thegeeklab/wp-plugin-go.git
synced 2024-11-22 10:20:39 +00:00
Add missing fields for Build (#19)
Both DRONE_BUILD_LINK and DRONE_DEPLOY_ID were missing from the list of environment variables in the drone-runner library.
This commit is contained in:
parent
1f4e8862b8
commit
be2c206c20
@ -42,6 +42,9 @@ type Build struct {
|
|||||||
// Status of the build.
|
// Status of the build.
|
||||||
Status string
|
Status string
|
||||||
|
|
||||||
|
// Link to the build.
|
||||||
|
Link string
|
||||||
|
|
||||||
// Created time of the build.
|
// Created time of the build.
|
||||||
Created time.Time
|
Created time.Time
|
||||||
|
|
||||||
@ -54,6 +57,9 @@ type Build struct {
|
|||||||
// DeployTo the environment.
|
// DeployTo the environment.
|
||||||
DeployTo string
|
DeployTo string
|
||||||
|
|
||||||
|
// DeployID for the environment.
|
||||||
|
DeployID int
|
||||||
|
|
||||||
// FailedStages of the build.
|
// FailedStages of the build.
|
||||||
FailedStages []string
|
FailedStages []string
|
||||||
|
|
||||||
|
@ -65,6 +65,11 @@ func buildFlags() []cli.Flag {
|
|||||||
Usage: "build status",
|
Usage: "build status",
|
||||||
EnvVars: []string{"DRONE_BUILD_STATUS"},
|
EnvVars: []string{"DRONE_BUILD_STATUS"},
|
||||||
},
|
},
|
||||||
|
&cli.StringFlag{
|
||||||
|
Name: "build.link",
|
||||||
|
Usage: "build link",
|
||||||
|
EnvVars: []string{"DRONE_BUILD_LINK"},
|
||||||
|
},
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "build.created",
|
Name: "build.created",
|
||||||
Usage: "build created",
|
Usage: "build created",
|
||||||
@ -85,6 +90,11 @@ func buildFlags() []cli.Flag {
|
|||||||
Usage: "build deploy to",
|
Usage: "build deploy to",
|
||||||
EnvVars: []string{"DRONE_DEPLOY_TO"},
|
EnvVars: []string{"DRONE_DEPLOY_TO"},
|
||||||
},
|
},
|
||||||
|
&cli.IntFlag{
|
||||||
|
Name: "build.deploy-id",
|
||||||
|
Usage: "build deploy id",
|
||||||
|
EnvVars: []string{"DRONE_DEPLOY_ID"},
|
||||||
|
},
|
||||||
&cli.StringSliceFlag{
|
&cli.StringSliceFlag{
|
||||||
Name: "build.failed-stages",
|
Name: "build.failed-stages",
|
||||||
Usage: "build failed stages",
|
Usage: "build failed stages",
|
||||||
@ -111,10 +121,12 @@ func buildFromContext(ctx *cli.Context) drone.Build {
|
|||||||
Event: ctx.String("build.event"),
|
Event: ctx.String("build.event"),
|
||||||
Action: ctx.String("build.action"),
|
Action: ctx.String("build.action"),
|
||||||
Status: ctx.String("build.status"),
|
Status: ctx.String("build.status"),
|
||||||
|
Link: ctx.String("build.link"),
|
||||||
Created: time.Unix(ctx.Int64("build.created"), 0),
|
Created: time.Unix(ctx.Int64("build.created"), 0),
|
||||||
Started: time.Unix(ctx.Int64("build.started"), 0),
|
Started: time.Unix(ctx.Int64("build.started"), 0),
|
||||||
Finished: time.Unix(ctx.Int64("build.finished"), 0),
|
Finished: time.Unix(ctx.Int64("build.finished"), 0),
|
||||||
DeployTo: ctx.String("build.deploy-to"),
|
DeployTo: ctx.String("build.deploy-to"),
|
||||||
|
DeployID: ctx.Int("build.deploy-id"),
|
||||||
FailedStages: ctx.StringSlice("build.failed-stages"),
|
FailedStages: ctx.StringSlice("build.failed-stages"),
|
||||||
FailedSteps: ctx.StringSlice("build.failed-steps"),
|
FailedSteps: ctx.StringSlice("build.failed-steps"),
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user