support tag string.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
b688f301ba
commit
70655117a2
@ -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) \
|
||||
|
6
main.go
6
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"),
|
||||
|
@ -21,6 +21,7 @@ type (
|
||||
|
||||
// Build information.
|
||||
Build struct {
|
||||
Tag string
|
||||
Event string
|
||||
Number int
|
||||
Commit string
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user