]> review.fuel-infra Code Review - tools/sustaining.git/commitdiff
Update gerrit refspec mechanism 90/41890/2
authorVladimir Khlyunev <vkhlyunev@mirantis.com>
Thu, 7 Apr 2022 21:46:37 +0000 (01:46 +0400)
committerVladimir Khlyunev <vkhlyunev@mirantis.com>
Thu, 7 Apr 2022 21:46:38 +0000 (21:46 +0000)
Change-Id: Ice45555822ad257a9607a7f3a6dd0f4e025584bd

maintenance-ci/common/scripts/deploy_heat_stack.sh
maintenance-ci/common/scripts/gerrit-review-last-refspec.sh
maintenance-ci/common/scripts/prepare_build_upload_image.sh
maintenance-ci/common/scripts/update_jenkins_jobs.sh
maintenance-ci/mos/scripts/fuel_qa_launch_test.sh
maintenance-ci/mos/scripts/tempest.create_env.sh

index d646a895358f12d22896c2e7f27a196adc8d69c6..231f37c0027e28abacf1539fe1f92b35a9f52dba 100755 (executable)
@@ -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
 
index dacbacce1aec94d5a5c4b5f791aeba8737245ea1..f6770bf623c3e582054cb788114c0c855ae67a7d 100644 (file)
@@ -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
 
index 9c361c8165aac3d16f2b42b9ea3989e168eece2c..b625241e4591ef443bd3ca81e6a3a6d07cf78171 100755 (executable)
@@ -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
index de4fdbbcbac4d70987988a3134d6fbd025fe57e2..7c02d195d9c969db0db17823372450af5ad72d7d 100644 (file)
@@ -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
 
index 5500bf06dd4ab1074d345d6fe6fd3a1951821843..e0484c27cf8518b101c0e7d67890b9edf1265d7e 100644 (file)
@@ -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
 
index 9355f24c4dcaf254dfe72dc95fed1f888f12439a..1db613412a77837077fa34a674296eb946319a14 100644 (file)
@@ -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