]> review.fuel-infra Code Review - tools/sustaining.git/commitdiff
Add review cherry-picking to build image job 02/40602/1
authorVladimir Khlyunev <vkhlyunev@mirantis.com>
Mon, 25 Feb 2019 09:07:42 +0000 (13:07 +0400)
committerVladimir Khlyunev <vkhlyunev@mirantis.com>
Mon, 25 Feb 2019 09:07:42 +0000 (13:07 +0400)
Change-Id: I75e247295d135063ddc0993c37fc685d9fd13287

maintenance-ci/common/jobs/build-swarm-image.yaml
maintenance-ci/common/scripts/prepare_build_upload_image.sh

index 95dd340f4fd4dc7ee1c397126f4216c3e80b6b11..e4c987dcc0224e505b1277f0a2526a505bdc1e32 100644 (file)
@@ -17,6 +17,9 @@
     - string:
         name: UPDATE_SCRIPT
         default: "maintenance-ci/common/scripts/build_base_swarm_slave_image.sh"
+    - string:
+        name: GERRIT_REVIEW
+        description: 'Number of gerrit review'
 
     scm:
         - git:
index 8af73d3a47904d95cbe91f22f0db2c18613a55f5..ba9cd3577f9e8791a3bc580e9877b56d36f3a119 100755 (executable)
@@ -2,6 +2,14 @@
 
 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 '"')
+git fetch https://review.fuel-infra.org/tools/sustaining "${refspec}" && git cherry-pick -n FETCH_HEAD
+fi
+popd
+
 echo "${UPDATE_SCRIPT?} will be used for image building"
 
 if [[ ! -f xenial-server-cloudimg&&md64-disk1.img.bkp ]] ; then