-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (28 loc) · 834 Bytes
/
Makefile
File metadata and controls
39 lines (28 loc) · 834 Bytes
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
38
39
IMAGE_NAME ?= registry.digitalocean.com/anubis/anubis-authz
PACKAGES=$(shell go list ./...)
SRCS = $(shell git ls-files '*.go' | grep -v '^vendor/')
GIT_TAG ?= $(shell git log -1 --pretty=%h)
export GIT_TAG
export IMAGE_VERSION ?= $(VERSION)
export CGO_ENABLED=off
export GO111MODULE=on
.PHONY: all bin/anubis-authz test image clean
default: bin/anubis-authz
all: image
docker build .
fmt:
gofmt -w $(SRCS)
build:
docker build -t ${IMAGE_NAME}:${GIT_TAG} .
docker tag ${IMAGE_NAME}:${GIT_TAG} ${IMAGE_NAME}:latest
push:
docker push ${IMAGE_NAME}:${GIT_TAG}
docker push ${IMAGE_NAME}:latest
deploy: build push
bin/anubis-authz:
mkdir -p bin/
go build -o bin/anubis-authz --ldflags "-X \"main.version=$(VERSION)\"" -a -installsuffix cgo main.go
test: bin/anubis-authz
go test -v ${PACKAGES}
clean:
rm -rf bin/ main