From: Yolanda Robla Date: Tue, 31 Mar 2020 07:58:17 +0000 (+0200) Subject: Allow skipping destroy cluster X-Git-Tag: akraino_r3~6 X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F11%2F3311%2F2;p=kni%2Finstaller.git Allow skipping destroy cluster Destroy the cluster only if PRESERVE_CLUSTER is not set Signed-off-by: Yolanda Robla Change-Id: I22f87c83c0d04c8e82d15fa57ca62e24be752260 --- diff --git a/ci/kni_deploy_aws.sh b/ci/kni_deploy_aws.sh index 07a7d70..3f5ea9c 100755 --- a/ci/kni_deploy_aws.sh +++ b/ci/kni_deploy_aws.sh @@ -67,9 +67,11 @@ if [ $STATUS -ne 0 ]; then exit 1 fi -echo "Workloads successfully applied! Starting cleanup" -$HOME/.kni/${SITE_NAME}/requirements/openshift-install destroy cluster --dir=/$HOME/.kni/${SITE_NAME}/final_manifests 2>&1 | tee ${WORKSPACE}/aws_destroy.log -STATUS=$? +if [ -z "${PRESERVE_CLUSTER}" ]; then + echo "Workloads successfully applied! Starting cleanup" + $HOME/.kni/${SITE_NAME}/requirements/openshift-install destroy cluster --dir=/$HOME/.kni/${SITE_NAME}/final_manifests 2>&1 | tee ${WORKSPACE}/aws_destroy.log + STATUS=$? +fi popd diff --git a/ci/kni_deploy_baremetal.sh b/ci/kni_deploy_baremetal.sh index ad7544e..8983d40 100755 --- a/ci/kni_deploy_baremetal.sh +++ b/ci/kni_deploy_baremetal.sh @@ -74,7 +74,9 @@ if [ $STATUS -ne 0 ]; then exit 1 fi -# now destroy the cluster -pushd $HOME/go/src/gerrit.akraino.org/kni/installer -./knictl destroy_cluster $SITE_NAME -popd +if [ -z "${PRESERVE_CLUSTER}" ]; then + # now destroy the cluster + pushd $HOME/go/src/gerrit.akraino.org/kni/installer + ./knictl destroy_cluster $SITE_NAME + popd +fi diff --git a/ci/kni_deploy_gcp.sh b/ci/kni_deploy_gcp.sh index ac93c31..213e810 100755 --- a/ci/kni_deploy_gcp.sh +++ b/ci/kni_deploy_gcp.sh @@ -67,9 +67,11 @@ if [ $STATUS -ne 0 ]; then exit 1 fi -echo "Workloads successfully applied! Starting cleanup" -$HOME/.kni/${SITE_NAME}/requirements/openshift-install destroy cluster --dir=/$HOME/.kni/${SITE_NAME}/final_manifests 2>&1 | tee ${WORKSPACE}/gcp_destroy.log -STATUS=$? +if [ -z "${PRESERVE_CLUSTER}" ]; then + echo "Workloads successfully applied! Starting cleanup" + $HOME/.kni/${SITE_NAME}/requirements/openshift-install destroy cluster --dir=/$HOME/.kni/${SITE_NAME}/final_manifests 2>&1 | tee ${WORKSPACE}/gcp_destroy.log + STATUS=$? +fi popd