X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fapex%2Fapex-deploy.sh;h=09d6ca6307ff92f419697cbbb7f0bdf0e74c5329;hb=668072f6a6f76381f7babc9950e99e935db1b6ed;hp=441bf9059d30f30ff2bc5a8574145c5fbef3349b;hpb=981cc83cef6c3d58b7df3bccce36cef9d791c11d;p=releng.git diff --git a/jjb/apex/apex-deploy.sh b/jjb/apex/apex-deploy.sh index 441bf9059..09d6ca630 100755 --- a/jjb/apex/apex-deploy.sh +++ b/jjb/apex/apex-deploy.sh @@ -6,13 +6,14 @@ set -o pipefail IPV6_FLAG=False ALLINONE_FLAG=False CSIT_ENV_FLAG=False +FUNCTEST_ENV_FLAG=False # log info to console echo "Starting the Apex deployment." echo "--------------------------------------------------------" echo -if [ -z "$DEPLOY_SCENARIO" ]; then +if [ -z ${DEPLOY_SCENARIO+x} ]; then echo "Deploy scenario not set!" exit 1 else @@ -29,7 +30,7 @@ if [[ "$ARTIFACT_VERSION" =~ dev ]]; then # 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 + if [[ "$BRANCH" != 'stable/fraser' ]]; then mkdir -p ${UPSTREAM_CACHE} RESOURCES=$UPSTREAM_CACHE else @@ -55,7 +56,7 @@ else # 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 + if [[ "$BRANCH" != 'stable/fraser' ]]; then mkdir -p ${UPSTREAM_CACHE} RESOURCES=$UPSTREAM_CACHE else @@ -119,6 +120,10 @@ if echo ${DEPLOY_SCENARIO} | grep csit; then CSIT_ENV_FLAG=True DEPLOY_SCENARIO=$(echo ${DEPLOY_SCENARIO} | sed 's/-csit//') echo "INFO: CSIT env requested in deploy scenario" +elif echo ${DEPLOY_SCENARIO} | grep functest; then + FUNCTEST_ENV_FLAG=True + DEPLOY_SCENARIO=$(echo ${DEPLOY_SCENARIO} | sed 's/-functest//') + echo "INFO: Functest env requested in deploy scenario" fi echo "Deploy Scenario set to ${DEPLOY_SCENARIO}" @@ -140,13 +145,37 @@ if [[ "$JOB_NAME" =~ "virtual" ]]; then DEPLOY_CMD="${DEPLOY_CMD} --virtual-computes 2" fi - if [[ "$PROMOTE" == "True" || "$CSIT_ENV_FLAG" == "True" ]]; then - if [[ "$DEPLOY_SCENARIO" =~ "queens" ]]; then - CSIT_ENV="csit-queens-environment.yaml" + if [[ "$FUNCTEST_ENV_FLAG" == "True" || "$CSIT_ENV_FLAG" == "True" ]]; then + if [[ "$CSIT_ENV_FLAG" == "True" ]]; then + ENV_TYPE="csit" else - CSIT_ENV="csit-environment.yaml" + ENV_TYPE="functest" fi - DEPLOY_CMD="${DEPLOY_CMD} -e ${CSIT_ENV}" + if [ -z ${OS_VERSION+x} ]; then + echo "INFO: OS_VERSION not passed to deploy, detecting based on branch and scenario" + case $BRANCH in + master) + if [[ "$DEPLOY_SCENARIO" =~ "rocky" ]]; then + OS_VERSION=rocky + else + OS_VERSION=master + fi + ;; + *gambia) + OS_VERSION=queens + ;; + *) + echo "Unable to detection OS_VERSION, aborting" + exit 1 + ;; + esac + fi + if [[ "$OS_VERSION" != "master" ]]; then + SNAP_ENV="${ENV_TYPE}-${OS_VERSION}-environment.yaml" + else + SNAP_ENV="${ENV_TYPE}-environment.yaml" + fi + DEPLOY_CMD="${DEPLOY_CMD} -e ${SNAP_ENV}" fi else # settings for bare metal deployment @@ -161,14 +190,10 @@ 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 [[ "$PROMOTE" == "True" ]]; then +elif [[ "$CSIT_ENV_FLAG" == "True" || "$FUNCTEST_ENV_FLAG" == "True" ]]; then + # We use csit network settings which is single network for snapshots NETWORK_FILE="${NETWORK_SETTINGS_DIR}/network_settings_csit.yaml" else NETWORK_FILE="${NETWORK_SETTINGS_DIR}/network_settings.yaml"