forked from fabric8-ui/fabric8-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
local_cleanup.sh
28 lines (19 loc) · 1.2 KB
/
local_cleanup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Delete/cleanup OpenShift assets
oc login https://api.starter-us-east-2.openshift.com --token=$1
oc delete bc --all -n almusertest1
oc delete build --all -n almusertest1
oc delete build --all -n almusertest1-test
oc delete build --all -n almusertest1-stage
oc delete service --all -n almusertest1-stage
oc delete dc --all -n almusertest1-stage
oc delete build --all -n almusertest1-run
oc delete build --all -n almusertest1-jenkins
oc delete bc --all -n almusertest1-jenkins
oc delete imagestream --all -n almusertest1-jenkins
## Delete/cleanup Jenkins jobs - commented out for now - until test can run more reliably
##
## export TOKEN=`docker exec fabric8-ui-builder cat ../.kube/config | grep token | sed -e 's/token://g' | sed -e 's/ //g'`
## export ID=`docker exec fabric8-ui-builder openshift-origin-client-tools-v1.5.0-031cbe4-linux-64bit/oc whoami`
## export GITID=almightytest
##
## curl -d "json=%7B%7D&Submit=Yes" -X POST -H "Authorization: Bearer ${TOKEN}" -H "Referer: https://jenkins-${ID}-jenkins.8a09.starter-us-east-2.openshiftapps.com/job/${GITID}/delete" -H "Content-Type: application/x-www-form-urlencoded" https://jenkins-${ID}-jenkins.8a09.starter-us-east-2.openshiftapps.com/job/${GITID}/doDelete