Change-Id: I75e247295d135063ddc0993c37fc685d9fd13287
- 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:
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