X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fapex%2Fapex-deploy.sh;h=09d6ca6307ff92f419697cbbb7f0bdf0e74c5329;hb=bf1c548824a58c867cf0f87df0d5984a5226c898;hp=7840919cd7fafc3bec96b4080037c45e8854b812;hpb=f00dc471d4ccd9b5b0e06146f09b4546d2ac3133;p=releng.git diff --git a/jjb/apex/apex-deploy.sh b/jjb/apex/apex-deploy.sh index 7840919cd..09d6ca630 100755 --- a/jjb/apex/apex-deploy.sh +++ b/jjb/apex/apex-deploy.sh @@ -5,13 +5,15 @@ 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 @@ -28,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 @@ -54,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 @@ -106,12 +108,24 @@ if echo ${DEPLOY_SCENARIO} | grep ipv6; then IPV6_FLAG=True DEPLOY_SCENARIO=$(echo ${DEPLOY_SCENARIO} | sed 's/-ipv6//') echo "INFO: IPV6 Enabled" -elif echo ${DEPLOY_SCENARIO} | grep allinone; then +fi + +if echo ${DEPLOY_SCENARIO} | grep allinone; then ALLINONE_FLAG=True DEPLOY_SCENARIO=$(echo ${DEPLOY_SCENARIO} | sed 's/-allinone//') echo "INFO: All in one deployment detected" fi +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}" DEPLOY_FILE="${DEPLOY_SETTINGS_DIR}/${DEPLOY_SCENARIO}.yaml" @@ -131,13 +145,37 @@ if [[ "$JOB_NAME" =~ "virtual" ]]; then DEPLOY_CMD="${DEPLOY_CMD} --virtual-computes 2" fi - if [[ "$PROMOTE" == "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 + 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 - DEPLOY_CMD="${DEPLOY_CMD} -e ${CSIT_ENV}" + 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 @@ -152,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"