forked from FortnoxAB/kube-annotations-exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
28 lines (20 loc) · 725 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
.PHONY: build push run
IMAGE = quay.io/fortnox/kube-annotations-exporter
# supply when running make: make all VERSION=1.0.0
#VERSION = 0.0.1
build:
CGO_ENABLED=0 GOOS=linux go build ./cmd/kube-annotations-exporter
docker: build
docker build --pull --rm -t $(IMAGE):$(VERSION) .
rm kube-annotations-exporter
push: docker
docker push $(IMAGE):$(VERSION)
all: build docker push
run:
docker run -i --rm -p 8080:8080 -t $(IMAGE):$(VERSION)
test: fmt
go test ./...
localrun:
bash -c "env `grep -Ev '^#' .env | xargs` go run ./cmd/..."
fmt:
bash -c "test -z $$(gofmt -l $$(find . -type f -name '*.go' -not -path './vendor/*') | tee /dev/stderr) || (echo 'Code not formatted correctly according to gofmt!' && exit 1)"