Use include-regions to limit MVN build paths 92/11192/1
authorThanh Ha <thanh.ha@linuxfoundation.org>
Tue, 12 Jun 2018 02:22:39 +0000 (22:22 -0400)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Tue, 12 Jun 2018 02:23:36 +0000 (22:23 -0400)
Also move trigger definitions to more specific template rather
than anchor.

Issue: RELENG-1022
Change-Id: I73162326251f6ef1e656e06d68062c4ec0d45992
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
jjb/lf-maven-jobs.yaml

index ca94823..b1872a1 100644 (file)
     # Job Configuration #
     #####################
 
-    triggers:
-      # Build weekly on Saturdays
-      - timed: 'H H * * 6'
-      - gerrit:
-          server-name: '{gerrit-server-name}'
-          trigger-on: '{obj:gerrit_clm_triggers}'
-          projects:
-            - project-compare-type: ANT
-              project-pattern: '{project}'
-              branches:
-                - branch-compare-type: ANT
-                  branch-pattern: '**/{branch}'
-          skip-vote:
-            successful: true
-            failed: true
-            unstable: true
-            notbuilt: true
-
     builders:
       - lf-maven-install:
           mvn-version: '{mvn-version}'
           submodule-recursive: '{submodule-recursive}'
           choosing-strategy: default
 
+    triggers:
+      # Build weekly on Saturdays
+      - timed: 'H H * * 6'
+      - gerrit:
+          server-name: '{gerrit-server-name}'
+          trigger-on: '{obj:gerrit_clm_triggers}'
+          projects:
+            - project-compare-type: ANT
+              project-pattern: '{project}'
+              branches:
+                - branch-compare-type: ANT
+                  branch-pattern: '**/{branch}'
+          skip-vote:
+            successful: true
+            failed: true
+            unstable: true
+            notbuilt: true
+
 - job-template:
     name: '{project-name}-maven-clm-{stream}'
     id: github-maven-clm
           jenkins-ssh-credential: '{jenkins-ssh-credential}'
 
     triggers:
-      - lf-infra-github-pr-trigger:
+      # Build weekly on Saturdays
+      - timed: 'H H * * 6'
+      - github-pull-request:
           trigger-phrase: '^run-clm$'
           only-trigger-phrase: false
           status-context: 'CLM'
           permit-all: true
           github-hooks: true
-          github-org: ''
-          github_pr_whitelist:
-            - ''
-          github_pr_admin_list:
-            - ''
+          org-list:
+            - '{github-org}'
+          white-list: '{obj:github_pr_whitelist}'
+          admin-list: '{obj:github_pr_admin_list}'
 
 #########################
 # Maven Javadoc Publish #
       - github
       - pollscm:
           cron: ''
-      - lf-infra-github-pr-trigger:
+      - github-pull-request:
           trigger-phrase: '^remerge$'
           only-trigger-phrase: true
-          status-context: 'JJB Merge'
+          status-context: 'Maven Javadoc Publish'
           permit-all: false
           github-hooks: true
-          github-org: '{github-org}'
-          github_pr_whitelist: '{obj:github_pr_whitelist}'
-          github_pr_admin_list: '{obj:github_pr_admin_list}'
+          org-list:
+            - '{github-org}'
+          white-list: '{obj:github_pr_whitelist}'
+          admin-list: '{obj:github_pr_admin_list}'
 
 ########################
 # Maven Javadoc Verify #
           jenkins-ssh-credential: '{jenkins-ssh-credential}'
 
     triggers:
-      - lf-infra-github-pr-trigger:
+      - github-pull-request:
           trigger-phrase: '^recheck$'
-          only-trigger-phrase: true
-          status-context: 'Maven Javadoc'
+          only-trigger-phrase: false
+          status-context: 'Maven Javadoc Verify'
           permit-all: true
           github-hooks: true
-          github-org: ''
-          github_pr_whitelist:
-            - ''
-          github_pr_admin_list:
-            - ''
 
 ###############
 # Maven Merge #
           comment-contains-value: remerge$
 
     gerrit_trigger_file_paths:
-      - compare-type: ANT
-        pattern: '**'
+      - compare-type: REG_EXP
+        pattern: '.*'
+
+    # github_included_regions MUST match gerrit_trigger_file_paths
+    github_included_regions:
+      - '.*'
 
     post_build_trigger: ''
 
           jenkins-ssh-credential: '{jenkins-ssh-credential}'
 
     triggers:
-      - lf-infra-github-pr-trigger:
+      - github
+      - pollscm:
+          cron: ''
+      - github-pull-request:
           trigger-phrase: '^remerge$'
-          only-trigger-phrase: false
+          only-trigger-phrase: true
           status-context: 'Maven Merge'
-          permit-all: true
+          permit-all: false
           github-hooks: true
-          github-org: ''
-          github_pr_whitelist:
-            - ''
-          github_pr_admin_list:
-            - ''
+          org-list:
+            - '{github-org}'
+          white-list: '{obj:github_pr_whitelist}'
+          admin-list: '{obj:github_pr_admin_list}'
+          included-regions: '{obj:github_included_regions}'
 
 #################
 # Maven Release #
 
     triggers:
       - timed: '{obj:cron}'
-      - lf-infra-github-pr-trigger:
+      - github-pull-request:
           trigger-phrase: '^build release$'
           only-trigger-phrase: true
           status-context: 'Maven Release'
           permit-all: true
           github-hooks: true
-          github-org: ''
-          github_pr_whitelist:
-            - ''
-          github_pr_admin_list:
-            - ''
 
 ###############
 # Maven Sonar #
           jenkins-ssh-credential: '{jenkins-ssh-credential}'
 
     triggers:
-      - lf-infra-github-pr-trigger:
-          trigger-phrase: '^recheck$'
+      - github-pull-request:
+          trigger-phrase: '^run-sonar$'
           only-trigger-phrase: false
-          status-context: 'Maven Verify'
+          status-context: 'Maven Sonar'
           permit-all: true
           github-hooks: true
-          github-org: ''
-          github_pr_whitelist:
-            - ''
-          github_pr_admin_list:
-            - ''
 
 ################
 # Maven Verify #
       - comment-added-contains-event:
           comment-contains-value: recheck$
     gerrit_trigger_file_paths:
-      - compare-type: ANT
-        pattern: '**'
+      - compare-type: REG_EXP
+        pattern: '.*'
+
+    # github_included_regions MUST match gerrit_trigger_file_paths
+    github_included_regions:
+      - '.*'
 
     #####################
     # Job Configuration #
           jenkins-ssh-credential: '{jenkins-ssh-credential}'
 
     triggers:
-      - lf-infra-github-pr-trigger:
+      - github-pull-request:
           trigger-phrase: '^recheck$'
           only-trigger-phrase: false
           status-context: 'Maven Verify'
           permit-all: true
           github-hooks: true
-          github-org: ''
-          github_pr_whitelist:
-            - ''
-          github_pr_admin_list:
-            - ''
+          included-regions: '{obj:github_included_regions}'
 
 #############################
 # Maven Verify Dependencies #