summaryrefslogtreecommitdiffstats
path: root/xci/xci-deploy.sh
diff options
context:
space:
mode:
authorFatih Degirmenci <fatih.degirmenci@ericsson.com>2017-03-27 10:29:01 +0200
committerTrevor Bramwell <tbramwell@linuxfoundation.org>2017-08-11 12:56:12 -0700
commit0197b9516e66969483c96981c7b518486a4797d3 (patch)
tree9a6074de573d49e81e4d545a9b29c6970cb93a1c /xci/xci-deploy.sh
parente2ab9c9799ac2dca86fa85673b5fcb58b9e01840 (diff)
xci: Enable node provisioning and shuffle/rename stuff
This change enables node provisioning using bifrost based on the chosen flavor. Other changes include - move flavor specific stuff (playbooks, inventory, vars) into their own folders so it is easier to copy them over. - rename flavors and get rid of xci from them. - introduce env-vars to keep variables that are not really user variables. Please note that this patch contains empty files and so on due to still trying to find best way to structurei things. Apart from this, there will probably be lots of duplications here and there which will be taken care of once things settle. Change-Id: I04a5d422e5b018439bafea5e68e65255ae38d22b Signed-off-by: Fatih Degirmenci <fatih.degirmenci@ericsson.com>
Diffstat (limited to 'xci/xci-deploy.sh')
-rwxr-xr-xxci/xci-deploy.sh61
1 files changed, 60 insertions, 1 deletions
diff --git a/xci/xci-deploy.sh b/xci/xci-deploy.sh
index 34149f22..401c098c 100755
--- a/xci/xci-deploy.sh
+++ b/xci/xci-deploy.sh
@@ -4,6 +4,12 @@ set -o nounset
set -o pipefail
set -o xtrace
+# This script must run as root
+if [[ $(whoami) != "root" ]]; then
+ echo "Error: This script must be run as root!"
+ exit 1
+fi
+
# find where are we
XCI_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
@@ -14,4 +20,57 @@ source $XCI_PATH/config/pinned-versions
source $XCI_PATH/config/user-vars
# source flavor configuration
-source $XCI_PATH/flavors/$XCI_FLAVOR.sh
+source $XCI_PATH/flavors/$XCI_FLAVOR
+
+# source xci configuration
+source $XCI_PATH/config/env-vars
+
+# log info to console
+echo "Info: Starting XCI Deployment"
+echo "Info: Deployment parameters"
+echo "-------------------------------------------------------------------------"
+echo "xci flavor: $XCI_FLAVOR"
+echo "opnfv/releng version: $OPNFV_RELENG_VERSION"
+echo "openstack/bifrost version: $OPENSTACK_BIFROST_VERSION"
+echo "openstack/openstack-ansible version: $OPENSTACK_OSA_VERSION"
+echo "-------------------------------------------------------------------------"
+
+#-------------------------------------------------------------------------------
+# Cleanup the leftovers from the previous deployment
+#-------------------------------------------------------------------------------
+echo "Info: Cleaning up the previous deployment"
+$XCI_PATH/../bifrost/scripts/destroy-env.sh > /dev/null 2>&1
+/bin/rm -rf /opt/releng /opt/bifrost /opt/openstack-ansible /opt/stack
+
+#-------------------------------------------------------------------------------
+# Clone the repositories and checkout the versions
+#-------------------------------------------------------------------------------
+echo "Info: Cloning repositories and checking out versions"
+git clone --quiet $OPNFV_RELENG_GIT_URL $OPNFV_RELENG_PATH && \
+ cd $OPNFV_RELENG_PATH
+echo "Info: Cloned opnfv/releng. HEAD currently points at"
+echo " $(git show --oneline -s --pretty=format:'%h - %s (%cr) <%an>')"
+git clone --quiet $OPENSTACK_BIFROST_GIT_URL $OPENSTACK_BIFROST_PATH && \
+ cd $OPENSTACK_BIFROST_PATH
+echo "Info: Cloned openstack/bifrost. HEAD currently points at"
+echo " $(git show --oneline -s --pretty=format:'%h - %s (%cr) <%an>')"
+
+#-------------------------------------------------------------------------------
+# Combine opnfv and upstream scripts/playbooks
+#-------------------------------------------------------------------------------
+echo "Info: Combining opnfv/releng and opestack/bifrost scripts/playbooks"
+/bin/cp -rf $OPNFV_RELENG_PATH/prototypes/bifrost/* $OPENSTACK_BIFROST_PATH/
+
+#-------------------------------------------------------------------------------
+# Start provisioning VM nodes
+#-------------------------------------------------------------------------------
+echo "Info: Starting provisining VM nodes using openstack/bifrost"
+echo " This might take between 10 to 20 minutes depending on the flavor and the host"
+echo "-------------------------------------------------------------------------"
+cd $OPENSTACK_BIFROST_PATH
+STARTTIME=$(date +%s)
+./scripts/bifrost-provision.sh
+ENDTIME=$(date +%s)
+echo "-----------------------------------------------------------------------"
+echo "Info: VM nodes are provisioned!"
+echo "Info: It took $(($ENDTIME - $STARTTIME)) seconds to provising the VM nodes"