From c193afbb8e681e11f72e2d24f08730959ff39446 Mon Sep 17 00:00:00 2001 From: Vladimir Khlyunev Date: Mon, 25 Feb 2019 13:07:42 +0400 Subject: [PATCH] Add review cherry-picking to build image job Change-Id: I75e247295d135063ddc0993c37fc685d9fd13287 --- maintenance-ci/common/jobs/build-swarm-image.yaml | 3 +++ .../common/scripts/prepare_build_upload_image.sh | 8 ++++++++ 2 files changed, 11 insertions(+) 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 -- 2.45.2