Merge "Updating Apex ENV Var Names"
[releng.git] / jjb / apex / apex-deploy.sh
index 2946899..a86776b 100755 (executable)
@@ -3,7 +3,7 @@ set -o errexit
 set -o nounset
 set -o pipefail
 
-APEX_PKGS="common undercloud onos"
+APEX_PKGS="common undercloud" # removed onos for danube
 IPV6_FLAG=False
 
 # log info to console
@@ -15,7 +15,7 @@ if ! rpm -q wget > /dev/null; then
   sudo yum -y install wget
 fi
 
-if [[ "$BUILD_DIRECTORY" == *verify* || "$BUILD_DIRECTORY" == *csit* ]]; then
+if [[ "$BUILD_DIRECTORY" == *verify* || "$BUILD_DIRECTORY" == *promote* ]]; then
     # Build is from a verify, use local build artifacts (not RPMs)
     cd $WORKSPACE/../${BUILD_DIRECTORY}
     WORKSPACE=$(pwd)
@@ -79,16 +79,16 @@ elif [[ "$DEPLOY_SCENARIO" == *gate* ]]; then
   fi
 fi
 
-# use local build for verify and csit promote
-if [[ "$BUILD_DIRECTORY" == *verify* || "$BUILD_DIRECTORY" == *csit* ]]; then
+# use local build for verify and promote
+if [[ "$BUILD_DIRECTORY" == *verify* || "$BUILD_DIRECTORY" == *promote* ]]; then
     if [ ! -e "${WORKSPACE}/build/lib" ]; then
       ln -s ${WORKSPACE}/lib ${WORKSPACE}/build/lib
     fi
     DEPLOY_SETTINGS_DIR="${WORKSPACE}/config/deploy"
     NETWORK_SETTINGS_DIR="${WORKSPACE}/config/network"
     DEPLOY_CMD="$(pwd)/deploy.sh"
-    RESOURCES="${WORKSPACE}/.build/"
-    CONFIG="${WORKSPACE}/build"
+    IMAGES="${WORKSPACE}/.build/"
+    BASE="${WORKSPACE}/build"
     LIB="${WORKSPACE}/lib"
     # Make sure python34 deps are installed
     for dep_pkg in epel-release python34 python34-PyYAML python34-setuptools; do
@@ -123,7 +123,7 @@ if [[ "$BUILD_DIRECTORY" == *verify* || "$BUILD_DIRECTORY" == *csit* ]]; then
 # use RPMs
 else
     # find version of RPM
-    VERSION_EXTENSION=$(echo $(basename $RPM_LIST) | grep -Eo '[0-9]+\.[0-9]+-[0-9]{8}')
+    VERSION_EXTENSION=$(echo $(basename $RPM_LIST) | grep -Eo '[0-9]+\.[0-9]+-([0-9]{8}|[a-z]+-[0-9]\.[0-9]+)')
     # build RPM List which already includes base Apex RPM
     for pkg in ${APEX_PKGS}; do
         RPM_LIST+=" ${RPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}.noarch.rpm"
@@ -145,13 +145,13 @@ else
     DEPLOY_CMD=opnfv-deploy
     DEPLOY_SETTINGS_DIR="/etc/opnfv-apex/"
     NETWORK_SETTINGS_DIR="/etc/opnfv-apex/"
-    RESOURCES="/var/opt/opnfv/images"
-    CONFIG="/var/opt/opnfv"
+    IMAGES="/var/opt/opnfv/images"
+    BASE="/var/opt/opnfv"
     LIB="/var/opt/opnfv/lib"
 fi
 
 # set env vars to deploy cmd
-DEPLOY_CMD="CONFIG=${CONFIG} RESOURCES=${RESOURCES} LIB=${LIB} ${DEPLOY_CMD}"
+DEPLOY_CMD="BASE=${BASE} IMAGES=${IMAGES} LIB=${LIB} ${DEPLOY_CMD}"
 
 if [ "$OPNFV_CLEAN" == 'yes' ]; then
   if sudo test -e '/root/inventory/pod_settings.yaml'; then
@@ -159,10 +159,10 @@ if [ "$OPNFV_CLEAN" == 'yes' ]; then
   else
     clean_opts=''
   fi
-  if [[ "$BUILD_DIRECTORY" == *verify* || "$BUILD_DIRECTORY" == *csit* ]]; then
-    sudo CONFIG=${CONFIG} LIB=${LIB} ./clean.sh ${clean_opts}
+  if [[ "$BUILD_DIRECTORY" == *verify* || "$BUILD_DIRECTORY" == *promote* ]]; then
+    sudo BASE=${BASE} LIB=${LIB} ./clean.sh ${clean_opts}
   else
-    sudo CONFIG=${CONFIG} LIB=${LIB} opnfv-clean ${clean_opts}
+    sudo BASE=${BASE} LIB=${LIB} opnfv-clean ${clean_opts}
   fi
 fi
 
@@ -196,6 +196,17 @@ else
   NETWORK_SETTINGS_DIR="/root/network"
   INVENTORY_FILE="/root/inventory/pod_settings.yaml"
 
+# (trozet) According to FDS folks uio_pci_generic works with UCS-B
+# and there appears to be a bug with vfio-pci
+  # if fdio on baremetal, then we are using UCS enic and
+  # need to use vfio-pci instead of uio generic
+#  if [[ "$DEPLOY_SCENARIO" == *fdio* ]]; then
+#    TMP_DEPLOY_FILE="${WORKSPACE}/${DEPLOY_SCENARIO}.yaml"
+#    cp -f ${DEPLOY_FILE} ${TMP_DEPLOY_FILE}
+#    sed -i 's/^\(\s*uio-driver:\).*$/\1 vfio-pci/g' ${TMP_DEPLOY_FILE}
+#    DEPLOY_FILE=${TMP_DEPLOY_FILE}
+#  fi
+
   if ! sudo test -e "$INVENTORY_FILE"; then
     echo "ERROR: Required settings file missing: Inventory settings file ${INVENTORY_FILE}"
     exit 1