Integrated a makefile

This commit is contained in:
Thomas Boerger 2015-12-11 09:46:07 +01:00
parent 49937bafb0
commit 40520edfdb
3 changed files with 37 additions and 15 deletions

View file

@ -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

View file

@ -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
View 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)'