Apex: More CSIT promotion fixes
[releng.git] / jjb / apex / apex-deploy.sh
index 64877b0..dfaf2a8 100755 (executable)
@@ -22,7 +22,6 @@ if [[ "$ARTIFACT_VERSION" =~ dev ]]; then
   # Settings for deploying from git workspace
   DEPLOY_SETTINGS_DIR="${WORKSPACE}/config/deploy"
   NETWORK_SETTINGS_DIR="${WORKSPACE}/config/network"
-  DEPLOY_CMD="opnfv-deploy --image-dir ${WORKSPACE}/.build"
   CLEAN_CMD="opnfv-clean"
   # if we are using master, then we are downloading/caching upstream images
   # we want to use that built in mechanism to avoid re-downloading every job
@@ -38,7 +37,7 @@ if [[ "$ARTIFACT_VERSION" =~ dev ]]; then
   BASE=$CONFIG
   IMAGES=$RESOURCES
   LIB="${WORKSPACE}/lib"
-
+  DEPLOY_CMD="opnfv-deploy --image-dir ${RESOURCES}"
   # Ensure artifacts were downloaded and extracted correctly
   # TODO(trozet) add verification here
 
@@ -50,7 +49,6 @@ if [[ "$ARTIFACT_VERSION" =~ dev ]]; then
 else
   DEPLOY_SETTINGS_DIR="/etc/opnfv-apex/"
   NETWORK_SETTINGS_DIR="/etc/opnfv-apex/"
-  DEPLOY_CMD="opnfv-deploy"
   CLEAN_CMD="opnfv-clean"
   # set to use different directory here because upon RPM removal this
   # directory will be wiped in daily
@@ -61,6 +59,7 @@ else
   else
     RESOURCES="/var/opt/opnfv/images"
   fi
+  DEPLOY_CMD="opnfv-deploy --image-dir ${RESOURCES}"
   CONFIG="/var/opt/opnfv"
   BASE=$CONFIG
   IMAGES=$RESOURCES
@@ -119,11 +118,8 @@ if [[ "$JOB_NAME" =~ "virtual" ]]; then
   if [[ "${DEPLOY_SCENARIO}" =~ fdio|ovs ]]; then
     DEPLOY_CMD="${DEPLOY_CMD} --virtual-default-ram 12 --virtual-compute-ram 7"
   fi
-  if [[ "$JOB_NAME" == *csit* ]]; then
-    DEPLOY_CMD="${DEPLOY_CMD} -e csit-environment.yaml"
-  fi
   if [[ "$PROMOTE" == "True" ]]; then
-    DEPLOY_CMD="${DEPLOY_CMD} --virtual-computes 1"
+    DEPLOY_CMD="${DEPLOY_CMD} --virtual-computes 2 -e csit-environment.yaml"
   fi
 else
   # settings for bare metal deployment
@@ -145,6 +141,8 @@ fi
 
 if [ "$IPV6_FLAG" == "True" ]; then
   NETWORK_FILE="${NETWORK_SETTINGS_DIR}/network_settings_v6.yaml"
+elif [[ "$PROMOTE" == "True" ]]; then
+  NETWORK_FILE="${NETWORK_SETTINGS_DIR}/network_settings_csit.yaml"
 else
   NETWORK_FILE="${NETWORK_SETTINGS_DIR}/network_settings.yaml"
 fi
@@ -158,7 +156,7 @@ fi
 # start deployment
 sudo ${DEPLOY_CMD} -d ${DEPLOY_FILE} -n ${NETWORK_FILE} --debug
 
-if [[ "$JOB_NAME" == *csit* ]]; then
+if [[ "$PROMOTE" == 'True' ]]; then
   echo "CSIT job: setting host route for floating ip routing"
   # csit route to allow docker container to reach floating ips
   UNDERCLOUD=$(sudo virsh domifaddr undercloud | grep -Eo "[0-9\.]+{3}[0-9]+")