-
Notifications
You must be signed in to change notification settings - Fork 11
/
test.sh
executable file
·54 lines (46 loc) · 1.13 KB
/
test.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
function printSuccess {
cat <<"EOF"
____
/ ___| _ _ ___ ___ ___ ___ ___
\___ \| | | |/ __/ __/ _ \/ __/ __|
___) | |_| | (_| (_| __/\__ \__ \
|____/ \__,_|\___\___\___||___/___/
EOF
}
function printFailed {
cat <<"EOF"
_____ _ _ _
| ___|_ _(_) | ___ __| |
| |_ / _` | | |/ _ \/ _` |
| _| (_| | | | __/ (_| |
|_| \__,_|_|_|\___|\__,_|
EOF
}
HELM_CHART=$(dialog \
--backtitle "Helm Chart Testing" \
--title "Select Chart" \
--cancel-label "Exit" \
--menu "Select the Helm Chart to test" 25 50 20 \
"1" "Plane-CE" \
"2" "Plane-Enterprise" \
3>&1 1>&2 2>&3)
if [ "$HELM_CHART" == "1" ]; then
helm template plane-ce-app-$(date +%s) charts/plane-ce -n myns > test-ce.yaml
if [ $? -eq 0 ]; then
clear
printSuccess
else
printFailed
fi
elif [ "$HELM_CHART" == "2" ]; then
helm template plane-enterprise-app-$(date +%s) charts/plane-enterprise -n myns > test-enterprise.yaml
if [ $? -eq 0 ]; then
clear
printSuccess
code test-enterprise.yaml
else
printFailed
fi
else
exit 0
fi