Add destroy cluster per status check 28/3628/1
authorRicardo Noriega <rnoriega@redhat.com>
Fri, 17 Jul 2020 10:41:13 +0000 (12:41 +0200)
committerRicardo Noriega <rnoriega@redhat.com>
Fri, 17 Jul 2020 10:41:13 +0000 (12:41 +0200)
Change-Id: I6a170e6a5a3f8c8d29e9407a7a3a3e243864ad20
Signed-off-by: Ricardo Noriega <rnoriega@redhat.com>
ci/kni_deploy_aws.sh
ci/kni_deploy_gcp.sh

index 0f7434a..198f839 100755 (executable)
@@ -56,6 +56,7 @@ cat $HOME/.kni/${SITE_NAME}/final_manifests/metadata.json
 
 if [ $STATUS -ne 0 ]; then
     echo "Error deploying in AWS"
+    $HOME/.kni/${SITE_NAME}/requirements/openshift-install destroy cluster --dir=/$HOME/.kni/${SITE_NAME}/final_manifests 2>&1 | tee ${WORKSPACE}/aws_destroy.log
     exit 1
 fi
 
@@ -65,6 +66,7 @@ STATUS=$?
 
 if [ $STATUS -ne 0 ]; then
     echo "Error applying workloads to AWS"
+    $HOME/.kni/${SITE_NAME}/requirements/openshift-install destroy cluster --dir=/$HOME/.kni/${SITE_NAME}/final_manifests 2>&1 | tee ${WORKSPACE}/aws_destroy.log
     exit 1
 fi
 
index 7c1f370..09a3348 100755 (executable)
@@ -56,6 +56,7 @@ cat $HOME/.kni/${SITE_NAME}/final_manifests/metadata.json
 
 if [ $STATUS -ne 0 ]; then
     echo "Error deploying in GCP"
+    $HOME/.kni/${SITE_NAME}/requirements/openshift-install destroy cluster --dir=/$HOME/.kni/${SITE_NAME}/final_manifests 2>&1 | tee ${WORKSPACE}/gcp_destroy.log
     exit 1
 fi
 
@@ -65,6 +66,7 @@ STATUS=$?
 
 if [ $STATUS -ne 0 ]; then
     echo "Error applying workloads to GCP"
+    $HOME/.kni/${SITE_NAME}/requirements/openshift-install destroy cluster --dir=/$HOME/.kni/${SITE_NAME}/final_manifests 2>&1 | tee ${WORKSPACE}/gcp_destroy.log
     exit 1
 fi