-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
84 lines (66 loc) · 1.99 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
80
81
82
83
84
PLUGIN_NAME := login
HAS_DEP := $(shell command -v dep;)
HAS_PIP := $(shell command -v pip;)
HAS_VENV := $(shell command -v virtualenv;)
.PHONY: bootstrap
bootstrap:
ifndef HAS_DEP
@go get -u github.com/golang/dep/cmd/dep
endif
@dep ensure -v -vendor-only
.PHONY: build
build: build_linux build_mac build_windows
build_windows: export GOARCH=amd64
build_windows:
@GOOS=windows go build -v --ldflags="-w -X main.Version=$(VERSION) -X main.Revision=$(REVISION)" \
-o bin/windows/amd64/helmlogin cmd/helmlogin/main.go # windows
link_windows:
@cp bin/windows/amd64/helmlogin ./bin/helmlogin
build_linux: export GOARCH=amd64
build_linux: export CGO_ENABLED=0
build_linux:
@GOOS=linux go build -v --ldflags="-w -X main.Version=$(VERSION) -X main.Revision=$(REVISION)" \
-o bin/linux/amd64/helmlogin cmd/helmlogin/main.go # linux
link_linux:
@cp bin/linux/amd64/helmlogin ./bin/helmlogin
build_mac: export GOARCH=amd64
build_mac: export CGO_ENABLED=0
build_mac:
@GOOS=darwin go build -v --ldflags="-w -X main.Version=$(VERSION) -X main.Revision=$(REVISION)" \
-o bin/darwin/amd64/helmlogin cmd/helmlogin/main.go # mac osx
@cp bin/darwin/amd64/helmlogin ./bin/helmlogin # For use w make install
link_mac:
@cp bin/darwin/amd64/helmlogin ./bin/helmlogin
.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_LOGIN_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