summaryrefslogtreecommitdiffstats
path: root/ci/clean.sh
blob: c6658b4ebc039b01c475fd253ce62f991f1e492a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/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 ..."
        juju destroy-environment demo-maas  -y
        rm -rf $HOME/.juju/j*
        rm -rf $HOME/.juju/.deployer-store-cache
    fi
    rm -rf $HOME/.juju/environments
    rm -rf $HOME/.juju/ssh
fi