diff --git a/Makefile b/Makefile index 8bdae9c..08ec003 100644 --- a/Makefile +++ b/Makefile @@ -2,8 +2,9 @@ EXECUTABLE ?= drone-s3-sync 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 862312b..b9469c0 100644 --- a/main.go +++ b/main.go @@ -24,11 +24,11 @@ type result struct { } var ( - buildDate string + buildCommit string ) func main() { - fmt.Printf("Drone S3 Sync Plugin built at %s\n", buildDate) + fmt.Printf("Drone S3 Sync Plugin built from %s\n", buildCommit) vargs := PluginArgs{} workspace := drone.Workspace{}