chore: add deployTo and author avatar env

This commit is contained in:
Bo-Yi Wu 2019-10-11 22:25:20 +08:00
parent 7564de8e0d
commit f15615fb86
2 changed files with 14 additions and 0 deletions

12
main.go
View File

@ -143,6 +143,11 @@ func main() {
Usage: "git author email", Usage: "git author email",
EnvVar: "DRONE_COMMIT_AUTHOR_EMAIL", EnvVar: "DRONE_COMMIT_AUTHOR_EMAIL",
}, },
cli.StringFlag{
Name: "commit.author.avatar",
Usage: "git author avatar",
EnvVar: "DRONE_COMMIT_AUTHOR_AVATAR",
},
cli.StringFlag{ cli.StringFlag{
Name: "commit.message", Name: "commit.message",
Usage: "commit message", Usage: "commit message",
@ -225,6 +230,11 @@ func main() {
Usage: "The GitHub workspace path. Value: /github/workspace.", Usage: "The GitHub workspace path. Value: /github/workspace.",
EnvVar: "GITHUB_WORKSPACE", EnvVar: "GITHUB_WORKSPACE",
}, },
cli.StringFlag{
Name: "deploy.to",
Usage: "Provides the target deployment environment for the running build. This value is only available to promotion and rollback pipelines.",
EnvVar: "DRONE_DEPLOY_TO",
},
} }
if err := app.Run(os.Args); err != nil { if err := app.Run(os.Args); err != nil {
@ -257,6 +267,7 @@ func run(c *cli.Context) error {
Link: c.String("commit.link"), Link: c.String("commit.link"),
Author: c.String("commit.author"), Author: c.String("commit.author"),
Email: c.String("commit.author.email"), Email: c.String("commit.author.email"),
Avatar: c.String("commit.author.avatar"),
Message: c.String("commit.message"), Message: c.String("commit.message"),
}, },
Build: Build{ Build: Build{
@ -268,6 +279,7 @@ func run(c *cli.Context) error {
Started: c.Float64("job.started"), Started: c.Float64("job.started"),
Finished: c.Float64("job.finished"), Finished: c.Float64("job.finished"),
PR: c.String("pull.request"), PR: c.String("pull.request"),
DeployTo: c.String("deploy.to"),
}, },
Config: Config{ Config: Config{
Token: c.String("token"), Token: c.String("token"),

View File

@ -36,6 +36,7 @@ type (
Branch string Branch string
Link string Link string
Author string Author string
Avatar string
Email string Email string
Message string Message string
} }
@ -50,6 +51,7 @@ type (
Started float64 Started float64
Finished float64 Finished float64
PR string PR string
DeployTo string
} }
// Config for the plugin. // Config for the plugin.