X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=jjb%2Flf-maven-jobs.yaml;h=8d4d837bdebe74eac2d320e4f4a59d99ed9861e5;hb=5e403dec080850163f75cf80e0317fcf839d69aa;hp=7758fb6197e79f3ee4ae0122d631b672bd42c5ec;hpb=ddeccf5a8df0fe4478eae61099c0cd3084d02e64;p=releng%2Fglobal-jjb.git diff --git a/jjb/lf-maven-jobs.yaml b/jjb/lf-maven-jobs.yaml index 7758fb61..8d4d837b 100644 --- a/jjb/lf-maven-jobs.yaml +++ b/jjb/lf-maven-jobs.yaml @@ -7,6 +7,7 @@ # 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 @@ -19,6 +20,7 @@ # 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 @@ -102,7 +104,7 @@ archive-artifacts: '' branch: master build-days-to-keep: 30 # 30 days for troubleshooting purposes - build-timeout: 15 + build-timeout: 30 git-url: '$GIT_URL/$PROJECT' java-version: openjdk8 mvn-global-settings: global-settings @@ -165,8 +167,8 @@ 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}' choosing-strategy: default jenkins-ssh-credential: '{jenkins-ssh-credential}' @@ -378,7 +380,7 @@ - lf-infra-github-scm: url: '{git-clone-url}{github-org}/{project}' refspec: '+refs/pull/*:refs/remotes/origin/pr/*' - branch: '{branch}' + branch: '$sha1' submodule-recursive: '{submodule-recursive}' choosing-strategy: default jenkins-ssh-credential: '{jenkins-ssh-credential}' @@ -396,6 +398,137 @@ github_pr_admin_list: - '' +############### +# Maven Merge # +############### + +- lf_maven_merge: &lf_maven_merge + name: lf-maven-merge + + ###################### + # Default parameters # + ###################### + + archive-artifacts: '' + branch: master + build-days-to-keep: 30 # 30 days in case we need to troubleshoot + build-timeout: 30 + cron: '' + git-url: '$GIT_URL/$PROJECT' + java-version: openjdk8 + mvn-global-settings: global-settings + mvn-opts: '' + mvn-params: '-Dmerge' + mvn-version: mvn33 + 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 + + gerrit_merge_triggers: + - change-merged-event + - comment-added-contains-event: + comment-contains-value: remerge$ + + gerrit_trigger_file_paths: + - compare-type: ANT + pattern: '**' + + post_build_trigger: '' + + ##################### + # Job Configuration # + ##################### + + 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}' + - lf-infra-create-netrc: + server-id: '{mvn-snapshot-id}' + - inject: + 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 + - lf-provide-maven-settings-cleanup + + publishers: + - findbugs + - lf-jacoco-report + - lf-infra-publish + - trigger-parameterized-builds: '{obj:post_build_trigger}' + +- job-template: + name: '{project-name}-maven-merge-{stream}' + id: gerrit-maven-merge + <<: *lf_maven_common + # yamllint disable-line rule:key-duplicates + <<: *lf_maven_merge + + 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: 'H H * * 0' + - 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}' + file-paths: '{obj:gerrit_trigger_file_paths}' + +- job-template: + name: '{project-name}-maven-merge-{stream}' + id: github-maven-merge + <<: *lf_maven_common + # yamllint disable-line rule:key-duplicates + <<: *lf_maven_merge + + 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: + - lf-infra-github-pr-trigger: + trigger-phrase: '^remerge$' + only-trigger-phrase: false + status-context: 'Maven Merge' + permit-all: true + github-hooks: true + github-org: '' + github_pr_whitelist: + - '' + github_pr_admin_list: + - '' + ################# # Maven Release # ################# @@ -529,6 +662,7 @@ mvn-opts: '' mvn-params: '' mvn-version: mvn33 + sonar-mvn-goal: 'sonar:sonar' staging-profile-id: '' # Unused in this job stream: master submodule-recursive: true @@ -541,6 +675,30 @@ # 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: @@ -576,9 +734,7 @@ 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}' @@ -618,7 +774,7 @@ - lf-infra-github-scm: url: '{git-clone-url}{github-org}/{project}' refspec: '+refs/pull/*:refs/remotes/origin/pr/*' - branch: '{branch}' + branch: '$sha1' submodule-recursive: '{submodule-recursive}' choosing-strategy: default jenkins-ssh-credential: '{jenkins-ssh-credential}' @@ -740,7 +896,7 @@ - lf-infra-github-scm: url: '{git-clone-url}{github-org}/{project}' refspec: '+refs/pull/*:refs/remotes/origin/pr/*' - branch: '{branch}' + branch: '$sha1' submodule-recursive: '{submodule-recursive}' choosing-strategy: default jenkins-ssh-credential: '{jenkins-ssh-credential}'