Merge "Add dataplane deploy setting"
[apex.git] / ci / deploy.sh
index a40b92a..d31993f 100755 (executable)
@@ -55,9 +55,17 @@ ext_net_type="interface"
 ip_address_family=4
 
 # Libraries
-source $LIB/common-functions.sh
-source $LIB/utility-functions.sh
-source $LIB/installer/onos/onos_gw_mac_update.sh
+lib_files=(
+$LIB/common-functions.sh
+$LIB/utility-functions.sh
+$LIB/installer/onos/onos_gw_mac_update.sh
+)
+for lib_file in ${lib_files[@]}; do
+  if ! source $lib_file; then
+    echo -e "${red}ERROR: Failed to source $lib_file${reset}"
+    exit 1
+  fi
+done
 
 ##FUNCTIONS
 ##translates yaml into variables
@@ -502,7 +510,7 @@ function setup_virtual_baremetal {
 EOF
 
   # next create the virtual machines and add their definitions to the file
-  if [ ha_enabled == "False" ]; then
+  if [ "$ha_enabled" == "False" ]; then
       # 1 controller + computes
       # zero based so just pass compute count
       vm_index=$VM_COMPUTES
@@ -745,7 +753,7 @@ sleep 15
 ##params: none
 function undercloud_prep_overcloud_deploy {
   if [[ "${#deploy_options_array[@]}" -eq 0 || "${deploy_options_array['sdn_controller']}" == 'opendaylight' ]]; then
-    if [ "${deploy_options_array['sdn_l3']}" == 'true' ]; then
+    if [ "${deploy_options_array['sdn_l3']}" == 'True' ]; then
       DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/opendaylight_l3.yaml"
     elif [ "${deploy_options_array['sfc']}" == 'True' ]; then
       DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/opendaylight_sfc.yaml"
@@ -781,6 +789,12 @@ function undercloud_prep_overcloud_deploy {
     exit 1
   fi
 
+  # Handle different dataplanes
+  if [ "${deploy_options_array['dataplane']}" != 'ovs']; then
+    echo "${red}ovs is the only currently available dataplane. ${deploy_options_array['dataplane']} not implemented${reset}"
+    exit 1
+  fi
+
   # Make sure the correct overcloud image is available
   if [ ! -f $RESOURCES/overcloud-full-${SDN_IMAGE}.qcow2 ]; then
       echo "${red} $RESOURCES/overcloud-full-${SDN_IMAGE}.qcow2 is required to execute your deployment."
@@ -856,7 +870,7 @@ set -o errexit
 echo "Uploading overcloud glance images"
 openstack overcloud image upload
 
-bash -x set_perf_images.sh ${performance_roles}
+bash -x set_perf_images.sh ${performance_roles[@]}
 
 echo "Configuring undercloud and discovering nodes"
 openstack baremetal import --json instackenv.json