summaryrefslogtreecommitdiffstats
path: root/ci/clean.sh
blob: db62a11a4189eb73b07d4dd916101dc758ea01d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

set -ex

if [ -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 ..."
    else
        echo " environment is bootstrapped ..."
        jujuenv=`juju status | grep environment | cut -d ":" -f 2`
        juju destroy-environment $jujuenv  -y
    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
fi