X-Git-Url: https://gerrit.nordix.org/gitweb?a=blobdiff_plain;f=jjb%2Fcloud-infra%2Fscripts%2Fgenerate-change-metadata.sh;h=878735d2c5b667a1a8f60944c1c54841c74ee92e;hb=4a03190d37a5ae619bb049f8142fb466070b046f;hp=e2c6a0f0de8b5b74bc0705ecdc84f4126cc1835d;hpb=3fcea29cdc23355145840893f3287da22db3356d;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 e2c6a0f0..878735d2 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