Add Gerrit trigger to clm job
[releng/global-jjb.git] / jjb / lf-maven-jobs.yaml
index 6d75666..47c2555 100644 (file)
     stream: master
     submodule-recursive: true
 
+    gerrit_clm_triggers:
+      - comment-added-contains-event:
+          comment-contains-value: run-clm$
+
     #####################
     # 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:
           choosing-strategy: default
           jenkins-ssh-credential: '{jenkins-ssh-credential}'
 
+    triggers:
+      - lf-infra-github-pr-trigger:
+          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:
+            - ''
+
 #########################
 # Maven Javadoc Publish #
 #########################
     mvn-opts: ''
     mvn-params: ''
     mvn-version: mvn33
+    sonar-mvn-goal: 'sonar:sonar'
     staging-profile-id: ''  # Unused in this job
     stream: master
     submodule-recursive: true
     # Job Configuration #
     #####################
 
+    parameters:
+      - lf-infra-parameters:
+          project: '{project}'
+          branch: '{branch}'
+          stream: '{stream}'
+          lftools-version: '{lftools-version}'
+      - lf-infra-maven-parameters:
+          mvn-opts: '{mvn-opts}'
+          mvn-params: '{mvn-params}'
+          mvn-version: '{mvn-version}'
+          # Staging repos do not make sense for Sonar jobs so set it blank.
+          staging-profile-id: ''
+      - string:
+          name: ARCHIVE_ARTIFACTS
+          default: '{archive-artifacts}'
+          description: Artifacts to archive to the logs server.
+      - string:
+          name: SONAR_MAVEN_GOAL
+          default: '{sonar-mvn-goal}'
+          description: |
+              Maven goals to pass to the Sonar call. Typically sonar:sonar
+              however to use a specific version of the sonar-maven-plugin we
+              can call "org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar".
+
     triggers:
       - timed: 'H H * * 6'
       - gerrit:
           mvn-version: '{mvn-version}'
       - inject:
           # Switch this to the sonar wrapper when JJB 2.0 is available
-          properties-content: |
-              SONAR_HOST_URL=$SONAR_URL
-              SONAR_MAVEN_GOAL=sonar:sonar
+          properties-content: SONAR_HOST_URL=$SONAR_URL
       - lf-provide-maven-settings:
           global-settings-file: global-settings
           settings-file: '{mvn-settings}'