Integrated a makefile
This commit is contained in:
parent
49937bafb0
commit
40520edfdb
14
.drone.yml
14
.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,9 +16,8 @@ publish:
|
||||||
|
|
||||||
plugin:
|
plugin:
|
||||||
name: Email
|
name: Email
|
||||||
desc: Send build status notifications via email.
|
desc: Send build status notifications via Email
|
||||||
type: notify
|
type: notify
|
||||||
image: plugins/drone-email
|
image: plugins/drone-email
|
||||||
labels:
|
labels:
|
||||||
- email
|
- email
|
||||||
|
|
||||||
|
|
16
Dockerfile
16
Dockerfile
|
@ -1,9 +1,15 @@
|
||||||
# Docker image for Drone's email notification plugin
|
# Docker image for the Drone Email plugin
|
||||||
#
|
#
|
||||||
# CGO_ENABLED=0 go build -a -tags netgo
|
# cd $GOPATH/src/github.com/drone-plugins/drone-email
|
||||||
|
# make deps build
|
||||||
# docker build --rm=true -t plugins/drone-email .
|
# docker build --rm=true -t plugins/drone-email .
|
||||||
|
|
||||||
FROM gliderlabs/alpine:3.1
|
FROM alpine:3.2
|
||||||
RUN apk-install ca-certificates
|
|
||||||
|
RUN apk update && \
|
||||||
|
apk add \
|
||||||
|
ca-certificates && \
|
||||||
|
rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
ADD drone-email /bin/
|
ADD drone-email /bin/
|
||||||
ENTRYPOINT ["/bin/drone-email"]
|
ENTRYPOINT ["/bin/drone-email"]
|
||||||
|
|
22
Makefile
Normal file
22
Makefile
Normal file
|
@ -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 a new issue