This repository has been archived by the owner on Sep 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
helm.sh
executable file
·58 lines (51 loc) · 1.52 KB
/
helm.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
DIR="$(pwd)"/.cache
mkdir -p "$DIR"
FILE=$DIR/linux-amd64/helm
if test -f "$FILE"; then
echo "$FILE exist"
else
echo "$FILE does not exist"
curl -fsSL -o "$DIR"/helm.tar.gz https://get.helm.sh/helm-v3.2.3-linux-amd64.tar.gz
cd "$DIR" && tar -xzvf helm.tar.gz && rm -rf helm.tar.gz && cd ..
fi
# shellcheck disable=SC2139
alias helm="$DIR/linux-amd64/helm"
printf '\n'
helm version
printf '\n'
DEPLOYMENT="example-deployment"
CHART_DIR="src/helm-chart"
option="${1}"
case ${option} in
--deploy)
helm upgrade \
--install -f $CHART_DIR/values.yaml \
--set spring.profiles.active=dev \
--set springbootdb.enabled=false \
$DEPLOYMENT $CHART_DIR --force
;;
--deploy-prod)
helm upgrade \
--install -f $CHART_DIR/values.yaml \
--set spring.profiles.active=prod \
--set springbootdb.enabled=true \
--set springbootdb.postgresqlDatabase=orders-db \
--set springbootdb.postgresqlUsername=user \
--set springbootdb.postgresqlPassword=password \
--set springbootdb.persistence.enabled=false \
$DEPLOYMENT $CHART_DIR --force
;;
--update-charts)
helm dependency update $CHART_DIR
;;
--add-repos)
helm repo add bitnami https://charts.bitnami.com/bitnami
;;
--delete)
helm delete $DEPLOYMENT
;;
*)
echo "`basename ${0}`:usage: [--deploy] | [--upgrade-charts] | [--add-repos] | [--delete]"
exit 1 # Command to come out of the program with status 1
;;
esac