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

set -ex

if [ -d "~/.juju/environemnts" ]; then
    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 ~/.juju/j*
        rm -rf ~/.juju/.deployer-store-cache
    fi
    rm -rf ~/.juju/environments
    rm -rf ~/.juju/ssh
fi