-
Notifications
You must be signed in to change notification settings - Fork 14
/
delete_deployments.sh
executable file
·48 lines (36 loc) · 1.16 KB
/
delete_deployments.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
#!/usr/bin/env bash
set -eo pipefail
. utils.sh
set_namespace $TEST_APP_NAMESPACE_NAME
if [ $PLATFORM = 'kubernetes' ]; then
if ! [ "${DOCKER_EMAIL}" = "" ]; then
announce "Deleting image pull secret."
kubectl delete --ignore-not-found secret dockerpullsecret
fi
elif [ $PLATFORM = 'openshift' ]; then
announce "Deleting image pull secret."
$cli delete --ignore-not-found secrets dockerpullsecret
fi
announce "Deleting test app/sidecar deployment."
$cli delete --ignore-not-found \
deployment/test-app-api-sidecar \
service/test-app-api-sidecar \
serviceaccount/test-app-api-sidecar
if [ $PLATFORM = 'openshift' ]; then
oc delete --ignore-not-found deploymentconfig/test-app-api-sidecar
fi
announce "Deleting test app/init container deployment."
$cli delete --ignore-not-found \
deployment/test-app-api-init \
service/test-app-api-init \
serviceaccount/test-app-api-init
if [ $PLATFORM = 'openshift' ]; then
oc delete --ignore-not-found deploymentconfig/test-app-api-init
fi
echo "Waiting for pods to terminate"
until [[ "$(oc get pods 2>&1)" == "No resources found." ]]; do
sleep 4
echo -n '.'
done
echo
echo "Test app deleted."