From: Vladimir Khlyunev Date: Mon, 25 Feb 2019 09:07:42 +0000 (+0400) Subject: Add review cherry-picking to build image job X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=c193afbb8e681e11f72e2d24f08730959ff39446;p=tools%2Fsustaining.git Add review cherry-picking to build image job Change-Id: I75e247295d135063ddc0993c37fc685d9fd13287 --- diff --git a/maintenance-ci/common/jobs/build-swarm-image.yaml b/maintenance-ci/common/jobs/build-swarm-image.yaml index 95dd340..e4c987d 100644 --- a/maintenance-ci/common/jobs/build-swarm-image.yaml +++ b/maintenance-ci/common/jobs/build-swarm-image.yaml @@ -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: diff --git a/maintenance-ci/common/scripts/prepare_build_upload_image.sh b/maintenance-ci/common/scripts/prepare_build_upload_image.sh index 8af73d3..ba9cd35 100755 --- a/maintenance-ci/common/scripts/prepare_build_upload_image.sh +++ b/maintenance-ci/common/scripts/prepare_build_upload_image.sh @@ -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