Integrated a makefile
This commit is contained in:
parent
49937bafb0
commit
40520edfdb
14
.drone.yml
14
.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,9 +16,8 @@ publish:
|
|||
|
||||
plugin:
|
||||
name: Email
|
||||
desc: Send build status notifications via email.
|
||||
desc: Send build status notifications via Email
|
||||
type: notify
|
||||
image: plugins/drone-email
|
||||
labels:
|
||||
- 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 .
|
||||
|
||||
FROM gliderlabs/alpine:3.1
|
||||
RUN apk-install ca-certificates
|
||||
FROM alpine:3.2
|
||||
|
||||
RUN apk update && \
|
||||
apk add \
|
||||
ca-certificates && \
|
||||
rm -rf /var/cache/apk/*
|
||||
|
||||
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