Apex: add support for deploying upstream only
[releng.git] / jjb / apex / apex-deploy.sh
index a47e3a5..123db3e 100755 (executable)
@@ -10,8 +10,6 @@ echo "Starting the Apex deployment."
 echo "--------------------------------------------------------"
 echo
 
-sudo rm -rf /tmp/tmp*
-
 if [ -z "$DEPLOY_SCENARIO" ]; then
   echo "Deploy scenario not set!"
   exit 1
@@ -33,12 +31,14 @@ elif [[ "$DEPLOY_SCENARIO" == *gate* ]]; then
 fi
 
 # Dev or RPM/ISO build
-if [[ "$ARTIFACT_VERSION" =~ dev ]]; then
+# For upstream deployments we currently only use git repo and not RPM
+# Need to decide after Fraser if we want to use RPM or not for upstream
+if [[ "$ARTIFACT_VERSION" =~ dev || "$DEPLOY_SCENARIO" =~ "upstream" ]]; 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="${WORKSPACE}/ci/clean.sh"
+  CLEAN_CMD="opnfv-clean"
   RESOURCES="${WORKSPACE}/.build/"
   CONFIG="${WORKSPACE}/build"
   BASE=$CONFIG
@@ -49,10 +49,10 @@ if [[ "$ARTIFACT_VERSION" =~ dev ]]; then
   # TODO(trozet) add verification here
 
   # Install dev build
-  mkdir -p ~/tmp
-  mv -f .build ~/tmp/
+  sudo rm -rf /tmp/.build
+  mv -f .build /tmp/
   sudo pip3 install --upgrade --force-reinstall .
-  mv -f ~/tmp/.build .
+  mv -f /tmp/.build ${WORKSPACE}/
 else
   DEPLOY_SETTINGS_DIR="/etc/opnfv-apex/"
   NETWORK_SETTINGS_DIR="/etc/opnfv-apex/"
@@ -136,6 +136,11 @@ else
   DEPLOY_CMD="${DEPLOY_CMD} -i ${INVENTORY_FILE}"
 fi
 
+if [[ "$DEPLOY_SCENARIO" =~ "upstream" ]]; then
+  echo "Upstream deployment detected"
+  DEPLOY_CMD="${DEPLOY_CMD} --upstream"
+fi
+
 if [ "$IPV6_FLAG" == "True" ]; then
   NETWORK_FILE="${NETWORK_SETTINGS_DIR}/network_settings_v6.yaml"
 elif echo ${DEPLOY_SCENARIO} | grep fdio; then