This repository was archived by the owner on Aug 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain_delete.sh
More file actions
104 lines (77 loc) · 3.01 KB
/
main_delete.sh
File metadata and controls
104 lines (77 loc) · 3.01 KB
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
#!/bin/sh
DELETE_COMMON="FALSE"
DELETE_DEVICE="FALSE"
DELETE_WEBSITE="FALSE"
DELETE_CONSUMER="FALSE"
DELETE_QUERY="FALSE"
DELETE_ANALYTICS="FALSE"
DELETE_KUBERNETES="FALSE"
DELETE_APPS="FALSE"
##################################################
########## Common #############
##################################################
. ./set_common_env-vars.sh
##################################################
########## Apps #############
##################################################
if [ "$DELETE_APPS" = "TRUE" ]; then
echo "Calling kubectl delete -f metrics-server"
kubectl delete -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
echo "Calling helm uninstall kubernetes-ingress"
helm uninstall kubernetes-ingress
echo "Calling kubectl -n default delete pod,svc,job --all"
kubectl -n default delete pod,svc,job --all
fi
##################################################
########## Kubernetes #############
##################################################
if [ "$DELETE_KUBERNETES" = "TRUE" ]; then
echo "Calling ./eksctl/delete_cluster.sh"
. ./eksctl/delete_cluster.sh
echo "Deleting AWS EKS log group"
aws logs delete-log-group --log-group-name /aws/eks/$PROJECT_NAME-cluster/cluster
fi
##################################################
########## Analytics #############
##################################################
if [ "$DELETE_ANALYTICS" = "TRUE" ]; then
. ./set_analytics_env-vars.sh
. ./delete_cicd.sh # ./create_cicd.sh
fi
##################################################
########## Query #############
##################################################
if [ "$DELETE_QUERY" = "TRUE" ]; then
. ./set_query_env-vars.sh
. ./delete_cicd.sh # ./create_cicd.sh
fi
##################################################
########## Consumer #############
##################################################
if [ "$DELETE_CONSUMER" = "TRUE" ]; then
. ./set_consumer_env-vars.sh
. ./delete_cicd.sh # ./create_cicd.sh
fi
##################################################
########## Website #############
##################################################
if [ "$DELETE_WEBSITE" = "TRUE" ]; then
. ./set_react_env-vars.sh
. ./delete_cicd.sh # ./create_cicd.sh
. ./delete_react_resources.sh # ./create_react_resources.sh
fi
##################################################
########## Device #############
##################################################
if [ "$DELETE_DEVICE" = "TRUE" ]; then
. ./set_device_env-vars.sh
. ./delete_cicd.sh # ./create_cicd.sh
. ./delete_device_resources.sh # ./create_device_resources.sh
fi
##################################################
########## Common #############
##################################################
if [ "$DELETE_COMMON" = "TRUE" ]; then
. ./delete_common_resources.sh
fi
echo "FINISHED!"