-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
54 lines (40 loc) · 1.62 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
.DEFAULT_GOAL := upgrade
SHELL := bash
.PHONY: install uninstall upgrade update-dependencies postgres-password
helm_name := strmprivacy
namespace := strmprivacy
ifeq (,$(wildcard values.yaml))
$(error You must have values.yaml with credentials. See README.md)
endif
namespace:
kubectl create namespace ${namespace}
install:
-helm status ${helm_name} --namespace ${namespace} 2> /dev/null \
|| helm install ${helm_name} helm --namespace ${namespace} \
--values values.yaml --set namespace=${namespace}
uninstall:
-helm status ${helm_name} --namespace ${namespace} 2> /dev/null \
&& helm uninstall ${helm_name} --namespace ${namespace}
upgrade:
-helm status ${helm_name} --namespace ${namespace} 2> /dev/null \
&& helm upgrade ${helm_name} helm --namespace ${namespace} --debug \
--values values.yaml --set namespace=${namespace}
template:
helm template --debug helm --values values.yaml --set namespace=${namespace}
template-dashboard:
helm template helm -s templates/event-gateway/dashboards.yaml --values values.yaml --set namespace=${namespace}
template-event-gateway-deployment:
helm template --debug helm -s templates/event-gateway/deployment.yaml --values values.yaml --set namespace=${namespace}
update-dependencies:
helm dependency update helm
postgres-password:
@kubectl get secret postgres -o jsonpath="{.data.postgres-password}" | base64 --decode
wipe: check_clean
make uninstall
kubectl delete namespace ${namespace}
check_clean:
@echo "We're going to wipe these and uninstall helm"
kubectl get pvc
kubectl get secrets
@echo -n "Are you sure? [y/N] " && read ans && [ $${ans:-N} = y ]
.PHONY: clean check_clean