X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=jjb%2Flf-maven-jobs.yaml;h=cde9177e57d82378fe0f534f33595c1627c36db8;hb=f92a1ef0646cb1cecdd121c0c4e0ba58c97f24f8;hp=3f6de2e850c872982bf0d187e785ccef13cf5f76;hpb=98f414a8e0c4a5977d05dd97b09399fcbeaae74d;p=releng%2Fglobal-jjb.git diff --git a/jjb/lf-maven-jobs.yaml b/jjb/lf-maven-jobs.yaml index 3f6de2e8..cde9177e 100644 --- a/jjb/lf-maven-jobs.yaml +++ b/jjb/lf-maven-jobs.yaml @@ -10,6 +10,7 @@ jobs: - gerrit-maven-clm - gerrit-maven-release + - gerrit-maven-verify - job-group: name: '{project-name}-github-maven-jobs' @@ -20,11 +21,72 @@ jobs: - github-maven-clm - github-maven-release + - github-maven-verify + +- job-group: + name: '{project-name}-maven-javadoc-jobs' + + # This job group contains all the recommended jobs that should be deployed + # for any project ci. + + jobs: + - gerrit-maven-javadoc-publish + - gerrit-maven-javadoc-verify + +- job-group: + name: '{project-name}-github-maven-javadoc-jobs' + + # This job group contains all the recommended jobs that should be deployed + # for any project ci. + + jobs: + - github-maven-javadoc-publish + - github-maven-javadoc-verify #################### -# Anchors & Macros # +# COMMON FUNCTIONS # #################### +- lf_maven_common: &lf_maven_common + name: lf-maven-common + + project-type: freestyle + node: '{build-node}' + jdk: '{java-version}' + + properties: + - lf-infra-properties: + build-days-to-keep: '{build-days-to-keep}' + + 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 CLM jobs so set it blank. + staging-profile-id: '{staging-profile-id}' + + wrappers: + - lf-infra-wrappers: + build-timeout: '{build-timeout}' + jenkins-ssh-credential: '{jenkins-ssh-credential}' + + publishers: + # TODO: Make email notification work. + # - lf-infra-email-notify: + # email-recipients: '{email-recipients}' + # email-prefix: '[releng]' + - lf-infra-publish + +############# +# Maven CLM # +############# + - lf_maven_clm: &lf_maven_clm name: lf-maven-clm @@ -41,15 +103,12 @@ # mvn-global-settings: The name of the Maven global settings to use for # Maven configuration. (default: global-settings) - project-type: freestyle - node: '{build-node}' - jdk: '{java-version}' - ###################### # Default parameters # ###################### branch: master + build-days-to-keep: 30 # 30 days for troubleshooting purposes build-timeout: 15 git-url: '$GIT_URL/$PROJECT' java-version: openjdk8 @@ -57,6 +116,7 @@ mvn-opts: '' mvn-params: '' mvn-version: mvn33 + staging-profile-id: '' # Unused in this job stream: master submodule-recursive: true @@ -64,28 +124,6 @@ # Job Configuration # ##################### - properties: - - lf-infra-properties: - # Keep around for 30 days for troubleshooting purposes. - build-days-to-keep: 30 - - parameters: - - lf-infra-parameters: - project: '{project}' - branch: '{branch}' - stream: '{stream}' - - lf-infra-maven-parameters: - mvn-opts: '{mvn-opts}' - mvn-params: '{mvn-params}' - mvn-version: '{mvn-version}' - # Staging repos do not make sense for CLM jobs so set it blank. - staging-profile-id: '' - - wrappers: - - lf-infra-wrappers: - build-timeout: '{build-timeout}' - jenkins-ssh-credential: '{jenkins-ssh-credential}' - triggers: # Build weekly on Saturdays - timed: 'H H * * 6' @@ -97,7 +135,6 @@ global-settings-file: '{mvn-global-settings}' settings-file: '{mvn-settings}' - shell: !include-raw-escape: - - ../shell/lftools-install.sh - ../shell/common-variables.sh - ../shell/sonatype-clm.sh - lf-provide-maven-settings-cleanup @@ -105,16 +142,197 @@ - sonatype-clm: application-name: '{project-name}' - publishers: - - lf-infra-publish +- job-template: + name: '{project-name}-maven-clm-{stream}' + id: gerrit-maven-clm + <<: *lf_maven_common + # yamllint disable-line rule:key-duplicates + <<: *lf_maven_clm -- lf_maven_release: &lf_maven_release - name: lf-maven-release + 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 - # Produces a release candidate by creating a staging repo in Nexus. +- job-template: + name: '{project-name}-maven-clm-{stream}' + id: github-maven-clm + <<: *lf_maven_common + # yamllint disable-line rule:key-duplicates + <<: *lf_maven_clm + + properties: + - github: + url: '{git-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}' + choosing-strategy: default + jenkins-ssh-credential: '{jenkins-ssh-credential}' + +######################### +# Maven Javadoc Publish # +######################### + +- lf_maven_javadoc_publish: &lf_maven_javadoc_publish + name: lf-maven-javadoc-publish + + # Produces and publishes javadocs for a Maven project. # - # Runs a Maven build and deploys to $WORKSPACE/m2repo directory. This - # directory can then be reused later to deploy to Nexus. + # Expects javadocs to be available in $WORKSPACE/target/site/apidocs + # + # Required parameters: + # + # :build-node: The node to run build on. + # :javadoc-path: The path in Nexus to deploy javadoc to. + # :jenkins-ssh-credential: Credential to use for SSH. (Generally should + # be configured in defaults.yaml) + # :mvn-settings: The name of settings file containing credentials for + # the project. + # :mvn-site-id: Maven Server ID from settings.xml to pull credentials from. + # (Note: This setting should be configured in defaults.yaml.) + # + # Optional parameters: + # + # :branch: The branch to build against. (default: master) + # :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7) + # :build-timeout: Timeout in seconds before aborting build. (default: 60) + # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT) + # :java-version: Version of Java to use for the build. (default: openjdk8) + # :mvn-global-settings: The name of the Maven global settings to use for + # Maven configuration. (default: global-settings) + # :mvn-opts: Sets MAVEN_OPTS. (default: '') + # :mvn-params: Additional mvn parameters to pass to the cli. (default: '') + # :mvn-version: Version of maven to use. (default: mvn33) + # :submodule-recursive: Whether to checkout submodules recursively. + # (default: true) + # + # :gerrit_merge_triggers: Override Gerrit Triggers. + + ###################### + # Default parameters # + ###################### + + branch: master + build-days-to-keep: 30 # 30 days in case a release takes long to get approved. + build-timeout: 30 + git-url: '$GIT_URL/$PROJECT' + java-version: openjdk8 + mvn-global-settings: global-settings + mvn-opts: '' + mvn-params: '' + mvn-version: mvn33 + staging-profile-id: '' # Unused by the javadoc jobs + stream: master + submodule-recursive: true + + gerrit_merge_triggers: + - change-merged-event + - comment-added-contains-event: + comment-contains-value: remerge$ + + ##################### + # Job Configuration # + ##################### + + builders: + - lf-maven-install: + mvn-version: '{mvn-version}' + - lf-provide-maven-settings: + global-settings-file: '{mvn-global-settings}' + settings-file: '{mvn-settings}' + - lf-infra-create-netrc: + server-id: '{mvn-site-id}' + - inject: + properties-content: 'DEPLOY_PATH={javadoc-path}' + - shell: !include-raw-escape: + - ../shell/common-variables.sh + - ../shell/maven-javadoc-generate.sh + - ../shell/lftools-install.sh + - ../shell/maven-javadoc-publish.sh + - lf-provide-maven-settings-cleanup + +- job-template: + name: '{project-name}-maven-javadoc-publish-{stream}' + id: gerrit-maven-javadoc-publish + <<: *lf_maven_common + # yamllint disable-line rule:key-duplicates + <<: *lf_maven_javadoc_publish + + git-url: '$GIT_URL/$GERRIT_PROJECT' + + scm: + - lf-infra-gerrit-scm: + git-url: '{git-url}' + refspec: '' + branch: '{branch}' + submodule-recursive: '{submodule-recursive}' + choosing-strategy: default + jenkins-ssh-credential: '{jenkins-ssh-credential}' + + triggers: + - gerrit: + server-name: '{gerrit-server-name}' + trigger-on: '{obj:gerrit_merge_triggers}' + projects: + - project-compare-type: ANT + project-pattern: '{project}' + branches: + - branch-compare-type: ANT + branch-pattern: '**/{branch}' + +- job-template: + name: '{project-name}-maven-javadoc-publish-{stream}' + id: github-maven-javadoc-publish + <<: *lf_maven_common + # yamllint disable-line rule:key-duplicates + <<: *lf_maven_javadoc_publish + + properties: + - github: + url: '{git-url}/{github-org}/{project}' + + scm: + - lf-infra-github-scm: + url: '{git-clone-url}{github-org}/{project}' + refspec: '' + branch: '{branch}' + submodule-recursive: '{submodule-recursive}' + choosing-strategy: default + jenkins-ssh-credential: '{jenkins-ssh-credential}' + + triggers: + - github + - pollscm: + cron: '' + - lf-infra-github-pr-trigger: + trigger-phrase: '^remerge$' + only-trigger-phrase: true + status-context: 'JJB Merge' + 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}' + +######################## +# Maven Javadoc Verify # +######################## + +- lf_maven_javadoc_verify: &lf_maven_javadoc_verify + name: lf-maven-javadoc-verify + + # Produces javadocs for a Maven project. + # + # Expects javadocs to be available in $WORKSPACE/target/site/apidocs # # Required parameters: # build-node: The node to run build on. @@ -122,21 +340,31 @@ # be configured in defaults.yaml) # mvn-settings: The name of settings file containing credentials for # the project. - # staging-profile-id: Profile ID of the project's Nexus staging profile. # # Optional parameters: - # mvn-global-settings: The name of the Maven global settings to use for - # Maven configuration. (default: global-settings) - - project-type: freestyle - node: '{build-node}' - jdk: '{java-version}' + # + # :branch: The branch to build against. (default: master) + # :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7) + # :build-timeout: Timeout in seconds before aborting build. (default: 60) + # :deploy-path: The path in Nexus to deploy javadoc to. (default: $PROJECT/$STREAM) + # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT) + # :java-version: Version of Java to use for the build. (default: openjdk8) + # :mvn-global-settings: The name of the Maven global settings to use for + # Maven configuration. (default: global-settings) + # :mvn-opts: Sets MAVEN_OPTS. (default: '') + # :mvn-params: Additional mvn parameters to pass to the cli. (default: '') + # :mvn-version: Version of maven to use. (default: mvn33) + # :submodule-recursive: Whether to checkout submodules recursively. + # (default: true) + # + # :gerrit_verify_triggers: Override Gerrit Triggers. ###################### # Default parameters # ###################### branch: master + build-days-to-keep: 30 # 30 days in case a release takes long to get approved. build-timeout: 30 git-url: '$GIT_URL/$PROJECT' java-version: openjdk8 @@ -144,34 +372,149 @@ mvn-opts: '' mvn-params: '' mvn-version: mvn33 + staging-profile-id: '' # Unused by the javadoc jobs 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: recheck$ + ##################### # Job Configuration # ##################### + builders: + - lf-maven-install: + mvn-version: '{mvn-version}' + - lf-provide-maven-settings: + global-settings-file: '{mvn-global-settings}' + settings-file: '{mvn-settings}' + - shell: !include-raw-escape: + - ../shell/common-variables.sh + - ../shell/maven-javadoc-generate.sh + - lf-provide-maven-settings-cleanup + +- job-template: + name: '{project-name}-maven-javadoc-verify-{stream}' + id: gerrit-maven-javadoc-verify + <<: *lf_maven_common + # yamllint disable-line rule:key-duplicates + <<: *lf_maven_javadoc_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}' + +- job-template: + name: '{project-name}-maven-javadoc-verify-{stream}' + id: github-maven-javadoc-verify + <<: *lf_maven_common + # yamllint disable-line rule:key-duplicates + <<: *lf_maven_javadoc_verify + properties: - - lf-infra-properties: - # Keep around for 30 days in case a release takes long to get approved. - build-days-to-keep: 30 + - github: + url: '{git-url}/{github-org}/{project}' - parameters: - - lf-infra-parameters: - project: '{project}' + scm: + - lf-infra-github-scm: + url: '{git-clone-url}{github-org}/{project}' + refspec: '+refs/pull/*:refs/remotes/origin/pr/*' branch: '{branch}' - stream: '{stream}' - - lf-infra-maven-parameters: - mvn-opts: '{mvn-opts}' - mvn-params: '{mvn-params}' - mvn-version: '{mvn-version}' - staging-profile-id: '{staging-profile-id}' - - wrappers: - - lf-infra-wrappers: - build-timeout: '{build-timeout}' + submodule-recursive: '{submodule-recursive}' + choosing-strategy: default jenkins-ssh-credential: '{jenkins-ssh-credential}' + triggers: + - lf-infra-github-pr-trigger: + trigger-phrase: '^recheck$' + only-trigger-phrase: true + status-context: 'Maven Javadoc' + permit-all: true + github-hooks: true + github-org: '' + github_pr_whitelist: + - '' + github_pr_admin_list: + - '' + +################# +# Maven Release # +################# + +- lf_maven_release: &lf_maven_release + name: lf-maven-release + + # Produces a release candidate by creating a staging repo in Nexus. + # + # Runs a Maven build and deploys to $WORKSPACE/m2repo directory. This + # directory can then be reused later to deploy to Nexus. + # + # Required parameters: + # :build-node: The node to run build on. + # :jenkins-ssh-credential: Credential to use for SSH. (Generally should + # be configured in defaults.yaml) + # :mvn-settings: The name of settings file containing credentials for + # the project. + # :mvn-staging-id: Maven Server ID from settings.xml to pull credentials from. + # (Note: This setting should be configured in defaults.yaml.) + # :staging-profile-id: Profile ID of the project's Nexus staging profile. + # + # Optional parameters: + # :gerrit_verify_triggers: Override Gerrit Triggers. + # :mvn-global-settings: The name of the Maven global settings to use for + # Maven configuration. (default: global-settings) + # :cron: Cron schedule when to trigger the job. This parameter also + # supports multiline input via YAML pipe | character in cases where + # one may want to provide more than 1 cron timer. (default: '') + + ###################### + # Default parameters # + ###################### + + branch: master + build-days-to-keep: 30 # 30 days in case a release takes long to get approved. + build-timeout: 30 + git-url: '$GIT_URL/$PROJECT' + java-version: openjdk8 + mvn-global-settings: global-settings + mvn-opts: '' + mvn-params: '' + mvn-version: mvn33 + stream: master + submodule-recursive: true + cron: '' + + gerrit_release_triggers: + - comment-added-contains-event: + comment-contains-value: build release$ + + ##################### + # Job Configuration # + ##################### + builders: - lf-jacoco-nojava-workaround - lf-maven-install: @@ -180,7 +523,7 @@ global-settings-file: '{mvn-global-settings}' settings-file: '{mvn-settings}' - lf-infra-create-netrc: - server-id: opendaylight-staging + server-id: '{mvn-staging-id}' - shell: !include-raw-escape: - ../shell/lftools-install.sh - ../shell/common-variables.sh @@ -189,36 +532,198 @@ - ../shell/maven-stage.sh - lf-provide-maven-settings-cleanup +- job-template: + name: '{project-name}-maven-release-{stream}' + id: gerrit-maven-release + <<: *lf_maven_common + # yamllint disable-line rule:key-duplicates + <<: *lf_maven_release + + 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 + + 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-release-{stream}' + id: github-maven-release + <<: *lf_maven_common + # yamllint disable-line rule:key-duplicates + <<: *lf_maven_release + + properties: + - github: + url: '{git-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}' + choosing-strategy: default + jenkins-ssh-credential: '{jenkins-ssh-credential}' + + triggers: + - timed: '{obj:cron}' + - lf-infra-github-pr-trigger: + 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 # +############### + +- lf_maven_sonar: &lf_maven_sonar + name: lf-maven-sonar + + # Sonar job which runs mvn clean install then publishes to Sonar. + # + # This job purposely only runs on the master branch as there are Additional + # configuration needed to support multiple branches and there's not much + # interest in that kind of support. + # + # Required parameters: + # + # :build-node: The node to run build on. + # :jenkins-ssh-credential: Credential to use for SSH. (Generally should + # be configured in defaults.yaml) + # :mvn-settings: The name of settings file containing credentials for + # the project. + # + # Optional parameters: + # + # :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7) + # :build-timeout: Timeout in seconds before aborting build. (default: 60) + # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT) + # :java-version: Version of Java to use for the build. (default: openjdk8) + # :mvn-global-settings: The name of the Maven global settings to use for + # Maven configuration. (default: global-settings) + # :mvn-opts: Sets MAVEN_OPTS. (default: '') + # :mvn-params: Additional mvn parameters to pass to the cli. (default: '') + # :mvn-version: Version of maven to use. (default: mvn33) + # :submodule-recursive: Whether to checkout submodules recursively. + # (default: true) + # + # :gerrit_sonar_triggers: Override Gerrit Triggers. + + ###################### + # Default parameters # + ###################### + + branch: master # Sonar should always be run on master branch + build-days-to-keep: 7 + build-timeout: 30 + git-url: '$GIT_URL/$PROJECT' + java-version: openjdk8 + mvn-global-settings: global-settings + mvn-opts: '' + mvn-params: '' + mvn-version: mvn33 + staging-profile-id: '' # Unused in this job + stream: master + submodule-recursive: true + + gerrit_sonar_triggers: + - comment-added-contains-event: + comment-contains-value: run-sonar$ + + ##################### + # Job Configuration # + ##################### + + triggers: + - timed: 'H H * * 6' + - 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: + mvn-settings: '{mvn-settings}' + mvn-version: '{mvn-version}' + publishers: - # TODO: Make email notification work. - # - lf-infra-email-notify: - # email-recipients: '{email-recipients}' - # email-prefix: '[releng]' + - lf-jacoco-report + - findbugs - lf-infra-publish - -################# -# Job Templates # -################# +- builder: + name: lf-infra-maven-sonar + # Run a Sonar build with Maven + builders: + - lf-maven-install: + 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 + - 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}-maven-clm-{stream}' - id: gerrit-maven-clm - <<: *lf_maven_clm + 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' + refspec: $GERRIT_REFSPEC + branch: $GERRIT_BRANCH submodule-recursive: '{submodule-recursive}' choosing-strategy: default - job-template: - name: '{project-name}-maven-clm-{stream}' - id: github-maven-clm - <<: *lf_maven_clm + name: '{project-name}-sonar' + id: github-maven-sonar + <<: *lf_maven_common + # yamllint disable-line rule:key-duplicates + <<: *lf_maven_sonar properties: - github: @@ -233,10 +738,116 @@ choosing-strategy: default jenkins-ssh-credential: '{jenkins-ssh-credential}' + triggers: + - lf-infra-github-pr-trigger: + 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: + - '' + +################ +# Maven Verify # +################ + +- lf_maven_verify: &lf_maven_verify + name: lf-maven-verify + + # Verify job which runs mvn clean install to test a project build.. + # + # Required parameters: + # + # :build-node: The node to run build on. + # :jenkins-ssh-credential: Credential to use for SSH. (Generally should + # be configured in defaults.yaml) + # :mvn-settings: The name of settings file containing credentials for + # the project. + # + # Optional parameters: + # + # :branch: Git branch to fetch for the build. (default: master) + # :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7) + # :build-timeout: Timeout in seconds before aborting build. (default: 60) + # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT) + # :java-version: Version of Java to use for the build. (default: openjdk8) + # :mvn-global-settings: The name of the Maven global settings to use for + # Maven configuration. (default: global-settings) + # :mvn-opts: Sets MAVEN_OPTS. (default: '') + # :mvn-params: Additional mvn parameters to pass to the cli. (default: '') + # :mvn-version: Version of maven to use. (default: mvn33) + # :stream: Keyword that can be used to represent a release code-name. + # Often the same as the branch. (default: master) + # :submodule-recursive: Whether to checkout submodules recursively. + # (default: true) + # + # :gerrit_verify_triggers: Override Gerrit Triggers. + # :gerrit_trigger_file_paths: Override file paths which can be used to + # filter which file modifications will trigger a build. + + ###################### + # Default parameters # + ###################### + + branch: master + build-days-to-keep: 7 + build-timeout: 60 + git-url: '$GIT_URL/$PROJECT' + java-version: openjdk8 + mvn-global-settings: global-settings + mvn-opts: '' + mvn-params: '-Dstream=$STREAM' + mvn-version: mvn33 + staging-profile-id: '' # Unused in this job + 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: recheck$ + 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-provide-maven-settings: + global-settings-file: '{mvn-global-settings}' + settings-file: '{mvn-settings}' + - shell: !include-raw-escape: + - ../shell/lftools-install.sh + - ../shell/common-variables.sh + - ../shell/maven-build.sh + - lf-provide-maven-settings-cleanup + + publishers: + - findbugs + - lf-jacoco-report + - lf-infra-publish + - job-template: - name: '{project-name}-maven-release-{stream}' - id: gerrit-maven-release - <<: *lf_maven_release + 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: @@ -245,12 +856,26 @@ refspec: '$GERRIT_REFSPEC' branch: '$GERRIT_BRANCH' submodule-recursive: '{submodule-recursive}' - choosing-strategy: default + 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-release-{stream}' - id: github-maven-release - <<: *lf_maven_release + 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: - github: @@ -264,3 +889,16 @@ submodule-recursive: '{submodule-recursive}' choosing-strategy: default jenkins-ssh-credential: '{jenkins-ssh-credential}' + + triggers: + - lf-infra-github-pr-trigger: + 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: + - ''