~narindergupta/opnfv/stable-R2

« back to all changes in this revision

Viewing changes to ci/clean.sh

  • Committer: Guo Ruijing
  • Date: 2017-10-19 00:02:51 UTC
  • mto: This revision was merged to the branch mainline in revision 734.
  • Revision ID: git-v1:2819ba063c1a9896ccf437f85ca4c2ee463d7e80
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>

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
set -ex
4
4
 
5
 
jujuver=`juju --version`
6
 
 
7
 
if [[ "$jujuver" > "2" ]]; then
8
 
    if [ ! -d labconfig.yaml ]; then
9
 
        cp ~/joid_config/labconfig.yaml ./labconfig.yaml || true
10
 
        if [ -d $HOME/joid_config/deployconfig.yaml ]; then
11
 
            cp ~/joid_config/deployconfig.yaml ./deployconfig.yaml || true
12
 
        else
13
 
            python genDeploymentConfig.py -l labconfig.yaml > deployconfig.yaml
14
 
        fi
15
 
    fi
16
 
else
17
 
    if [ ! -d environments.yaml ]; then
18
 
        cp ~/joid_config/environments.yaml ./environments.yaml || true
19
 
        cp ~/.juju/environments.yaml ./environments.yaml || true
20
 
    fi
21
 
fi
22
 
 
23
 
 
24
 
if [[ "$jujuver" > "2" ]]; then
25
 
    controllername=`awk 'NR==1{print substr($1, 1, length($1)-1)}' deployconfig.yaml`
26
 
    cloudname=`awk 'NR==1{print substr($1, 1, length($1)-1)}' deployconfig.yaml`
27
 
    juju destroy-controller $controllername --destroy-all-models -y || true
28
 
#    juju kill-controller $controllername --timeout 10s -y || true
29
 
    rm -rf precise
30
 
    rm -rf trusty
31
 
    rm -rf xenial
32
 
    rm -rf ~/joid_config/admin-openrc
33
 
    sleep 10
34
 
    sudo sysctl -w vm.drop_caches=3
35
 
elif [ -d $HOME/.juju/environments ]; then
36
 
    echo " " > status.txt
37
 
    juju status  &>>status.txt || true
38
 
    if [ "$(grep -c "environment is not bootstrapped" status.txt )" -ge 1 ]; then
39
 
        echo " environment is not bootstrapped ..."
 
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
40
9
    else
41
 
        echo " environment is bootstrapped ..."
42
 
        jujuenv=`juju status | grep environment | cut -d ":" -f 2`
43
 
        juju destroy-environment $jujuenv  -y || true
 
10
        python genDeploymentConfig.py -l labconfig.yaml > deployconfig.yaml
44
11
    fi
45
 
    rm -rf precise
46
 
    rm -rf trusty
47
 
    rm -rf xenial
48
 
    rm -rf $HOME/.juju/j*
49
 
    rm -rf $HOME/.juju/.deployer-store-cache
50
 
    rm -rf $HOME/.juju/environments
51
 
    rm -rf $HOME/.juju/ssh
52
 
    sudo sysctl -w vm.drop_caches=3
53
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 ~/joid_config/admin-openrc
 
22
sleep 10
 
23
sudo sysctl -w vm.drop_caches=3