X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=jjb%2Flf-maven-jobs.yaml;h=41c73e7a113631b858c836c66e4e4e907ab3b30e;hb=ec0a666af4481b21b82be836011d6c94bb04e098;hp=4e8d91746dff2e5d2fddb594a2403126b5e1ef51;hpb=34ab3807fb760dea4fdfc08b1692d49a243759f1;p=releng%2Fglobal-jjb.git diff --git a/jjb/lf-maven-jobs.yaml b/jjb/lf-maven-jobs.yaml index 4e8d9174..41c73e7a 100644 --- a/jjb/lf-maven-jobs.yaml +++ b/jjb/lf-maven-jobs.yaml @@ -8,6 +8,7 @@ # for any project ci. jobs: + - gerrit-maven-clm - gerrit-maven-release - job-group: @@ -17,11 +18,149 @@ # for any project ci that is using github. jobs: + - github-maven-clm - github-maven-release #################### -# 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}' + - 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 + + # Produces a CLM scan of the code into Nexus IQ Server. + # + # 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: + # mvn-global-settings: The name of the Maven global settings to use for + # Maven configuration. (default: global-settings) + + ###################### + # 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 + mvn-global-settings: global-settings + mvn-opts: '' + mvn-params: '' + mvn-version: mvn33 + stream: master + submodule-recursive: true + + # Staging repos do not make sense for CLM jobs so set it blank. + staging-profile-id: '' + + ##################### + # Job Configuration # + ##################### + + triggers: + # Build weekly on Saturdays + - timed: 'H H * * 6' + + 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/sonatype-clm.sh + - lf-provide-maven-settings-cleanup + - shell: 'find . -regex ".*karaf/target" | xargs rm -rf' + - sonatype-clm: + application-name: '{project-name}' + +- job-template: + name: '{project-name}-maven-clm-{stream}' + id: gerrit-maven-clm + <<: *lf_maven_common + # yamllint disable-line rule:key-duplicates + <<: *lf_maven_clm + + 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}-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 Release # +################# + - lf_maven_release: &lf_maven_release name: lf-maven-release @@ -34,61 +173,41 @@ # build-node: The node to run build on. # jenkins-ssh-credential: Credential to use for SSH. (Generally should # be configured in defaults.yaml) - # settings-file: The name of settings file containing credentials for - # the project. - # global-settings-file: The name of the Maven global settings to use for - # Maven configuration. + # mvn-settings: The name of settings file containing credentials for + # the project. # staging-profile-id: Profile ID of the project's Nexus staging profile. - - project-type: freestyle - node: '{build-node}' - jdk: '{java-version}' + # + # Optional parameters: + # mvn-global-settings: The name of the Maven global settings to use for + # Maven configuration. (default: global-settings) ###################### # 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' - global-settings-file: global-settings java-version: openjdk8 + mvn-global-settings: global-settings mvn-opts: '' mvn-params: '' mvn-version: mvn33 + stream: master submodule-recursive: true ##################### # Job Configuration # ##################### - properties: - - lf-infra-properties: - # Keep around for 30 days in case a release takes long to get approved. - build-days-to-keep: 30 - - parameters: - - lf-infra-parameters: - project: '{project}' - branch: '{branch}' - - 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}' - jenkins-ssh-credential: '{jenkins-ssh-credential}' - builders: - lf-jacoco-nojava-workaround - lf-maven-install: mvn-version: '{mvn-version}' - lf-provide-maven-settings: - global-settings-file: '{global-settings-file}' - settings-file: '{settings-file}' + global-settings-file: '{mvn-global-settings}' + settings-file: '{mvn-settings}' - lf-infra-create-netrc: server-id: opendaylight-staging - shell: !include-raw-escape: @@ -99,21 +218,11 @@ - ../shell/maven-stage.sh - lf-provide-maven-settings-cleanup - publishers: - # TODO: Make email notification work. - # - lf-infra-email-notify: - # email-recipients: '{email-recipients}' - # email-prefix: '[releng]' - - lf-infra-publish - - -################# -# Job Templates # -################# - - 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: @@ -123,20 +232,22 @@ refspec: '$GERRIT_REFSPEC' branch: '$GERRIT_BRANCH' submodule-recursive: '{submodule-recursive}' - choosing-strategy: gerrit + choosing-strategy: default - 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}' + url: '{git-url}/{github-org}/{project}' scm: - lf-infra-github-scm: - url: '${{GIT_CLONE_URL}}{github-org}/{project}' + url: '{git-clone-url}{github-org}/{project}' refspec: '+refs/pull/*:refs/remotes/origin/pr/*' branch: '{branch}' submodule-recursive: '{submodule-recursive}'