-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
67 lines (56 loc) · 1.59 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
CHARTS ?= *
REPO ?=
FORCE ?= false
SKIPDEPS ?= false
SKIPREFRESH ?= false
ifneq ($(filter $(FORCE),true yes),)
_force := -f
endif
ifneq ($(filter $(SKIPDEPS),true yes),)
_skipdeps := true
endif
ifneq ($(filter $(SKIPREFRESH),true yes),)
_skiprefresh := --skip-refresh
endif
AUTH := $(shell cat auth 2>/dev/null)
ifneq "$(AUTH)" ""
# Explicitly set auth flags if an auth file exists
auth_parts = $(subst :, ,$(AUTH))
_auth_str := -u "$(word 1,$(auth_parts))" -p "$(word 2,$(auth_parts))"
_repo := $(REPO)
else ifneq ($(filter $(MAKECMDGOALS),helm-cm-push),)
# Try to get a name from managed Helm repos
_repo := $(shell helm repo ls | tail -n +2 | grep -E "(^|[[:space:]])$(REPO)($$|[[:space:]])" | awk '{print $$1}')
endif
docs:
@for chart in $(CHARTS); do \
readme-generator -v charts/$$chart/values.yaml -r charts/$$chart/README.md \
; done
package:
ifeq "$(CHARTS)" "*"
@helm package charts/* -u -d .deploy
else
@for chart in $(CHARTS); do \
helm package charts/$$chart -u -d .deploy \
; done
endif
helm-cm-push:
@test $(_skipdeps) || helm dep build $(CHART) $(_skiprefresh)
@helm cm-push $(_auth_str) $(_force) "$(CHART)" $(_repo)
cm-push:
@test $(_skipdeps) || test $(_skiprefresh) || helm repo update
ifeq "$(CHARTS)" "*"
@for chart in charts/*; do \
$(MAKE) --no-print-directory helm-cm-push SKIPREFRESH=true CHART="$$chart" \
; done
else
@for chart in $(CHARTS); do \
$(MAKE) --no-print-directory helm-cm-push SKIPREFRESH=true CHART="charts/$$chart" \
; done
endif
push-packaged:
for package in .deploy/*; do \
helm push $(_force) $$package $(REPO) \
; done
clean:
rm -r .deploy