-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstep.sh
executable file
·42 lines (33 loc) · 1.05 KB
/
step.sh
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
#!/bin/sh
helm init --client-only
ni cluster config
NS=$(ni get -p {.namespace})
CLUSTER=$(ni get -p {.cluster.name})
KUBECONFIG=/workspace/"${CLUSTER}"/kubeconfig
TLS_OPTIONS=
CREDENTIALS=$(ni get -p {.credentials})
if [ -n "${CREDENTIALS}" ]; then
ni credentials config -d $(helm home)
TLS_OPTIONS="--tls --tls-verify"
fi
CHART_NAME=$(ni get -p {.name})
CHART_PATH=$(ni get -p {.chart})
GIT=$(ni get -p {.git})
REPOSITORY=$(ni get -p {.repository})
if [ -n "${GIT}" ]; then
ni git clone
CHART_PATH=/workspace/$(ni get -p {.git.name})/${CHART_PATH}
elif [ -n "${REPOSITORY}" ]; then
helm repo add remote "${REPOSITORY}"
CHART_PATH="remote/${CHART_PATH}"
fi
RECREATE_PODS_OPTIONS=
RECREATE_PODS=$(ni get -p {.recreatePods})
if [ "${RECREATE_PODS}" = "true" ]; then
RECREATE_PODS_OPTIONS="--recreate-pods"
fi
ni file -p values -f values-overrides.yaml -o yaml
helm upgrade ${CHART_NAME} ${CHART_PATH} ${TLS_OPTIONS} \
--install ${RECREATE_PODS_OPTIONS} \
--namespace ${NS} --kubeconfig ${KUBECONFIG} \
-f values-overrides.yaml