summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkos Chandras <mchandras@suse.de>2018-03-19 16:22:47 +0000
committerMarkos Chandras <mchandras@suse.de>2018-03-20 17:29:21 +0000
commite47cdad33ce29f7db4e0cb72c323ed63504afe16 (patch)
tree8f1481015ebe6a5777c0dd936f7b8db11b8df16c
parent346df57c53fde3795fbe675477cdb2c1a453b6f7 (diff)
xci: Move cleanup script outside of bifrost
The cleanup script has grown quite a bit over time and it now does more things than cleaning up old 'bifrost' artifacts to move it to the global files directory so it can be used by all installers. Change-Id: Ibf70ff255f14e798216cedc71fb7c5f5476b964a Signed-off-by: Markos Chandras <mchandras@suse.de>
-rwxr-xr-xxci/files/xci-destroy-env.sh (renamed from xci/infra/bifrost/scripts/destroy-env.sh)0
-rw-r--r--xci/infra/bifrost/infra-provision.sh4
-rwxr-xr-xxci/xci-deploy.sh11
3 files changed, 11 insertions, 4 deletions
diff --git a/xci/infra/bifrost/scripts/destroy-env.sh b/xci/files/xci-destroy-env.sh
index 9d53dc15..9d53dc15 100755
--- a/xci/infra/bifrost/scripts/destroy-env.sh
+++ b/xci/files/xci-destroy-env.sh
diff --git a/xci/infra/bifrost/infra-provision.sh b/xci/infra/bifrost/infra-provision.sh
index f847e66d..9c3adfc2 100644
--- a/xci/infra/bifrost/infra-provision.sh
+++ b/xci/infra/bifrost/infra-provision.sh
@@ -12,10 +12,6 @@ BIFROST_ROOT_DIR="$(dirname $(realpath ${BASH_SOURCE[0]}))"
echo "Info: Starting provisining VM nodes using openstack/bifrost"
echo "-------------------------------------------------------------------------"
-# We are using sudo so we need to make sure that env_reset is not present
-sudo sed -i "s/^Defaults.*env_reset/#&/" /etc/sudoers
-cd $BIFROST_ROOT_DIR
-sudo -E bash ./scripts/destroy-env.sh
cd $BIFROST_ROOT_DIR/playbooks/
ansible-playbook ${XCI_ANSIBLE_PARAMS} -i "localhost," bootstrap-bifrost.yml
cd ${XCI_CACHE}/repos/bifrost
diff --git a/xci/xci-deploy.sh b/xci/xci-deploy.sh
index fb678ec5..80b10106 100755
--- a/xci/xci-deploy.sh
+++ b/xci/xci-deploy.sh
@@ -85,6 +85,9 @@ unset user_local_dev_vars local_user_var
# register our handler
trap submit_bug_report ERR
+# We are using sudo so we need to make sure that env_reset is not present
+sudo sed -i "s/^Defaults.*env_reset/#&/" /etc/sudoers
+
#-------------------------------------------------------------------------------
# Log info to console
#-------------------------------------------------------------------------------
@@ -103,6 +106,14 @@ echo "openstack/bifrost version: $OPENSTACK_BIFROST_VERSION"
echo "-------------------------------------------------------------------------"
#-------------------------------------------------------------------------------
+# Clean up environment
+#-------------------------------------------------------------------------------
+echo "Info: Cleaning up previous XCI artifacts"
+echo "-------------------------------------------------------------------------"
+sudo -E bash files/xci-destroy-env.sh
+echo "-------------------------------------------------------------------------"
+
+#-------------------------------------------------------------------------------
# Install ansible on localhost
#-------------------------------------------------------------------------------
echo "Info: Installing Ansible from pip"