diff --git a/README.md b/README.md index 7db908a..67db16e 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ docker run --rm \ -e DRONE_BUILD_NUMBER=1 \ -e DRONE_BUILD_STATUS=success \ -e DRONE_BUILD_LINK=http://github.com/appleboy/go-hello \ + -e DRONE_TAG=1.0.0 \ -e DRONE_JOB_STARTED=1477550550 \ -e DRONE_JOB_FINISHED=1477550750 \ -v $(pwd):$(pwd) \ diff --git a/main.go b/main.go index fd563c7..8e0476f 100644 --- a/main.go +++ b/main.go @@ -147,6 +147,11 @@ func main() { Usage: "build link", EnvVar: "DRONE_BUILD_LINK", }, + cli.StringFlag{ + Name: "build.tag", + Usage: "build tag", + EnvVar: "DRONE_TAG", + }, cli.Float64Flag{ Name: "job.started", Usage: "job started", @@ -177,6 +182,7 @@ func run(c *cli.Context) error { Name: c.String("repo.name"), }, Build: Build{ + Tag: c.String("build.tag"), Number: c.Int("build.number"), Event: c.String("build.event"), Status: c.String("build.status"), diff --git a/plugin.go b/plugin.go index 877631b..2139582 100644 --- a/plugin.go +++ b/plugin.go @@ -21,6 +21,7 @@ type ( // Build information. Build struct { + Tag string Event string Number int Commit string diff --git a/plugin_test.go b/plugin_test.go index e8212d2..4eccd53 100644 --- a/plugin_test.go +++ b/plugin_test.go @@ -56,6 +56,7 @@ func TestSendMessage(t *testing.T) { Owner: "appleboy", }, Build: Build{ + Tag: "1.0.0", Number: 101, Status: "success", Link: "https://github.com/appleboy/go-hello",