X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=jjb%2Flf-maven-jobs.yaml;h=f20dbe97fa5396152520a3502797929be3d5680f;hb=6a3a8fd3c9430a90f3b8c0c85e7e20b8a318eb8f;hp=6d7566699aacadfb136de197e3c3cea6bc5c9152;hpb=7b53496161eb257924609d83e1cb3cea47127bd2;p=releng%2Fglobal-jjb.git diff --git a/jjb/lf-maven-jobs.yaml b/jjb/lf-maven-jobs.yaml index 6d756669..f20dbe97 100644 --- a/jjb/lf-maven-jobs.yaml +++ b/jjb/lf-maven-jobs.yaml @@ -1,50 +1,52 @@ --- # This file contains job templates for Maven projects. -- job-group: - name: '{project-name}-maven-jobs' +########## +# Macros # +########## - # This job group contains all the recommended jobs that should be deployed - # for any project ci. - - # TODO: Add Maven Merge job to this list once it's been fully tested. - jobs: - - gerrit-maven-clm - - gerrit-maven-release - - gerrit-maven-verify - - gerrit-maven-verify-dependencies - -- job-group: - name: '{project-name}-github-maven-jobs' - - # This job group contains all the recommended jobs that should be deployed - # for any project ci that is using github. - - # TODO: Add Maven Merge job to this list once it's been fully tested. - 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 +- builder: + name: lf-maven-build + builders: + - inject: + properties-content: 'MAVEN_GOALS={mvn-goals}' + - shell: !include-raw-escape: + - ../shell/common-variables.sh + - ../shell/maven-build.sh -- job-group: - name: '{project-name}-github-maven-javadoc-jobs' +- builder: + name: lf-maven-deploy + builders: + - shell: !include-raw: + - ../shell/common-variables.sh + - ../shell/maven-deploy.sh - # This job group contains all the recommended jobs that should be deployed - # for any project ci. +- builder: + name: lf-maven-stage + builders: + - lf-provide-maven-settings: + global-settings-file: '{mvn-global-settings}' + settings-file: '{mvn-settings}' + - lf-infra-create-netrc: + server-id: '{mvn-staging-id}' + # include-raw-escape fails due to JJB bug + - shell: !include-raw-escape: + - ../shell/common-variables.sh + - ../shell/maven-stage.sh + - lf-provide-maven-settings-cleanup - jobs: - - github-maven-javadoc-publish - - github-maven-javadoc-verify +- builder: + name: lf-update-java-alternatives + builders: + - inject: + # Work around inject plugin overriding our GIT_URL variable incorrectly + # https://issues.jenkins-ci.org/browse/JENKINS-49775 + properties-content: | + SET_JDK_VERSION={java-version} + GIT_URL="$GIT_URL" + - shell: !include-raw-escape: ../shell/update-java-alternatives.sh + - inject: + properties-file: '/tmp/java.env' #################### # COMMON FUNCTIONS # @@ -53,9 +55,23 @@ - lf_maven_common: &lf_maven_common name: lf-maven-common + ###################### + # Default parameters # + ###################### + + archive-artifacts: > + **/*.log + **/hs_err_*.log + **/target/**/feature.xml + **/target/failsafe-reports/failsafe-summary.xml + **/target/surefire-reports/*-output.txt + + ##################### + # Job Configuration # + ##################### + project-type: freestyle node: '{build-node}' - jdk: '{java-version}' properties: - lf-infra-properties: @@ -66,13 +82,10 @@ 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}' - string: name: ARCHIVE_ARTIFACTS default: '{archive-artifacts}' @@ -101,31 +114,62 @@ # Default parameters # ###################### - archive-artifacts: '' branch: master build-days-to-keep: 30 # 30 days for troubleshooting purposes - build-timeout: 30 + build-timeout: 60 + 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: mvn33 - staging-profile-id: '' # Unused in this job + mvn-version: mvn35 + nexus-iq-namespace: '' # Recommend a trailing dash when set. Example: odl- + nexus-iq-stage: 'build' stream: master submodule-recursive: true + submodule-timeout: 10 + + nexus_iq_scan_patterns: + - '**/*.ear' + - '**/*.jar' + - '**/*.tar.gz' + - '**/*.war' + - '**/*.zip' + + gerrit_clm_triggers: + - comment-added-contains-event: + comment-contains-value: run-clm$ + + 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}' + - string: + name: ARCHIVE_ARTIFACTS + default: '{archive-artifacts}' + description: Artifacts to archive to the logs server. + - lf-clm-parameters: + nexus-iq-stage: '{nexus-iq-stage}' ##################### # Job Configuration # ##################### - triggers: - # Build weekly on Saturdays - - timed: 'H H * * 6' + disabled: '{disable-job}' builders: + - lf-infra-pre-build - 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}' @@ -134,8 +178,12 @@ - ../shell/sonatype-clm.sh - lf-provide-maven-settings-cleanup - shell: 'find . -regex ".*karaf/target" | xargs rm -rf' - - sonatype-clm: - application-name: '{project-name}' + - nexus-iq-policy-evaluator: + stage: '{nexus-iq-stage}' + application-type: 'manual' + application-id: '{nexus-iq-namespace}{project-name}' + scan-patterns: '{obj:nexus_iq_scan_patterns}' + fail-build-network-error: true - job-template: name: '{project-name}-maven-clm-{stream}' @@ -151,8 +199,27 @@ refspec: '$GERRIT_REFSPEC' branch: '$GERRIT_BRANCH' submodule-recursive: '{submodule-recursive}' + submodule-timeout: '{submodule-timeout}' 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 @@ -161,8 +228,10 @@ <<: *lf_maven_clm properties: + - lf-infra-properties: + build-days-to-keep: '{build-days-to-keep}' - github: - url: '{git-url}/{github-org}/{project}' + url: '{github-url}/{github-org}/{project}' scm: - lf-infra-github-scm: @@ -170,9 +239,26 @@ refspec: '' branch: 'refs/heads/{branch}' submodule-recursive: '{submodule-recursive}' + submodule-timeout: '{submodule-timeout}' choosing-strategy: default jenkins-ssh-credential: '{jenkins-ssh-credential}' + triggers: + # Build weekly on Saturdays + - timed: 'H H * * 6' + - github-pull-request: + trigger-phrase: '^run-clm$' + only-trigger-phrase: true + status-context: 'CLM' + permit-all: true + github-hooks: true + org-list: + - '{github-org}' + white-list: '{obj:github_pr_whitelist}' + admin-list: '{obj:github_pr_admin_list}' + white-list-target-branches: + - '{branch}' + ######################### # Maven Javadoc Publish # ######################### @@ -184,19 +270,20 @@ # Default parameters # ###################### - archive-artifacts: '' branch: master build-days-to-keep: 30 # 30 days in case a release takes long to get approved. - build-timeout: 30 + build-timeout: 60 + 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: mvn33 - staging-profile-id: '' # Unused by the javadoc jobs + mvn-version: mvn35 stream: master submodule-recursive: true + submodule-timeout: 10 gerrit_merge_triggers: - change-merged-event @@ -207,9 +294,14 @@ # Job Configuration # ##################### + disabled: '{disable-job}' + builders: + - lf-infra-pre-build - 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}' @@ -220,12 +312,11 @@ - 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}' + name: '{project-name}-maven-javadoc-publish-{stream}-{java-version}' id: gerrit-maven-javadoc-publish <<: *lf_maven_common # yamllint disable-line rule:key-duplicates @@ -239,6 +330,7 @@ refspec: '' branch: '{branch}' submodule-recursive: '{submodule-recursive}' + submodule-timeout: '{submodule-timeout}' choosing-strategy: default jenkins-ssh-credential: '{jenkins-ssh-credential}' @@ -254,15 +346,17 @@ branch-pattern: '**/{branch}' - job-template: - name: '{project-name}-maven-javadoc-publish-{stream}' + name: '{project-name}-maven-javadoc-publish-{stream}-{java-version}' id: github-maven-javadoc-publish <<: *lf_maven_common # yamllint disable-line rule:key-duplicates <<: *lf_maven_javadoc_publish properties: + - lf-infra-properties: + build-days-to-keep: '{build-days-to-keep}' - github: - url: '{git-url}/{github-org}/{project}' + url: '{github-url}/{github-org}/{project}' scm: - lf-infra-github-scm: @@ -270,6 +364,7 @@ refspec: '' branch: '{branch}' submodule-recursive: '{submodule-recursive}' + submodule-timeout: '{submodule-timeout}' choosing-strategy: default jenkins-ssh-credential: '{jenkins-ssh-credential}' @@ -277,15 +372,18 @@ - github - pollscm: cron: '' - - lf-infra-github-pr-trigger: + - github-pull-request: trigger-phrase: '^remerge$' only-trigger-phrase: true - status-context: 'JJB Merge' - permit-all: false + status-context: 'Maven Javadoc Publish' + permit-all: true 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}' + white-list-target-branches: + - '{branch}' ######################## # Maven Javadoc Verify # @@ -298,19 +396,20 @@ # Default parameters # ###################### - archive-artifacts: '' branch: master build-days-to-keep: 30 # 30 days in case a release takes long to get approved. - build-timeout: 30 + build-timeout: 60 + 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: mvn33 - staging-profile-id: '' # Unused by the javadoc jobs + mvn-version: mvn35 stream: master submodule-recursive: true + submodule-timeout: 10 gerrit_verify_triggers: - patchset-created-event: @@ -319,17 +418,21 @@ exclude-no-code-change: false - draft-published-event - comment-added-contains-event: - comment-contains-value: recheck$ + comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$' ##################### # Job Configuration # ##################### concurrent: true + disabled: '{disable-job}' builders: + - lf-infra-pre-build - 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}' @@ -339,7 +442,7 @@ - lf-provide-maven-settings-cleanup - job-template: - name: '{project-name}-maven-javadoc-verify-{stream}' + name: '{project-name}-maven-javadoc-verify-{stream}-{java-version}' id: gerrit-maven-javadoc-verify <<: *lf_maven_common # yamllint disable-line rule:key-duplicates @@ -352,6 +455,7 @@ refspec: '$GERRIT_REFSPEC' branch: '$GERRIT_BRANCH' submodule-recursive: '{submodule-recursive}' + submodule-timeout: '{submodule-timeout}' choosing-strategy: gerrit triggers: @@ -366,15 +470,17 @@ branch-pattern: '**/{branch}' - job-template: - name: '{project-name}-maven-javadoc-verify-{stream}' + name: '{project-name}-maven-javadoc-verify-{stream}-{java-version}' id: github-maven-javadoc-verify <<: *lf_maven_common # yamllint disable-line rule:key-duplicates <<: *lf_maven_javadoc_verify properties: + - lf-infra-properties: + build-days-to-keep: '{build-days-to-keep}' - github: - url: '{git-url}/{github-org}/{project}' + url: '{github-url}/{github-org}/{project}' scm: - lf-infra-github-scm: @@ -382,21 +488,19 @@ refspec: '+refs/pull/*:refs/remotes/origin/pr/*' branch: '$sha1' submodule-recursive: '{submodule-recursive}' + submodule-timeout: '{submodule-timeout}' 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' + - github-pull-request: + trigger-phrase: ^(recheck|reverify)$ + only-trigger-phrase: false + status-context: 'Maven Javadoc Verify' permit-all: true github-hooks: true - github-org: '' - github_pr_whitelist: - - '' - github_pr_admin_list: - - '' + white-list-target-branches: + - '{branch}' ############### # Maven Merge # @@ -409,21 +513,23 @@ # Default parameters # ###################### - archive-artifacts: '' branch: master build-days-to-keep: 30 # 30 days in case we need to troubleshoot - build-timeout: 30 - cron: '' + build-timeout: 60 + cron: '@daily' + disable-job: false 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: '-Dmerge' - mvn-version: mvn33 + mvn-version: mvn35 nexus-cut-dirs: 6 # Number of dirs in the Nexus path to remove for wget -r. - staging-profile-id: '' # Unused by this job. stream: master submodule-recursive: true + submodule-timeout: 10 gerrit_merge_triggers: - change-merged-event @@ -431,8 +537,12 @@ 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: '' @@ -440,10 +550,15 @@ # Job Configuration # ##################### + disabled: '{disable-job}' + builders: + - lf-infra-pre-build - 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}' @@ -453,12 +568,10 @@ properties-content: | NEXUS_CUT_DIRS={nexus-cut-dirs} NEXUS_REPO={nexus-snapshot-repo} - - shell: !include-raw-escape: - - ../shell/lftools-install.sh - - ../shell/common-variables.sh - - ../shell/maven-fetch-metadata.sh - - ../shell/maven-build.sh - - ../shell/maven-deploy.sh + - shell: !include-raw-escape: ../shell/maven-fetch-metadata.sh + - lf-maven-build: + mvn-goals: '{mvn-goals}' + - lf-maven-deploy - lf-provide-maven-settings-cleanup publishers: @@ -481,10 +594,11 @@ refspec: '$GERRIT_REFSPEC' branch: '$GERRIT_BRANCH' submodule-recursive: '{submodule-recursive}' + submodule-timeout: '{submodule-timeout}' choosing-strategy: default triggers: - - timed: 'H H * * 0' + - timed: '{obj:cron}' - gerrit: server-name: '{gerrit-server-name}' trigger-on: '{obj:gerrit_merge_triggers}' @@ -504,87 +618,133 @@ <<: *lf_maven_merge properties: + - lf-infra-properties: + build-days-to-keep: '{build-days-to-keep}' - github: - url: '{git-url}/{github-org}/{project}' + 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}' + refspec: '' + branch: 'refs/heads/{branch}' submodule-recursive: '{submodule-recursive}' + submodule-timeout: '{submodule-timeout}' choosing-strategy: default jenkins-ssh-credential: '{jenkins-ssh-credential}' triggers: - - lf-infra-github-pr-trigger: + - timed: '{obj:cron}' + - github + - pollscm: + cron: '' + - github-pull-request: trigger-phrase: '^remerge$' - only-trigger-phrase: false + only-trigger-phrase: true status-context: 'Maven Merge' 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}' + white-list-target-branches: + - '{branch}' + included-regions: '{obj:github_included_regions}' -################# -# Maven Release # -################# +############### +# Maven Stage # +############### -- lf_maven_release: &lf_maven_release - name: lf-maven-release +- lf_maven_stage: &lf_maven_stage + name: lf-maven-stage ###################### # Default parameters # ###################### - archive-artifacts: '' branch: master build-days-to-keep: 30 # 30 days in case a release takes long to get approved. - build-timeout: 30 - cron: '' + build-timeout: 60 + cron: '@daily' + disable-job: false git-url: '$GIT_URL/$PROJECT' + github-url: 'https://github.com' java-version: openjdk8 + mvn-central: false mvn-global-settings: global-settings + mvn-goals: clean deploy mvn-opts: '' mvn-params: '' - mvn-version: mvn33 + mvn-version: mvn35 + ossrh-profile-id: '' + sign-artifacts: false stream: master submodule-recursive: true + submodule-timeout: 10 gerrit_release_triggers: - comment-added-contains-event: - comment-contains-value: build release$ + comment-contains-value: stage-release$ ##################### # Job Configuration # ##################### + disabled: '{disable-job}' + + 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-profile-id: '{staging-profile-id}' + - string: + name: ARCHIVE_ARTIFACTS + default: '{archive-artifacts}' + description: Artifacts to archive to the logs server. + - string: + name: STAGING_PROFILE_ID + default: '{staging-profile-id}' + description: Nexus staging profile ID. + builders: + - lf-infra-pre-build - 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-infra-create-netrc: - server-id: '{mvn-staging-id}' - - shell: !include-raw-escape: - - ../shell/lftools-install.sh - - ../shell/common-variables.sh - - ../shell/maven-patch-release.sh - - ../shell/maven-build.sh - - ../shell/maven-stage.sh + - shell: !include-raw-escape: ../shell/maven-patch-release.sh + - lf-maven-build: + mvn-goals: '{mvn-goals}' + - lf-sigul-sign-dir: + sign-artifacts: '{sign-artifacts}' + sign-dir: '$WORKSPACE/m2repo' + - lf-maven-stage: + mvn-global-settings: '{mvn-global-settings}' + mvn-settings: '{mvn-settings}' + mvn-staging-id: '{mvn-staging-id}' + - lf-maven-central: + mvn-central: '{mvn-central}' + mvn-global-settings: '{mvn-global-settings}' + mvn-settings: '{mvn-settings}' + ossrh-profile-id: '{ossrh-profile-id}' - lf-provide-maven-settings-cleanup - job-template: - name: '{project-name}-maven-release-{stream}' - id: gerrit-maven-release + name: '{project-name}-maven-stage-{stream}' + id: gerrit-maven-stage <<: *lf_maven_common # yamllint disable-line rule:key-duplicates - <<: *lf_maven_release + <<: *lf_maven_stage scm: - lf-infra-gerrit-scm: @@ -593,6 +753,7 @@ refspec: '$GERRIT_REFSPEC' branch: '$GERRIT_BRANCH' submodule-recursive: '{submodule-recursive}' + submodule-timeout: '{submodule-timeout}' choosing-strategy: default triggers: @@ -608,15 +769,17 @@ branch-pattern: '**/{branch}' - job-template: - name: '{project-name}-maven-release-{stream}' - id: github-maven-release + name: '{project-name}-maven-stage-{stream}' + id: github-maven-stage <<: *lf_maven_common # yamllint disable-line rule:key-duplicates - <<: *lf_maven_release + <<: *lf_maven_stage properties: + - lf-infra-properties: + build-days-to-keep: '{build-days-to-keep}' - github: - url: '{git-url}/{github-org}/{project}' + url: '{github-url}/{github-org}/{project}' scm: - lf-infra-github-scm: @@ -624,22 +787,20 @@ 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}' - - 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: - - '' + white-list-target-branches: + - '{branch}' ############### # Maven Sonar # @@ -652,19 +813,22 @@ # Default parameters # ###################### - archive-artifacts: '' branch: master # Sonar should always be run on master branch build-days-to-keep: 7 - build-timeout: 30 + 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: mvn33 - staging-profile-id: '' # Unused in this job + mvn-version: mvn35 + sonar-mvn-goal: 'sonar:sonar' stream: master submodule-recursive: true + submodule-timeout: 10 gerrit_sonar_triggers: - comment-added-contains-event: @@ -674,8 +838,31 @@ # Job Configuration # ##################### + disabled: '{disable-job}' + + 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}' + - 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' + - timed: '{obj:cron}' - gerrit: server-name: '{gerrit-server-name}' trigger-on: '{obj:gerrit_sonar_triggers}' @@ -692,7 +879,9 @@ notbuilt: true builders: + - lf-infra-pre-build - lf-infra-maven-sonar: + java-version: '{java-version}' mvn-settings: '{mvn-settings}' mvn-version: '{mvn-version}' @@ -707,11 +896,11 @@ 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 - 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}' @@ -734,6 +923,7 @@ refspec: $GERRIT_REFSPEC branch: $GERRIT_BRANCH submodule-recursive: '{submodule-recursive}' + submodule-timeout: '{submodule-timeout}' choosing-strategy: default - job-template: @@ -744,8 +934,10 @@ <<: *lf_maven_sonar properties: + - lf-infra-properties: + build-days-to-keep: '{build-days-to-keep}' - github: - url: '{git-url}/{github-org}/{project}' + url: '{github-url}/{github-org}/{project}' scm: - lf-infra-github-scm: @@ -753,21 +945,24 @@ refspec: '+refs/pull/*:refs/remotes/origin/pr/*' branch: '$sha1' submodule-recursive: '{submodule-recursive}' + submodule-timeout: '{submodule-timeout}' 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' + - timed: '{obj:cron}' + - github-pull-request: + trigger-phrase: '^run-sonar$' + only-trigger-phrase: true + status-context: 'Maven Sonar' 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}' + white-list-target-branches: + - '{branch}' ################ # Maven Verify # @@ -780,19 +975,21 @@ # Default parameters # ###################### - archive-artifacts: '' branch: master build-days-to-keep: 7 build-timeout: 60 + disable-job: false 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: mvn33 - staging-profile-id: '' # Unused in this job + mvn-version: mvn35 stream: master submodule-recursive: true + submodule-timeout: 10 gerrit_verify_triggers: - patchset-created-event: @@ -801,28 +998,35 @@ exclude-no-code-change: false - draft-published-event - comment-added-contains-event: - comment-contains-value: recheck$ + comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$' + 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 # ##################### concurrent: true + disabled: '{disable-job}' builders: + - lf-infra-pre-build - 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 - - ../shell/common-variables.sh - - ../shell/maven-build.sh + - lf-maven-build: + mvn-goals: '{mvn-goals}' - lf-provide-maven-settings-cleanup publishers: @@ -844,6 +1048,7 @@ refspec: '$GERRIT_REFSPEC' branch: '$GERRIT_BRANCH' submodule-recursive: '{submodule-recursive}' + submodule-timeout: '{submodule-timeout}' choosing-strategy: gerrit triggers: @@ -866,8 +1071,10 @@ <<: *lf_maven_verify properties: + - lf-infra-properties: + build-days-to-keep: '{build-days-to-keep}' - github: - url: '{git-url}/{github-org}/{project}' + url: '{github-url}/{github-org}/{project}' scm: - lf-infra-github-scm: @@ -875,21 +1082,20 @@ refspec: '+refs/pull/*:refs/remotes/origin/pr/*' branch: '$sha1' submodule-recursive: '{submodule-recursive}' + submodule-timeout: '{submodule-timeout}' choosing-strategy: default jenkins-ssh-credential: '{jenkins-ssh-credential}' triggers: - - lf-infra-github-pr-trigger: - trigger-phrase: '^recheck$' + - github-pull-request: + trigger-phrase: '^(recheck|reverify)$' only-trigger-phrase: false status-context: 'Maven Verify' permit-all: true github-hooks: true - github-org: '' - github_pr_whitelist: - - '' - github_pr_admin_list: - - '' + white-list-target-branches: + - '{branch}' + included-regions: '{obj:github_included_regions}' ############################# # Maven Verify Dependencies # @@ -902,19 +1108,21 @@ # Default parameters # ###################### - archive-artifacts: '' branch: master build-days-to-keep: 7 build-timeout: 60 + disable-job: false 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: mvn33 - staging-profile-id: '' # Unused by this job + mvn-version: mvn35 stream: master submodule-recursive: true + submodule-timeout: 10 gerrit_verify_triggers: - comment-added-contains-event: @@ -928,11 +1136,15 @@ ##################### concurrent: true + disabled: '{disable-job}' builders: + - lf-infra-pre-build - 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}' @@ -940,9 +1152,8 @@ - shell: !include-raw-escape: - ../shell/common-variables.sh - ../shell/maven-build-deps.sh - - shell: !include-raw-escape: - - ../shell/common-variables.sh - - ../shell/maven-build.sh + - lf-maven-build: + mvn-goals: '{mvn-goals}' - lf-provide-maven-settings-cleanup publishers: @@ -964,6 +1175,7 @@ refspec: '$GERRIT_REFSPEC' branch: '$GERRIT_BRANCH' submodule-recursive: '{submodule-recursive}' + submodule-timeout: '{submodule-timeout}' choosing-strategy: gerrit triggers: