From: Thanh Ha Date: Wed, 8 Nov 2017 16:14:10 +0000 (-0500) Subject: Add Gerrit Trigger for multipatch build X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=2f019fee41c19d15400b87d1caa59504ca87eb53;p=releng%2Fbuilder.git Add Gerrit Trigger for multipatch build Introduces a new trigger "multipatch-build:" which can be used to trigger a build from a Gerrit comment rather than requiring committers to have Jenkins access. Patch parameters are passed through a 1 liner after the colon of the trigger. Change-Id: I4c269d3db11a80d981209ef9b1b4ff428f1b7741 Signed-off-by: Thanh Ha --- diff --git a/jjb/integration/integration-test-jobs.yaml b/jjb/integration/integration-test-jobs.yaml index cca3d2bee..17a814f52 100644 --- a/jjb/integration/integration-test-jobs.yaml +++ b/jjb/integration/integration-test-jobs.yaml @@ -279,6 +279,19 @@ - opendaylight-infra-wrappers: build-timeout: '1200' + triggers: + - gerrit: + server-name: '{gerrit-server-name}' + trigger-on: + - comment-added-contains-event: + comment-contains-value: 'multipatch-build:' + projects: + - project-compare-type: ANT + project-pattern: '**' + branches: + - branch-compare-type: ANT + branch-pattern: '**/{branch}' + builders: - wipe-org-opendaylight-repo - integration-multipatch-builder diff --git a/jjb/integration/multipatch-distribution.sh b/jjb/integration/multipatch-distribution.sh index fde2a3dde..ea9e96b03 100644 --- a/jjb/integration/multipatch-distribution.sh +++ b/jjb/integration/multipatch-distribution.sh @@ -30,7 +30,12 @@ export EMAIL="sandbox@jenkins.opendaylight.org" export GIT_COMMITTER_NAME="Multipatch Job" # TODO: Is "patches" still the correct word? -IFS=',' read -ra PATCHES <<< "${PATCHES_TO_BUILD}" +if [ -n "$GERRIT_EVENT_COMMENT_TEXT" ]; then + PATCHES=($(echo "$GERRIT_EVENT_COMMENT_TEXT" \ + | grep 'multipatch-build:' | awk -F: '{print $2}')) +else + IFS=',' read -ra PATCHES <<< "${PATCHES_TO_BUILD}" +fi # For each patch: # * Clone the project.