-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
37 lines (29 loc) · 1.09 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
NAME=vault-sync
AUTHOR=Orange
REGISTRY=docker.io
IMPORT_PATH=github.com/cloudwatt/vault-sync
HARDWARE=$(shell uname -m)
VERSION=$(shell git describe --tags --always)
VETARGS?=-asmdecl -atomic -bool -buildtags -copylocks -methods -nilfunc -printf -rangeloops -shift -structtags -unsafeptr
.PHONY: test authors changelog build docker static release lint cover vet
default: build
build:
@echo "--> Compiling the project"
mkdir -p bin
go build -a -ldflags "-X main.Version=${VERSION}" -o bin/${NAME} .
static:
@echo "--> Compiling the static binary"
mkdir -p bin
CGO_ENABLED=0 GOOS=linux go build -a -tags netgo -ldflags "-X main.Version=${VERSION}" -o bin/${NAME} .
docker-build:
@echo "--> Compiling the project"
docker run --rm -v ${ROOT_DIR}:/go/src/${IMPORT_PATH} \
-w /go/src/${IMPORT_PATH}/ -e GOOS=linux golang:${GOVERSION} make static
authors:
@echo "--> Updating the AUTHORS"
git log --format='%aN <%aE>' | sort -u > AUTHORS
test: deps
@echo "--> Running the tests"
go test -v $(glide nv)
changelog: release
git log $(shell git tag | tail -n1)..HEAD --no-merges --format=%B > changelog