summaryrefslogtreecommitdiffstats
path: root/ci/clean.sh
diff options
context:
space:
mode:
authorNarinder Gupta <narinder.gupta@canonical.com>2015-12-11 06:54:27 -0600
committerNarinder Gupta <narinder.gupta@canonical.com>2015-12-11 06:54:27 -0600
commit69ac76cdc58086641ed601b35689a9ea2f2aef94 (patch)
tree883409c37ebc650dac5a3b90cbb6911246d4c8a5 /ci/clean.sh
parent85e65d41f1cdc9c9291fb5b2de29c02f0e57b405 (diff)
fix syntax error and clean the clean.sh
Change-Id: Ibb8ff7109aeda126ccb8be522b7e6d2334d54708
Diffstat (limited to 'ci/clean.sh')
-rwxr-xr-xci/clean.sh19
1 files changed, 13 insertions, 6 deletions
diff --git a/ci/clean.sh b/ci/clean.sh
index 3e990eae..82fd84e0 100755
--- a/ci/clean.sh
+++ b/ci/clean.sh
@@ -2,10 +2,17 @@
set -ex
-#juju-deployer -T -d
-juju destroy-environment demo-maas -y
-rm -rf ~/.juju/j*
-rm -rf ~/.juju/environments
-rm -rf ~/.juju/ssh
-rm -rf ~/.juju/.deployer-store-cache
+if [ -d "~/.juju/environemnts" ]; then
+ juju status &>status.txt || true
+ if [ "$(grep -c "environment is not bootstrapped" status.txt )" -ge 1 ]; then
+ echo " environment is not bootstrapped ..."
+ else
+ echo " environment is bootstrapped ..."
+ juju destroy-environment demo-maas -y
+ rm -rf ~/.juju/j*
+ rm -rf ~/.juju/.deployer-store-cache
+ fi
+ rm -rf ~/.juju/environments
+ rm -rf ~/.juju/ssh
+fi