From: Fatih Degirmenci Date: Fri, 29 Nov 2019 06:22:10 +0000 (+0100) Subject: cloud-infra: Fix stack deletion script X-Git-Url: https://gerrit.nordix.org/gitweb?a=commitdiff_plain;ds=sidebyside;h=0993f34c61b521b668ebb011cc17f6a50799a2b9;hp=-c;p=infra%2Fcicd.git cloud-infra: Fix stack deletion script Change-Id: I2100a363a329b7da4100f16a3b949b7f71d45fd4 --- 0993f34c61b521b668ebb011cc17f6a50799a2b9 diff --git a/jjb/cloud-infra/delete-heat-stack.sh b/jjb/cloud-infra/delete-heat-stack.sh index 41d522aa..63c3beae 100644 --- a/jjb/cloud-infra/delete-heat-stack.sh +++ b/jjb/cloud-infra/delete-heat-stack.sh @@ -29,17 +29,18 @@ if [[ $DEPLOY_TYPE != "cloud" ]]; then exit 0 fi -# we only support k8s scenario deployment on openstack as of now -if [[ "$DEPLOY_SCENARIO" != "k8-*" ]] && [[ "$PROVISIONER_TYPE" == "heat" ]]; then +# do not delete the stack if not explicitly set to delete +if [[ "$DELETE_STACK" != "yes" ]]; then echo "-------------------------------------------------------------------------" - echo "Info: Only k8s scenario deployment on OpenStack has been implemented!" + echo "Info: Stack will not be deleted upon the completion of the job!" echo "-------------------------------------------------------------------------" exit 0 fi -if [[ "$DELETE_STACK" != "yes" ]]; then +# k8s and onap scenario have stacks so exit for others +if [[ ! "$DEPLOY_SCENARIO" =~ ^k8-.*|^onap-.* ]]; then echo "-------------------------------------------------------------------------" - echo "Info: Stack will not be deleted upon the completion of the job!" + echo "Info: Nothing to delete!" echo "-------------------------------------------------------------------------" exit 0 fi