summaryrefslogtreecommitdiffstats
path: root/ci/clean.sh
diff options
context:
space:
mode:
authorGuo Ruijing <ruijing.guo@intel.com>2017-10-18 19:56:15 -0400
committerGuo Ruijing <ruijing.guo@intel.com>2017-10-18 20:02:51 -0400
commit2819ba063c1a9896ccf437f85ca4c2ee463d7e80 (patch)
tree3aa67c5165ed3dc73bcd85cdb836731f4e212f97 /ci/clean.sh
parent470472f807b118b235d7ff473a3e58bfaf8c293d (diff)
cleanup code
1. remove unused code due to juju>2 & maas>2.2 in Ubuntu16.04 2. remove deprecated 03-maasdeploy.sh 3. remove other unused code Change-Id: I20fd0e96400db1262b0df3ef2b502c8001dd5b76 Signed-off-by: Guo Ruijing <ruijing.guo@intel.com>
Diffstat (limited to 'ci/clean.sh')
-rwxr-xr-xci/clean.sh62
1 files changed, 16 insertions, 46 deletions
diff --git a/ci/clean.sh b/ci/clean.sh
index 5005b594..1f3ef54f 100755
--- a/ci/clean.sh
+++ b/ci/clean.sh
@@ -2,52 +2,22 @@
set -ex
-jujuver=`juju --version`
-
-if [[ "$jujuver" > "2" ]]; then
- if [ ! -d labconfig.yaml ]; then
- cp ~/joid_config/labconfig.yaml ./labconfig.yaml || true
- if [ -d $HOME/joid_config/deployconfig.yaml ]; then
- cp ~/joid_config/deployconfig.yaml ./deployconfig.yaml || true
- else
- python genDeploymentConfig.py -l labconfig.yaml > deployconfig.yaml
- fi
- fi
-else
- if [ ! -d environments.yaml ]; then
- cp ~/joid_config/environments.yaml ./environments.yaml || true
- cp ~/.juju/environments.yaml ./environments.yaml || true
- fi
-fi
-
-
-if [[ "$jujuver" > "2" ]]; then
- controllername=`awk 'NR==1{print substr($1, 1, length($1)-1)}' deployconfig.yaml`
- cloudname=`awk 'NR==1{print substr($1, 1, length($1)-1)}' deployconfig.yaml`
- juju destroy-controller $controllername --destroy-all-models -y || true
-# juju kill-controller $controllername --timeout 10s -y || true
- rm -rf precise
- rm -rf trusty
- rm -rf xenial
- rm -rf ~/joid_config/admin-openrc
- sleep 10
- sudo sysctl -w vm.drop_caches=3
-elif [ -d $HOME/.juju/environments ]; then
- echo " " > status.txt
- juju status &>>status.txt || true
- if [ "$(grep -c "environment is not bootstrapped" status.txt )" -ge 1 ]; then
- echo " environment is not bootstrapped ..."
+if [ ! -d labconfig.yaml ]; then
+ cp ~/joid_config/labconfig.yaml ./labconfig.yaml || true
+ if [ -d $HOME/joid_config/deployconfig.yaml ]; then
+ cp ~/joid_config/deployconfig.yaml ./deployconfig.yaml || true
else
- echo " environment is bootstrapped ..."
- jujuenv=`juju status | grep environment | cut -d ":" -f 2`
- juju destroy-environment $jujuenv -y || true
+ python genDeploymentConfig.py -l labconfig.yaml > deployconfig.yaml
fi
- rm -rf precise
- rm -rf trusty
- rm -rf xenial
- rm -rf $HOME/.juju/j*
- rm -rf $HOME/.juju/.deployer-store-cache
- rm -rf $HOME/.juju/environments
- rm -rf $HOME/.juju/ssh
- sudo sysctl -w vm.drop_caches=3
fi
+
+controllername=`awk 'NR==1{print substr($1, 1, length($1)-1)}' deployconfig.yaml`
+cloudname=`awk 'NR==1{print substr($1, 1, length($1)-1)}' deployconfig.yaml`
+juju destroy-controller $controllername --destroy-all-models -y || true
+#juju kill-controller $controllername --timeout 10s -y || true
+rm -rf precise
+rm -rf trusty
+rm -rf xenial
+rm -rf ~/joid_config/admin-openrc
+sleep 10
+sudo sysctl -w vm.drop_caches=3