forked from jthomperoo/custom-pod-autoscaler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (34 loc) · 1.38 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
38
39
40
41
42
REGISTRY = ci-registry.c3iot.io
NAME = custom-pod-autoscaler
VERSION = 1.0.1
C3UBI = c3-ubi
default: vendor_modules
@echo "=============Building============="
CGO_ENABLED=0 GOOS=linux go build -ldflags="-X 'main.Version=$(VERSION)'" -mod vendor -o dist/$(NAME) main.go
cp LICENSE dist/LICENSE
test: vendor_modules
@echo "=============Running unit tests============="
go test -mod vendor ./... -cover -coverprofile unit_cover.out
lint: vendor_modules
@echo "=============Linting============="
go list -mod vendor ./... | grep -v /vendor/ | xargs -L1 golint -set_exit_status
beautify: vendor_modules
@echo "=============Beautifying============="
gofmt -s -w .
go mod tidy
docker: default
@echo "=============Building docker images============="
docker build --target=python-3-6 -t $(REGISTRY)/python-3-6:$(VERSION) .
docker build --target=python-3-7 -t $(REGISTRY)/python-3-7:$(VERSION) .
docker build --target=python-3-8 -t $(REGISTRY)/python-3-8:$(VERSION) .
docker build --target=$(C3UBI) -t $(REGISTRY)/scaler-base:$(VERSION) .
docker build --target=openjdk-11 -t $(REGISTRY)/openjdk-11:$(VERSION) .
docker tag $(REGISTRY)/python-3-8:$(VERSION) $(REGISTRY)/python:$(VERSION)
doc:
@echo "=============Serving docs============="
mkdocs serve
view_coverage:
@echo "=============Loading coverage HTML============="
go tool cover -html=unit_cover.out
vendor_modules:
go mod vendor