-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathMakefile.helm
More file actions
51 lines (46 loc) · 1.89 KB
/
Makefile.helm
File metadata and controls
51 lines (46 loc) · 1.89 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
##########
# Helm
##########
export TARBALL = helm-v$(VERSION_HELM)-linux-amd64.tar.gz
CHARTS = $(notdir $(wildcard ./helm/*))
INSTANCES = $(notdir $(wildcard ./helm/instances/*))
.PHONY: helm_install
helm_install: /usr/local/bin/helm
helm repo add instantlinux https://instantlinux.github.io/docker-tools/
helm_list:
@helm list --time-format="Mon Jan 2 15:04" --all-namespaces \
--kube-context=sudo
# TODO retire values.yaml
$(CHARTS):: %: ../admin/services/values.yaml helm/%/Chart.lock
@echo --$(NOTICE) $@--
ifeq ($(ACTION), delete)
@helm uninstall --kube-context=sudo -n $(K8S_NAMESPACE) $@
else
@$(eval OVERRIDE := $(shell [ -s ../admin/services/values/$@.yaml ] \
&& echo "-f ../admin/services/values/$@.yaml"))
helm upgrade --install -f $< $(OVERRIDE) $(XARGS) $@ ./helm/$@
endif
@helm list --time-format="Mon Jan 2 15:04" --selector name=$@
# TODO this is identical to above but for subdir, DRY it out
# the helmify project is just too exhausting
$(INSTANCES):: %: ../admin/services/values.yaml helm/instances/%/Chart.lock
@echo --$(NOTICE) $@--
ifeq ($(ACTION), delete)
@helm uninstall --kube-context=sudo -n $(K8S_NAMESPACE) $@
else
@$(eval OVERRIDE := $(shell [ -s ../admin/services/values/$@.yaml ] \
&& echo "-f ../admin/services/values/$@.yaml"))
helm upgrade --install -f $< $(OVERRIDE) $(XARGS) $@ ./helm/instances/$@
endif
@helm list --time-format="Mon Jan 2 15:04" --selector name=$@
/usr/local/bin/helm:
wget -O /tmp/$(TARBALL) https://get.helm.sh/$(TARBALL)
wget -O /tmp/$(TARBALL).sha256 https://get.helm.sh/$(TARBALL).sha256sum
cd /tmp && sha256sum -c $(TARBALL).sha256
tar xf /tmp/$(TARBALL) -C /tmp
sudo mv /tmp/linux-amd64/helm /usr/local/bin
rm -r /tmp/$(TARBALL)* /tmp/linux-amd64
CHARTLOCK = $(addsuffix /Chart.lock, $(addprefix helm/, $(CHARTS))) \
$(addsuffix /Chart.lock, $(addprefix helm/instances/, $(INSTANCES)))
$(CHARTLOCK):
helm dependency update $(dir $@)