From 68738a4b6af93528b16d61cc547f24254190dac4 Mon Sep 17 00:00:00 2001
From: handreas <andreas.hamacher@monash.edu>
Date: Sun, 2 Feb 2020 05:28:58 +0000
Subject: [PATCH] making stackname prefixing more robust

Former-commit-id: e0f522bff556b7c6ffe237b67d7205ec890baf1c
---
 CICD/heat/heatcicdwrapper.sh | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/CICD/heat/heatcicdwrapper.sh b/CICD/heat/heatcicdwrapper.sh
index 97ad8fc6..9f9d9bb1 100644
--- a/CICD/heat/heatcicdwrapper.sh
+++ b/CICD/heat/heatcicdwrapper.sh
@@ -14,7 +14,15 @@ if [ "$#" -ne 2 ]; then
 fi
 
 STACKNAME=$2
-STACKNAME="CICD"$STACKNAME
+
+
+if [[ "$STACKNAME" == *"$CICD"* ]]; then
+  echo "CICD found in stackname. doing nothing"
+else
+  STACKNAME="CICD"$STACKNAME
+fi
+
+
 
 echo "[heatcicdwrapper] Prefixing Stackname with CICD. This is a safety feature because this script can also delete stacks"
 
-- 
GitLab