/
delete-all.sh
executable file
·71 lines (54 loc) · 2.1 KB
/
delete-all.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
#!/bin/bash
root_folder=$(cd $(dirname $0); cd ..; pwd)
exec 3>&1
function login() {
oc login -u developer -p developer
oc project cloud-native-starter
}
function _out() {
echo "$(date +'%F %H:%M:%S') $@"
}
function setup() {
_out --------------------------------------------------------
_out Deleting articles-java-jee
cd ${root_folder}/articles-java-jee
oc delete all -l app=articles --ignore-not-found
oc delete all -l app=articles --ignore-not-found
oc delete configmap -l app=articles --ignore-not-found
oc delete -f deployment/istio.yaml --ignore-not-found
_out Done Deleting articles-java-jee
_out --------------------------------------------------------
_out Deleting authors-nodejs
cd ${root_folder}/authors-nodejs
oc delete all -l app=authors --ignore-not-found
oc delete all -l app=authors --ignore-not-found
kubectl delete -f deployment/istio.yaml --ignore-not-found
_out Done Deleting authors-nodejs
_out --------------------------------------------------------
_out Deleting web-api-java-jee
cd ${root_folder}/web-api-java-jee
oc delete all -l app=web-api --ignore-not-found
oc delete all -l app=web-api --ignore-not-found
oc delete -f deployment/istio-service-v2.yaml --ignore-not-found
_out Done Deleting web-api-java-jee
_out --------------------------------------------------------
_out Deleting web-app
cd ${root_folder}/web-app-vuejs
oc delete all -l app=web-app --ignore-not-found
oc delete all -l app=web-app --ignore-not-found
oc delete -f deployment/istio.yaml --ignore-not-found
oc delete bc web-app --ignore-not-found
oc delete build web-app-1 --ignore-not-found
oc delete pod web-app-1-build --ignore-not-found
oc delete istag web-app:latest --ignore-not-found
_out Done Deleting web-app
_out --------------------------------------------------------
_out Deleting Istio Ingress
cd ${root_folder}/istio
oc delete -f istio-ingress-gateway.yaml
oc delete -f istio-ingress-service-web-api-v1-only.yaml
_out Done Deleting Istio Ingress
_out --------------------------------------------------------
}
login
setup