-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (44 loc) · 1.51 KB
/
Makefile
File metadata and controls
58 lines (44 loc) · 1.51 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
all: build
FLAGS=
OFFICIAL_NAME=balancer
build: clean
go build .
build-linux-amd64: clean
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build .
test-unit: clean
go test --test.short -race ./... $(FLAGS)
docker-build:
ifndef REGISTRY
ERR = $(error REGISTRY is undefined)
$(ERR)
endif
ifndef TAG
ERR = $(error TAG is undefined)
$(ERR)
endif
docker build --pull -t ${REGISTRY}/${OFFICIAL_NAME}:${TAG} .
docker-push:
ifndef REGISTRY
ERR = $(error REGISTRY is undefined)
$(ERR)
endif
ifndef TAG
ERR = $(error TAG is undefined)
$(ERR)
endif
docker push ${REGISTRY}/${OFFICIAL_NAME}:${TAG}
docker-builder:
docker build -t vpa-autoscaling-builder ../vertical-pod-autoscaler/builder
build-in-docker: clean docker-builder
docker run -v `pwd`/..:/gopath/src/k8s.io/autoscaler vpa-autoscaling-builder:latest bash -c 'cd /gopath/src/k8s.io/autoscaler/balancer && make build-linux-amd64'
build-image-in-docker: build-in-docker docker-build
test-in-docker: build-in-docker
docker run -v `pwd`/..:/gopath/src/k8s.io/autoscaler vpa-autoscaling-builder:latest bash -c 'cd /gopath/src/k8s.io/autoscaler/balancer && make test-unit'
release: build-image-in-docker docker-push
@echo "Full in-docker release ${OFFICIAL_NAME}:${TAG} completed"
clean:
rm -f balancer
format:
test -z "$$(find . -path ./vendor -prune -type f -o -name '*.go' -exec gofmt -s -d {} + | tee /dev/stderr)" || \
test -z "$$(find . -path ./vendor -prune -type f -o -name '*.go' -exec gofmt -s -w {} + | tee /dev/stderr)"
.PHONY: all build test-unit clean format release