From: Vladimir Khlyunev Date: Thu, 7 Apr 2022 21:46:37 +0000 (+0400) Subject: Update gerrit refspec mechanism X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=44b17a57d84118162a70f96996c16ec727817949;p=tools%2Fsustaining.git Update gerrit refspec mechanism Change-Id: Ice45555822ad257a9607a7f3a6dd0f4e025584bd --- diff --git a/maintenance-ci/common/scripts/deploy_heat_stack.sh b/maintenance-ci/common/scripts/deploy_heat_stack.sh index d646a89..231f37c 100755 --- a/maintenance-ci/common/scripts/deploy_heat_stack.sh +++ b/maintenance-ci/common/scripts/deploy_heat_stack.sh @@ -3,7 +3,7 @@ set -ex if [ ! -z ${GERRIT_REVIEW} ] ; then - refspec=$(curl "https://review.fuel-infra.org/changes/?q=${GERRIT_REVIEW}&o=CURRENT_REVISION" | grep '"ref":' | awk -F ": " '{print $2}' | tr -d '"') + refspec=$(curl "https://review.fuel-infra.org/changes/?q=${GERRIT_REVIEW}&o=CURRENT_REVISION" | sed 's|.*\(refs/changes/[0-9]\+/[0-9]\+/[0-9]\+\).*|\1|p' | tail -n1) git fetch https://review.fuel-infra.org/tools/sustaining "${refspec}" && git cherry-pick -n FETCH_HEAD fi diff --git a/maintenance-ci/common/scripts/gerrit-review-last-refspec.sh b/maintenance-ci/common/scripts/gerrit-review-last-refspec.sh index dacbacc..f6770bf 100644 --- a/maintenance-ci/common/scripts/gerrit-review-last-refspec.sh +++ b/maintenance-ci/common/scripts/gerrit-review-last-refspec.sh @@ -4,7 +4,7 @@ set -ex pushd ${REPO_DIR:-.} if [[ ! -z ${GERRIT_REVIEW} ]] ; then -refspec=$(curl "https://review.fuel-infra.org/changes/?q=${GERRIT_REVIEW}&o=CURRENT_REVISION" | grep '"ref":' | awk -F ": " '{print $2}' | tr -d '"') +refspec=$(curl "https://review.fuel-infra.org/changes/?q=${GERRIT_REVIEW}&o=CURRENT_REVISION" | sed 's|.*\(refs/changes/[0-9]\+/[0-9]\+/[0-9]\+\).*|\1|p' | tail -n1) git fetch https://review.fuel-infra.org/tools/sustaining "${refspec}" && git cherry-pick -n FETCH_HEAD fi diff --git a/maintenance-ci/common/scripts/prepare_build_upload_image.sh b/maintenance-ci/common/scripts/prepare_build_upload_image.sh index 9c361c8..b625241 100755 --- a/maintenance-ci/common/scripts/prepare_build_upload_image.sh +++ b/maintenance-ci/common/scripts/prepare_build_upload_image.sh @@ -5,7 +5,7 @@ set -ex pushd maintenance-ci if [[ ! -z ${GERRIT_REVIEW} ]] ; then -refspec=$(curl "https://review.fuel-infra.org/changes/?q=${GERRIT_REVIEW}&o=CURRENT_REVISION" | grep '"ref":' | awk -F ": " '{print $2}' | tr -d '"') +refspec=$(curl "https://review.fuel-infra.org/changes/?q=${GERRIT_REVIEW}&o=CURRENT_REVISION" | sed 's|.*\(refs/changes/[0-9]\+/[0-9]\+/[0-9]\+\).*|\1|p' | tail -n1) git fetch https://review.fuel-infra.org/tools/sustaining "${refspec}" && git cherry-pick -n FETCH_HEAD fi popd diff --git a/maintenance-ci/common/scripts/update_jenkins_jobs.sh b/maintenance-ci/common/scripts/update_jenkins_jobs.sh index de4fdbb..7c02d19 100644 --- a/maintenance-ci/common/scripts/update_jenkins_jobs.sh +++ b/maintenance-ci/common/scripts/update_jenkins_jobs.sh @@ -4,7 +4,7 @@ set -ex pushd maintenance-ci if [ ! -z ${GERRIT_REVIEW} ] ; then -refspec=$(curl "https://review.fuel-infra.org/changes/?q=${GERRIT_REVIEW}&o=CURRENT_REVISION" | grep '"ref":' | awk -F ": " '{print $2}' | tr -d '"') +refspec=$(curl "https://review.fuel-infra.org/changes/?q=${GERRIT_REVIEW}&o=CURRENT_REVISION" | sed 's|.*\(refs/changes/[0-9]\+/[0-9]\+/[0-9]\+\).*|\1|p' | tail -n1) git fetch https://review.fuel-infra.org/tools/sustaining "${refspec}" && git cherry-pick -n FETCH_HEAD fi diff --git a/maintenance-ci/mos/scripts/fuel_qa_launch_test.sh b/maintenance-ci/mos/scripts/fuel_qa_launch_test.sh index 5500bf0..e0484c2 100644 --- a/maintenance-ci/mos/scripts/fuel_qa_launch_test.sh +++ b/maintenance-ci/mos/scripts/fuel_qa_launch_test.sh @@ -44,7 +44,7 @@ echo "======================================================" set -x if [[ ! -z ${FUEL_QA_GERRIT_REVIEW} ]] ; then -refspec=$(curl "https://review.fuel-infra.org/changes/?q=${FUEL_QA_GERRIT_REVIEW}&o=CURRENT_REVISION" | grep '"ref":' | awk -F ": " '{print $2}' | tr -d '"') +refspec=$(curl "https://review.fuel-infra.org/changes/?q=${FUEL_QA_GERRIT_REVIEW}&o=CURRENT_REVISION" | sed 's|.*\(refs/changes/[0-9]\+/[0-9]\+/[0-9]\+\).*|\1|p' | tail -n1) git fetch https://review.fuel-infra.org/openstack/fuel-qa "${refspec}" && git cherry-pick -n FETCH_HEAD fi diff --git a/maintenance-ci/mos/scripts/tempest.create_env.sh b/maintenance-ci/mos/scripts/tempest.create_env.sh index 9355f24..1db6134 100644 --- a/maintenance-ci/mos/scripts/tempest.create_env.sh +++ b/maintenance-ci/mos/scripts/tempest.create_env.sh @@ -72,7 +72,7 @@ set -x if [[ ! -z ${FUEL_QA_GERRIT_REVIEW} ]] ; then -refspec=$(curl "https://review.fuel-infra.org/changes/?q=${FUEL_QA_GERRIT_REVIEW}&o=CURRENT_REVISION" | grep '"ref":' | awk -F ": " '{print $2}' | tr -d '"') +refspec=$(curl "https://review.fuel-infra.org/changes/?q=${FUEL_QA_GERRIT_REVIEW}&o=CURRENT_REVISION" | sed 's|.*\(refs/changes/[0-9]\+/[0-9]\+/[0-9]\+\).*|\1|p' | tail -n1) git fetch https://review.fuel-infra.org/openstack/fuel-qa "${refspec}" && git cherry-pick -n FETCH_HEAD fi