forked from chartmuseum/helm-push
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
79 lines (62 loc) · 1.98 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
PLUGIN_NAME := cm-push
HAS_PIP := $(shell command -v pip3;)
HAS_VENV := $(shell command -v virtualenv;)
.PHONY: build
build: build_linux build_mac build_windows
build_windows: export GOARCH=amd64
build_windows: export GO111MODULE=on
build_windows:
@GOOS=windows go build -v --ldflags="-w -X main.Version=$(VERSION) -X main.Revision=$(REVISION)" \
-o bin/windows/amd64/helm-cm-push cmd/helm-cm-push/main.go # windows
link_windows:
@cp bin/windows/amd64/helm-cm-push ./bin/helm-cm-push
build_linux: export GOARCH=amd64
build_linux: export CGO_ENABLED=0
build_linux: export GO111MODULE=on
build_linux:
@GOOS=linux go build -v --ldflags="-w -X main.Version=$(VERSION) -X main.Revision=$(REVISION)" \
-o bin/linux/amd64/helm-cm-push cmd/helm-cm-push/main.go # linux
link_linux:
@cp bin/linux/amd64/helm-cm-push ./bin/helm-cm-push
build_mac: export GOARCH=amd64
build_mac: export CGO_ENABLED=0
build_mac: export GO111MODULE=on
build_mac:
@GOOS=darwin go build -v --ldflags="-w -X main.Version=$(VERSION) -X main.Revision=$(REVISION)" \
-o bin/darwin/amd64/helm-cm-push cmd/helm-cm-push/main.go # mac osx
@cp bin/darwin/amd64/helm-cm-push ./bin/helm-cm-push # For use w make install
link_mac:
@cp bin/darwin/amd64/helm-cm-push ./bin/helm-cm-push
.PHONY: clean
clean:
@git status --ignored --short | grep '^!! ' | sed 's/!! //' | xargs rm -rf
.PHONY: test
test: setup-test-environment
@./scripts/test.sh
.PHONY: covhtml
covhtml:
@go tool cover -html=.cover/cover.out
.PHONY: tree
tree:
@tree -I vendor
.PHONY: release
release:
@scripts/release.sh $(VERSION)
.PHONY: install
install:
HELM_PUSH_PLUGIN_NO_INSTALL_HOOK=1 helm plugin install $(shell pwd)
.PHONY: remove
remove:
helm plugin remove $(PLUGIN_NAME)
.PHONY: setup-test-environment
setup-test-environment:
ifndef HAS_PIP
@apt-get update && apt-get install -y python-pip
endif
ifndef HAS_VENV
@pip install virtualenv
endif
@./scripts/setup_test_environment.sh
.PHONY: acceptance
acceptance: setup-test-environment
@./scripts/acceptance.sh