7 # This script must run as root
8 if [[ $(whoami) != "root" ]]; then
9 echo "Error: This script must be run as root!"
14 XCI_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
17 source $XCI_PATH/config/user-vars
19 # source pinned versions
20 source $XCI_PATH/config/pinned-versions
22 # source flavor configuration
23 source "$XCI_PATH/flavors/${XCI_FLAVOR}-vars"
25 # source xci configuration
26 source $XCI_PATH/config/env-vars
29 echo "Info: Starting XCI Deployment"
30 echo "Info: Deployment parameters"
31 echo "-------------------------------------------------------------------------"
32 echo "xci flavor: $XCI_FLAVOR"
33 echo "opnfv/releng version: $OPNFV_RELENG_VERSION"
34 echo "openstack/bifrost version: $OPENSTACK_BIFROST_VERSION"
35 echo "openstack/openstack-ansible version: $OPENSTACK_OSA_VERSION"
36 echo "-------------------------------------------------------------------------"
38 #-------------------------------------------------------------------------------
39 # Cleanup the leftovers from the previous deployment
40 #-------------------------------------------------------------------------------
41 echo "Info: Cleaning up the previous deployment"
42 $XCI_PATH/../bifrost/scripts/destroy-env.sh > /dev/null 2>&1
43 /bin/rm -rf /opt/releng /opt/bifrost /opt/openstack-ansible
45 #-------------------------------------------------------------------------------
46 # Clone the repositories and checkout the versions
47 #-------------------------------------------------------------------------------
48 echo "Info: Cloning repositories and checking out versions"
49 git clone --quiet $OPNFV_RELENG_GIT_URL $OPNFV_RELENG_PATH && \
51 echo "Info: Cloned opnfv/releng. HEAD currently points at"
52 echo " $(git show --oneline -s --pretty=format:'%h - %s (%cr) <%an>')"
53 git clone --quiet $OPENSTACK_BIFROST_GIT_URL $OPENSTACK_BIFROST_PATH && \
54 cd $OPENSTACK_BIFROST_PATH
55 echo "Info: Cloned openstack/bifrost. HEAD currently points at"
56 echo " $(git show --oneline -s --pretty=format:'%h - %s (%cr) <%an>')"
58 #-------------------------------------------------------------------------------
59 # Combine opnfv and upstream scripts/playbooks
60 #-------------------------------------------------------------------------------
61 echo "Info: Combining opnfv/releng and opestack/bifrost scripts/playbooks"
62 /bin/cp -rf $OPNFV_RELENG_PATH/prototypes/bifrost/* $OPENSTACK_BIFROST_PATH/
64 #-------------------------------------------------------------------------------
65 # Start provisioning VM nodes
66 #-------------------------------------------------------------------------------
67 echo "Info: Starting provisining VM nodes using openstack/bifrost"
68 echo " This might take between 10 to 20 minutes depending on the flavor and the host"
69 echo "-------------------------------------------------------------------------"
70 cd $OPENSTACK_BIFROST_PATH
72 ./scripts/bifrost-provision.sh
74 echo "-----------------------------------------------------------------------"
75 echo "Info: VM nodes are provisioned!"
76 echo "Info: It took $(($ENDTIME - $STARTTIME)) seconds to provising the VM nodes"