diff --git a/Makefile b/Makefile index b407868..1b0f120 100644 --- a/Makefile +++ b/Makefile @@ -2,8 +2,9 @@ EXECUTABLE ?= drone-ssh 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 a5f334c..1c0439a 100644 --- a/main.go +++ b/main.go @@ -14,11 +14,11 @@ import ( ) var ( - buildDate string + buildCommit string ) func main() { - fmt.Printf("Drone SSH Plugin built at %s\n", buildDate) + fmt.Printf("Drone SSH Plugin built from %s\n", buildCommit) workspace := drone.Workspace{} vargs := Params{}