-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (24 loc) · 768 Bytes
/
Makefile
File metadata and controls
34 lines (24 loc) · 768 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
.PHONY: install clean test image push-image
IMAGE := xingse/kubernetes-deployment-restart-controller
BRANCH = $(shell git rev-parse --abbrev-ref HEAD)
all: kubernetes-deployment-restart-controller
kubernetes-deployment-restart-controller: $(shell find . -name "*.go") $(wildcard go.*)
go build
clean:
go clean ./...
test:
@go test -v ./...
image:
docker build -t $(IMAGE) .
push-image:
docker push $(IMAGE)
release: image
ifneq ($(BRANCH),master)
$(error release only works from master, currently on '$(BRANCH)')
endif
$(MAKE) perform-release
TAG = $(shell docker run --rm $(IMAGE) --version | grep -oE "kubernetes-deployment-restart-controller [^ ]+" | cut -d ' ' -f2)
perform-release:
git tag $(TAG)
git push origin $(TAG)
git push origin master