+- job-template:
+ name: '{project-name}-maven-stage-{stream}'
+ id: gerrit-maven-stage
+ <<: *lf_maven_common
+ # yamllint disable-line rule:key-duplicates
+ <<: *lf_maven_stage
+
+ scm:
+ - lf-infra-gerrit-scm:
+ jenkins-ssh-credential: '{jenkins-ssh-credential}'
+ git-url: '{git-url}'
+ refspec: '$GERRIT_REFSPEC'
+ branch: '$GERRIT_BRANCH'
+ submodule-recursive: '{submodule-recursive}'
+ submodule-timeout: '{submodule-timeout}'
+ choosing-strategy: default
+
+ triggers:
+ - timed: '{obj:cron}'
+ - gerrit:
+ server-name: '{gerrit-server-name}'
+ trigger-on: '{obj:gerrit_release_triggers}'
+ projects:
+ - project-compare-type: ANT
+ project-pattern: '{project}'
+ branches:
+ - branch-compare-type: ANT
+ branch-pattern: '**/{branch}'
+
+- job-template:
+ name: '{project-name}-maven-stage-{stream}'
+ id: github-maven-stage
+ <<: *lf_maven_common
+ # yamllint disable-line rule:key-duplicates
+ <<: *lf_maven_stage
+
+ properties:
+ - lf-infra-properties:
+ build-days-to-keep: '{build-days-to-keep}'
+ - github:
+ url: '{github-url}/{github-org}/{project}'
+
+ scm:
+ - lf-infra-github-scm:
+ url: '{git-clone-url}{github-org}/{project}'
+ refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
+ branch: '{branch}'
+ submodule-recursive: '{submodule-recursive}'
+ submodule-timeout: '{submodule-timeout}'
+ choosing-strategy: default
+ jenkins-ssh-credential: '{jenkins-ssh-credential}'
+
+ triggers:
+ - timed: '{obj:cron}'
+ - github-pull-request:
+ trigger-phrase: '^build release$'
+ only-trigger-phrase: true
+ status-context: 'Maven Release'
+ permit-all: true
+ github-hooks: true
+ white-list-target-branches:
+ - '{branch}'
+
+###############
+# Maven Sonar #
+###############
+
+- lf_maven_sonar: &lf_maven_sonar
+ name: lf-maven-sonar
+
+ ######################
+ # Default parameters #
+ ######################
+
+ branch: master # Sonar should always be run on master branch
+ build-days-to-keep: 7
+ build-timeout: 60
+ cron: 'H H * * 6' # run weekly
+ disable-job: false
+ git-url: '$GIT_URL/$PROJECT'
+ github-url: 'https://github.com'
+ java-version: openjdk8
+ mvn-global-settings: global-settings
+ mvn-opts: ''
+ mvn-params: ''
+ mvn-version: mvn35
+ sonar-mvn-goal: 'sonar:sonar'
+ stream: master
+ submodule-recursive: true
+ submodule-timeout: 10
+
+ gerrit_sonar_triggers:
+ - comment-added-contains-event:
+ comment-contains-value: run-sonar$
+
+ #####################
+ # Job Configuration #
+ #####################
+
+ disabled: '{disable-job}'
+
+ 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}'
+ - 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: '{obj:cron}'
+ - gerrit:
+ server-name: '{gerrit-server-name}'
+ trigger-on: '{obj:gerrit_sonar_triggers}'
+ projects:
+ - project-compare-type: 'ANT'
+ project-pattern: '{project}'
+ branches:
+ - branch-compare-type: 'ANT'
+ branch-pattern: '**/master'
+ skip-vote:
+ successful: true
+ failed: true
+ unstable: true
+ notbuilt: true
+
+ builders:
+ - lf-infra-pre-build
+ - lf-infra-maven-sonar:
+ java-version: '{java-version}'
+ mvn-settings: '{mvn-settings}'
+ mvn-version: '{mvn-version}'
+