-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
30 lines (24 loc) · 920 Bytes
/
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
.PHONY: all
all: deps install
test: unit_test linter
deps:
go get -u ./...
vendors:
go get github.com/Masterminds/glide; \
glide install
install:
go install --ldflags "-s -w -X github.com/Zenika/zenscaler/core.Version=`git describe --tags --dirty`" .
linter:
go install . && gometalinter -j4 --deadline 300s ./...
unit_test:
go test -v --cover ./api
go test -v --cover ./cmd
build:
CGO_ENABLED=0 GOGC=off go build --ldflags "-s -w -X github.com/Zenika/zenscaler/core.Version=`git describe --tags --dirty`" .
docker: docker-build docker-image
docker-build:
mkdir -p ./build
docker build -t zenscaler-build -f build.Dockerfile . ; \
docker run -e "CGO_ENABLED=0" -e "GOGC=off" -v $$PWD/build:/build --rm zenscaler-build go build --ldflags "-s -w -X github.com/Zenika/zenscaler/core.Version=`git describe --tags --dirty`" -o /build/zenscaler .
docker-image:
docker build --rm -t zenika/zenscaler:latest .