diff --git a/.drone.yml b/.drone.yml index c7ba612..25def7d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,14 +1,9 @@ build: image: golang:1.5 - environment: - - GO15VENDOREXPERIMENT=1 - - GOOS=linux - - GOARCH=amd64 - - CGO_ENABLED=0 commands: - - go get - - go build - - go test + - make deps + - make build + - make test publish: docker: @@ -21,10 +16,12 @@ publish: plugin: name: Webhook - desc: Send webhook notifications when your build completes. + desc: Send build status notifications via Webhook type: notify image: plugins/drone-webhook labels: + - notify + - webhook - rest - json - hook diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6644e77 --- /dev/null +++ b/Makefile @@ -0,0 +1,22 @@ +.PHONY: clean deps test build + +export GOOS ?= linux +export GOARCH ?= amd64 +export CGO_ENABLED ?= 0 + +CI_BUILD_NUMBER ?= 0 + +LDFLAGS += -X "main.buildDate=$(shell date -u '+%Y-%m-%d %H:%M:%S %Z')" +LDFLAGS += -X "main.build=$(CI_BUILD_NUMBER)" + +clean: + go clean -i ./... + +deps: + go get -t ./... + +test: + go test -cover ./... + +build: + go build -ldflags '-s -w $(LDFLAGS)'