Merge "Auto Generated INFO.yaml file"
[joid.git] / ci / clean.sh
1 #!/bin/bash
2
3 set -ex
4
5 if [ ! -d labconfig.yaml ]; then
6     cp ~/joid_config/labconfig.yaml ./labconfig.yaml || true
7     if [ -d $HOME/joid_config/deployconfig.yaml ]; then
8         cp ~/joid_config/deployconfig.yaml ./deployconfig.yaml || true
9     else
10         python genDeploymentConfig.py -l labconfig.yaml > deployconfig.yaml
11     fi
12 fi
13
14 controllername=`awk 'NR==1{print substr($1, 1, length($1)-1)}' deployconfig.yaml`
15 cloudname=`awk 'NR==1{print substr($1, 1, length($1)-1)}' deployconfig.yaml`
16 juju destroy-controller $controllername --destroy-all-models -y || true
17 #juju kill-controller $controllername --timeout 10s -y || true
18 rm -rf precise
19 rm -rf trusty
20 rm -rf xenial
21 rm -rf bionic
22 rm -rf ~/joid_config/admin-openrc
23 sleep 10
24 sudo sysctl -w vm.drop_caches=3