From a53dbbbd71b4d833407f43e6bb314595b87ee8de Mon Sep 17 00:00:00 2001 From: Vladimir Khlyunev Date: Wed, 13 Feb 2019 12:11:01 +0400 Subject: [PATCH] Allow to update jeknins jobs from gerrit review Change-Id: I1da521749d78c97921237b244b25284d81d968f1 --- maintenance-ci/common/jobs/update-jenkins-jobs.yaml | 4 ++-- maintenance-ci/common/scripts/update-jenkins-jobs.sh | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/maintenance-ci/common/jobs/update-jenkins-jobs.yaml b/maintenance-ci/common/jobs/update-jenkins-jobs.yaml index d1ea510..b1bcddb 100644 --- a/maintenance-ci/common/jobs/update-jenkins-jobs.yaml +++ b/maintenance-ci/common/jobs/update-jenkins-jobs.yaml @@ -10,8 +10,8 @@ parameters: - string: - name: JOBS_LIST - description: 'Space separated list of jobs to update. Will update all jobs if empty' + name: GERRIT_REVIEW + description: 'Number of gerrit review' scm: - git: diff --git a/maintenance-ci/common/scripts/update-jenkins-jobs.sh b/maintenance-ci/common/scripts/update-jenkins-jobs.sh index 5756a18..f9b4cb7 100644 --- a/maintenance-ci/common/scripts/update-jenkins-jobs.sh +++ b/maintenance-ci/common/scripts/update-jenkins-jobs.sh @@ -3,6 +3,11 @@ 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 FETCH_HEAD +fi + tox --help || sudo apt-get install -y python-tox tox -e jobs -- 2.45.2