Merge "Add Gerrit Trigger for multipatch build"
authorJamo Luhrsen <jluhrsen@redhat.com>
Thu, 9 Nov 2017 16:28:55 +0000 (16:28 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 9 Nov 2017 16:28:55 +0000 (16:28 +0000)
jjb/integration/integration-test-jobs.yaml
jjb/integration/multipatch-distribution.sh

index 997d326921e4cf202890b5e0498e9c221b7da484..4813a8006551ff924f7c223b5d5be75cf5e4a641 100644 (file)
       - 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
index fde2a3dde4138f26bb04a33302c9c6a78d58738c..ea9e96b037df11cc2d050f20b864b76adadf276f 100644 (file)
@@ -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.