X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fapex%2Fapex-download-artifact.sh;h=066d6120329eff9f9320b96689cb392d623036d4;hb=285a9448d4126e0cd66914a7dcbd698ff7ecea00;hp=68baf59da6b8af28261768918782dfcefe26c5fe;hpb=56bfea611737ad07e516647a656a50aa2c3febba;p=releng.git diff --git a/jjb/apex/apex-download-artifact.sh b/jjb/apex/apex-download-artifact.sh index 68baf59da..066d61203 100755 --- a/jjb/apex/apex-download-artifact.sh +++ b/jjb/apex/apex-download-artifact.sh @@ -10,7 +10,30 @@ echo [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY -if [[ "$ARTIFACT_VERSION" =~ dev ]]; then +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 +fi + +# if upstream we do not need to download anything +if [[ "$DEPLOY_SCENARIO" =~ upstream ]]; then + echo "Upstream deployment detected, skipping download artifact" +elif [[ "$ARTIFACT_VERSION" =~ dev ]]; then # dev build GERRIT_PATCHSET_NUMBER=$(echo $GERRIT_REFSPEC | grep -Eo '[0-9]+$') export OPNFV_ARTIFACT_VERSION="dev${GERRIT_CHANGE_NUMBER}_${GERRIT_PATCHSET_NUMBER}"