-
Notifications
You must be signed in to change notification settings - Fork 30
/
start.sh
executable file
·105 lines (93 loc) · 2.51 KB
/
start.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/bin/bash
# use the bash_colors.sh file
found_colors="./tools/bash_colors.sh"
if [[ "${DISABLE_COLORS}" == "" ]] && [[ "${found_colors}" != "" ]] && [[ -e ${found_colors} ]]; then
. ${found_colors}
else
inf() {
echo "$@"
}
anmt() {
echo "$@"
}
good() {
echo "$@"
}
err() {
echo "$@"
}
critical() {
echo "$@"
}
warn() {
echo "$@"
}
fi
# reload the apps on startup by calling it with:
# ./start.sh -r
#
# reload with splunk enabled:
# ./start.sh -r splunk
# or
# ./start.sh splunk -r
should_cleanup_before_startup=0
cert_env="dev"
extra_params=""
for i in "$@"
do
if [[ "${i}" == "splunk" ]] || [[ "${i}" == "splunk/" ]]; then
if [[ "${extra_params}" == "" ]]; then
extra_params="splunk"
else
extra_params="${extra_params} splunk"
fi
elif [[ "${i}" == "-r" ]] || [[ "${i}" == "r" ]] || [[ "${i}" == "reload" ]]; then
should_cleanup_before_startup=1
elif [[ "${i}" == "prod" ]]; then
cert_env="prod"
elif [[ "${i}" == "antinex" ]]; then
cert_env="antinex"
elif [[ "${i}" == "qs" ]]; then
cert_env="qs"
elif [[ "${i}" == "redten" ]]; then
cert_env="redten"
fi
done
if [[ "${should_cleanup_before_startup}" == "1" ]]; then
warn "deleting apps before start"
anmt " - deleting api"
./api/_uninstall.sh
anmt " - deleting worker"
./worker/_uninstall.sh
anmt " - deleting core"
./core/_uninstall.sh
anmt " - deleting jupyter"
./jupyter/_uninstall.sh
inf "done"
fi
if [[ "${extra_params}" == "" ]]; then
extra_params="${cert_env}"
else
extra_params="${extra_params} ${cert_env}"
fi
if [[ "${cert_env}" != "dev" ]]; then
anmt "starting cert-manager with Lets Encrypt: ${cert_env}"
./cert-manager/run.sh ${cert_env}
inf ""
fi
anmt "starting api: https://github.com/jay-johnson/deploy-to-kubernetes/blob/master/api/run.sh ${extra_params}"
./api/run.sh ${extra_params}
inf ""
anmt "starting core: https://github.com/jay-johnson/deploy-to-kubernetes/blob/master/core/run.sh ${extra_params}"
./core/run.sh ${extra_params}
inf ""
anmt "starting worker: https://github.com/jay-johnson/deploy-to-kubernetes/blob/master/worker/run.sh ${extra_params}"
./worker/run.sh ${extra_params}
inf ""
anmt "starting jupyter: https://github.com/jay-johnson/deploy-to-kubernetes/blob/master/jupyter/run.sh ${extra_params}"
./jupyter/run.sh ${extra_params}
inf ""
anmt "getting pods:"
kubectl get pods
inf ""
exit 0