Delete all existing stacks on deploy
Change-Id: If325394527354d7e86c6fef67a91fcd1da08bd6c
Issue-ID: INT-278
Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
diff --git a/test/ete/scripts/deploy-onap.sh b/test/ete/scripts/deploy-onap.sh
index 353c7c7..69c6dfb 100755
--- a/test/ete/scripts/deploy-onap.sh
+++ b/test/ete/scripts/deploy-onap.sh
@@ -46,8 +46,14 @@
fi
+# Delete all existing stacks
+STACKS=$(openstack stack list -c "Stack Name" -f value)
+for stack in "${STACKS[@]}"; do
+ echo "Deleting Old Stack ${stack}"
+ openstack stack delete -y $stack
+done
STACK="ete-$(uuidgen | cut -c-8)"
-echo "Stack Name: ${STACK}"
+echo "New Stack Name: ${STACK}"
openstack stack create -t ${ONAP_WORKDIR}/demo/heat/ONAP/onap_openstack.yaml -e ${WORKSPACE}/test/ete/labs/windriver/onap-openstack.env $STACK