Added makefile and use it within drone config
This commit is contained in:
parent
155644c4e7
commit
71068d6a1e
15
.drone.yml
15
.drone.yml
|
@ -1,14 +1,9 @@
|
||||||
build:
|
build:
|
||||||
image: golang:1.5
|
image: golang:1.5
|
||||||
environment:
|
|
||||||
- GO15VENDOREXPERIMENT=1
|
|
||||||
- GOOS=linux
|
|
||||||
- GOARCH=amd64
|
|
||||||
- CGO_ENABLED=0
|
|
||||||
commands:
|
commands:
|
||||||
- go get
|
- make deps
|
||||||
- go build
|
- make build
|
||||||
- go test
|
- make test
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
docker:
|
docker:
|
||||||
|
@ -21,10 +16,12 @@ publish:
|
||||||
|
|
||||||
plugin:
|
plugin:
|
||||||
name: Webhook
|
name: Webhook
|
||||||
desc: Send webhook notifications when your build completes.
|
desc: Send build status notifications via Webhook
|
||||||
type: notify
|
type: notify
|
||||||
image: plugins/drone-webhook
|
image: plugins/drone-webhook
|
||||||
labels:
|
labels:
|
||||||
|
- notify
|
||||||
|
- webhook
|
||||||
- rest
|
- rest
|
||||||
- json
|
- json
|
||||||
- hook
|
- hook
|
||||||
|
|
|
@ -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)'
|
Loading…
Reference in New Issue