+
+ 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
+ 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
+
+ gerrit_sonar_triggers:
+ - comment-added-contains-event:
+ comment-contains-value: run-sonar$
+
+ #####################
+ # 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}'
+ - 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-maven-sonar:
+ java-version: '{java-version}'
+ mvn-settings: '{mvn-settings}'
+ mvn-version: '{mvn-version}'
+
+ publishers:
+ - lf-jacoco-report
+ - findbugs
+ - lf-infra-publish
+
+- builder:
+ name: lf-infra-maven-sonar
+ # Run a Sonar build with Maven
+ builders:
+ - lf-maven-install:
+ mvn-version: '{mvn-version}'
+ - lf-update-java-alternatives:
+ java-version: '{java-version}'
+ - inject:
+ # Switch this to the sonar wrapper when JJB 2.0 is available
+ properties-content: SONAR_HOST_URL=$SONAR_URL
+ - lf-provide-maven-settings:
+ global-settings-file: global-settings
+ settings-file: '{mvn-settings}'
+ - shell: !include-raw-escape:
+ - ../shell/common-variables.sh
+ - ../shell/maven-sonar.sh
+ - lf-provide-maven-settings-cleanup
+
+- job-template:
+ name: '{project-name}-sonar'
+ id: gerrit-maven-sonar
+ <<: *lf_maven_common
+ # yamllint disable-line rule:key-duplicates
+ <<: *lf_maven_sonar
+
+ 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}'
+ choosing-strategy: default
+
+- job-template:
+ name: '{project-name}-sonar'
+ id: github-maven-sonar
+ <<: *lf_maven_common
+ # yamllint disable-line rule:key-duplicates
+ <<: *lf_maven_sonar
+
+ 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: '$sha1'
+ submodule-recursive: '{submodule-recursive}'
+ choosing-strategy: default
+ jenkins-ssh-credential: '{jenkins-ssh-credential}'
+
+ triggers:
+ - github-pull-request:
+ trigger-phrase: '^run-sonar$'
+ only-trigger-phrase: false
+ status-context: 'Maven Sonar'
+ permit-all: true
+ github-hooks: true
+ white-list-target-branches:
+ - '{branch}'
+
+################
+# Maven Verify #
+################
+
+- lf_maven_verify: &lf_maven_verify
+ name: lf-maven-verify
+
+ ######################
+ # Default parameters #
+ ######################
+
+ branch: master
+ build-days-to-keep: 7
+ build-timeout: 60
+ git-url: '$GIT_URL/$PROJECT'
+ github-url: 'https://github.com'
+ java-version: openjdk8
+ mvn-global-settings: global-settings
+ mvn-goals: clean deploy
+ mvn-opts: ''
+ mvn-params: '-Dstream=$STREAM'
+ mvn-version: mvn35
+ stream: master
+ submodule-recursive: true
+
+ gerrit_verify_triggers:
+ - patchset-created-event:
+ exclude-drafts: true
+ exclude-trivial-rebase: false
+ exclude-no-code-change: false
+ - draft-published-event
+ - comment-added-contains-event:
+ comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
+
+ gerrit_trigger_file_paths:
+ - compare-type: REG_EXP
+ pattern: '.*'
+
+ # github_included_regions MUST match gerrit_trigger_file_paths
+ github_included_regions:
+ - '.*'
+
+ #####################
+ # Job Configuration #
+ #####################
+
+ concurrent: true
+
+ builders:
+ - lf-jacoco-nojava-workaround
+ - lf-maven-install:
+ mvn-version: '{mvn-version}'
+ - lf-update-java-alternatives:
+ java-version: '{java-version}'
+ - lf-provide-maven-settings:
+ global-settings-file: '{mvn-global-settings}'
+ settings-file: '{mvn-settings}'
+ - shell: !include-raw-escape:
+ - ../shell/lftools-install.sh
+ - lf-maven-build:
+ mvn-goals: '{mvn-goals}'
+ - lf-provide-maven-settings-cleanup
+
+ publishers:
+ - findbugs
+ - lf-jacoco-report
+ - lf-infra-publish
+
+- job-template:
+ name: '{project-name}-maven-verify-{stream}-{mvn-version}-{java-version}'
+ id: gerrit-maven-verify
+ <<: *lf_maven_common
+ # yamllint disable-line rule:key-duplicates
+ <<: *lf_maven_verify
+
+ 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}'
+ choosing-strategy: gerrit
+
+ triggers:
+ - gerrit:
+ server-name: '{gerrit-server-name}'
+ trigger-on: '{obj:gerrit_verify_triggers}'
+ projects:
+ - project-compare-type: ANT
+ project-pattern: '{project}'
+ branches:
+ - branch-compare-type: ANT
+ branch-pattern: '**/{branch}'
+ file-paths: '{obj:gerrit_trigger_file_paths}'
+
+- job-template:
+ name: '{project-name}-maven-verify-{stream}-{mvn-version}-{java-version}'
+ id: github-maven-verify
+ <<: *lf_maven_common
+ # yamllint disable-line rule:key-duplicates
+ <<: *lf_maven_verify
+
+ 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: '$sha1'
+ submodule-recursive: '{submodule-recursive}'
+ choosing-strategy: default
+ jenkins-ssh-credential: '{jenkins-ssh-credential}'
+
+ triggers:
+ - github-pull-request:
+ trigger-phrase: '^(recheck|reverify)$'
+ only-trigger-phrase: false
+ status-context: 'Maven Verify'
+ permit-all: true
+ github-hooks: true
+ white-list-target-branches:
+ - '{branch}'
+ included-regions: '{obj:github_included_regions}'
+
+#############################
+# Maven Verify Dependencies #
+#############################
+
+- lf_maven_verify_dependencies: &lf_maven_verify_dependencies
+ name: lf-maven-verify-dependencies
+
+ ######################
+ # Default parameters #
+ ######################
+
+ branch: master
+ build-days-to-keep: 7
+ build-timeout: 60
+ git-url: '$GIT_URL/$PROJECT'
+ github-url: 'https://github.com'
+ java-version: openjdk8
+ mvn-global-settings: global-settings
+ mvn-goals: clean deploy
+ mvn-opts: ''
+ mvn-params: '-Dstream=$STREAM'
+ mvn-version: mvn35
+ stream: master
+ submodule-recursive: true
+
+ gerrit_verify_triggers:
+ - comment-added-contains-event:
+ comment-contains-value: 'recheck: [0-9 ]+'
+ gerrit_trigger_file_paths:
+ - compare-type: ANT
+ pattern: '**'
+
+ #####################
+ # Job Configuration #
+ #####################
+
+ concurrent: true
+
+ builders:
+ - lf-jacoco-nojava-workaround
+ - lf-maven-install:
+ mvn-version: '{mvn-version}'
+ - lf-update-java-alternatives:
+ java-version: '{java-version}'
+ - lf-provide-maven-settings:
+ global-settings-file: '{mvn-global-settings}'
+ settings-file: '{mvn-settings}'
+ - lf-fetch-dependent-patches
+ - shell: !include-raw-escape:
+ - ../shell/common-variables.sh
+ - ../shell/maven-build-deps.sh
+ - lf-maven-build:
+ mvn-goals: '{mvn-goals}'
+ - lf-provide-maven-settings-cleanup
+
+ publishers:
+ - findbugs
+ - lf-jacoco-report
+ - lf-infra-publish
+
+- job-template:
+ name: '{project-name}-maven-verify-deps-{stream}-{mvn-version}-{java-version}'
+ id: gerrit-maven-verify-dependencies
+ <<: *lf_maven_common
+ # yamllint disable-line rule:key-duplicates
+ <<: *lf_maven_verify_dependencies
+
+ 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}'
+ choosing-strategy: gerrit
+
+ triggers:
+ - gerrit:
+ server-name: '{gerrit-server-name}'
+ trigger-on: '{obj:gerrit_verify_triggers}'
+ projects:
+ - project-compare-type: ANT
+ project-pattern: '{project}'
+ branches:
+ - branch-compare-type: ANT
+ branch-pattern: '**/{branch}'
+ file-paths: '{obj:gerrit_trigger_file_paths}'