diff --git a/Makefile b/Makefile index 305d679..54eba0f 100644 --- a/Makefile +++ b/Makefile @@ -2,8 +2,9 @@ EXECUTABLE ?= drone-webhook IMAGE ?= plugins/$(EXECUTABLE) +COMMIT ?= $(shell git rev-parse --short HEAD) -LDFLAGS = -X "main.buildDate=$(shell date -u '+%Y-%m-%d %H:%M:%S %Z')" +LDFLAGS = -X "main.buildCommit=$(COMMIT)" PACKAGES = $(shell go list ./... | grep -v /vendor/) all: deps build test diff --git a/main.go b/main.go index 253e839..d861248 100644 --- a/main.go +++ b/main.go @@ -20,11 +20,11 @@ const ( ) var ( - buildDate string + buildCommit string ) func main() { - fmt.Printf("Drone Webhook Plugin built at %s\n", buildDate) + fmt.Printf("Drone Webhook Plugin built from %s\n", buildCommit) system := drone.System{} repo := drone.Repo{}