X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fapex%2Fapex-deploy.sh;h=35c2b85443c136dcffcff60fc0eea3c760fab7f3;hb=d29c3e495aee81b96f653b6a4b5ee72a9bf33976;hp=b8ae75a1f411d46ea2a684949e2dc354713d2b3c;hpb=c7c82f49e1af644542b2a5fbde8f870eee9c9ff5;p=releng.git diff --git a/jjb/apex/apex-deploy.sh b/jjb/apex/apex-deploy.sh index b8ae75a1f..35c2b8544 100755 --- a/jjb/apex/apex-deploy.sh +++ b/jjb/apex/apex-deploy.sh @@ -13,21 +13,8 @@ echo if [ -z "$DEPLOY_SCENARIO" ]; then echo "Deploy scenario not set!" exit 1 -elif [[ "$DEPLOY_SCENARIO" == *gate* ]]; then - echo "Detecting Gating scenario..." - if [ -z "$GERRIT_EVENT_COMMENT_TEXT" ]; then - echo "ERROR: Gate job triggered without comment!" - exit 1 - else - DEPLOY_SCENARIO=$(echo ${GERRIT_EVENT_COMMENT_TEXT} | grep start-gate-scenario | grep -Eo 'os-.*$') - if [ -z "$DEPLOY_SCENARIO" ]; then - echo "ERROR: Unable to detect scenario in Gerrit Comment!" - echo "Format of comment to trigger gate should be 'start-gate-scenario: '" - exit 1 - else - echo "Gate scenario detected: ${DEPLOY_SCENARIO}" - fi - fi +else + echo "Deploy scenario: ${DEPLOY_SCENARIO}" fi # Dev or RPM/ISO build @@ -35,14 +22,22 @@ 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" - RESOURCES="${WORKSPACE}/.build/" + # 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 + # so we use a dedicated folder to hold the upstream cache + UPSTREAM_CACHE=$HOME/upstream_cache + if [ "$BRANCH" == 'master' ]; then + mkdir -p ${UPSTREAM_CACHE} + RESOURCES=$UPSTREAM_CACHE + else + RESOURCES="${WORKSPACE}/.build/" + fi CONFIG="${WORKSPACE}/build" 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 @@ -54,9 +49,17 @@ 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" - RESOURCES="/var/opt/opnfv/images" + # set to use different directory here because upon RPM removal this + # directory will be wiped in daily + UPSTREAM_CACHE=$HOME/upstream_cache + if [ "$BRANCH" == 'master' ]; then + mkdir -p ${UPSTREAM_CACHE} + RESOURCES=$UPSTREAM_CACHE + else + RESOURCES="/var/opt/opnfv/images" + fi + DEPLOY_CMD="opnfv-deploy --image-dir ${RESOURCES}" CONFIG="/var/opt/opnfv" BASE=$CONFIG IMAGES=$RESOURCES @@ -119,7 +122,7 @@ if [[ "$JOB_NAME" =~ "virtual" ]]; then DEPLOY_CMD="${DEPLOY_CMD} -e csit-environment.yaml" fi if [[ "$PROMOTE" == "True" ]]; then - DEPLOY_CMD="${DEPLOY_CMD} --virtual-computes 2" + DEPLOY_CMD="${DEPLOY_CMD} --virtual-computes 1" fi else # settings for bare metal deployment @@ -134,10 +137,13 @@ else DEPLOY_CMD="${DEPLOY_CMD} -i ${INVENTORY_FILE}" fi +if [[ "$BRANCH" == "master" ]]; 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 - NETWORK_FILE="${NETWORK_SETTINGS_DIR}/network_settings_vpp.yaml" else NETWORK_FILE="${NETWORK_SETTINGS_DIR}/network_settings.yaml" fi