X-Git-Url: https://gerrit.nordix.org/gitweb?a=blobdiff_plain;f=jjb%2Fcloud-infra%2Fscripts%2Fgenerate-change-metadata.sh;h=4df6591ed1f2d538ea8004f1c5a953a8ceaf9643;hb=6d91877014585c9d2f0ebe59b42f77177bd14663;hp=73f889748eb8e892450a88d52c1eb01f911ddd19;hpb=a41cb97c1eb86df7fd495dff15100b2e7a005a0c;p=infra%2Fcicd.git diff --git a/jjb/cloud-infra/scripts/generate-change-metadata.sh b/jjb/cloud-infra/scripts/generate-change-metadata.sh index 73f88974..4df6591e 100755 --- a/jjb/cloud-infra/scripts/generate-change-metadata.sh +++ b/jjb/cloud-infra/scripts/generate-change-metadata.sh @@ -43,7 +43,7 @@ function determine_dependency() { echo "Info : Processing change $DEPENDENT_CHANGE_ID" declare -a DEPENDENT_CHANGE_METADATA readarray -t DEPENDENT_CHANGE_METADATA < <(curl -s "https://gerrit.nordix.org/changes/?q=$DEPENDENT_CHANGE_ID&o=CURRENT_REVISION" 2>&1 \ - | grep "project\|status\|current_revision\|ref.*," | sed -e 's/\s//g' -e 's/,//g' -e 's/"//g'| cut -d: -f2) + | grep "project\|status\|current_revision\|ref\".*," | sed -e 's/\s//g' -e 's/,//g' -e 's/"//g'| cut -d: -f2) # NOTE (fdegir): check if the dependeny change exists # and ignore if it doesn't @@ -103,6 +103,17 @@ echo "Info : Generating change metadata" # this scripts is used by all engine repos so we need to determine what this change is for export ENGINE_COMPONENT="${GERRIT_PROJECT//*\//}" +# Check if we need to override the deploy scenario. +if ! echo "$GERRIT_CHANGE_COMMIT_MESSAGE" | grep -qs "^Deploy-Scenario:"; then + echo "Info : No DEPLOY_SCENARIO override found." +else + echo "Info : DEPLOY_SCENARIO override found!" + echo "Info : Before override: DEPLOY_SCENARIO=${DEPLOY_SCENARIO}" + DEPLOY_SCENARIO=$(echo "$GERRIT_CHANGE_COMMIT_MESSAGE" | grep '^Deploy-Scenario:' | cut -d ":" -f2 | sed 's/\s*//g') + export DEPLOY_SCENARIO + echo "Info : After override: DEPLOY_SCENARIO=${DEPLOY_SCENARIO}" +fi + echo "Info : Setting STACK_TYPE and STACK_VERSION" if [[ "$GERRIT_PROJECT" =~ /stack/ ]]; then # set vars @@ -141,8 +152,10 @@ elif [[ "$GERRIT_PROJECT" =~ /installer/ ]]; then echo "NORDIX_$(echo $ENGINE_COMPONENT | tr a-z A-Z)_VERSION=$GERRIT_PATCHSET_REVISION" >> "$CHANGE_METADATA_FILE" echo "NORDIX_$(echo $ENGINE_COMPONENT | tr a-z A-Z)_REFSPEC=$GERRIT_REFSPEC" >> "$CHANGE_METADATA_FILE" else + # NOTE (fdegir): if the change comes into provisioner repos, we need to set the stack type + # properly for the jobs verifying those changes # set vars - export STACK_TYPE=kubernetes + export STACK_TYPE="${STACK_TYPE:-kubernetes}" export STACK_VERSION=$GERRIT_BRANCH # record vars to properties file @@ -158,6 +171,7 @@ export NORDIX_ARM_HTTPS_URL="https://artifactory.nordix.org/artifactory" export ARTIFACT_ARM_FOLDER="gerrit" export BUILD_IDENTIFIER=$GERRIT_CHANGE_NUMBER export OFFLINE_INSTALLER_FILE="/tmp/${STACK_TYPE}-${GERRIT_BRANCH}-${DISTRO}.bsx" +export OFFLINE_XTESTING_FILE="/tmp/${STACK_TYPE}-test-${GERRIT_BRANCH}.bsx" export BUILD_ARTIFACTS="/tmp/${STACK_TYPE}-${GERRIT_BRANCH}-${DISTRO}.bsx" export NORDIX_ARM_REPO="nordix-${STACK_TYPE}" export NORDIX_ARTIFACT_URL="$NORDIX_ARM_HTTPS_URL/$NORDIX_ARM_REPO/oss/$ARTIFACT_ARM_FOLDER/$BUILD_IDENTIFIER"