X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=jjb%2Flf-maven-jobs.yaml;h=f1fc74a96b41a5a13c6e9dc45eb1d30121e5115b;hb=687da407d7dd30b7d6414c6cca4038f17f8bc69b;hp=82816c82e258a9a5cb75dcc3cde951d52629d858;hpb=4e9d92dee3965172059e95228f865190a60363ac;p=releng%2Fglobal-jjb.git diff --git a/jjb/lf-maven-jobs.yaml b/jjb/lf-maven-jobs.yaml index 82816c82..f1fc74a9 100644 --- a/jjb/lf-maven-jobs.yaml +++ b/jjb/lf-maven-jobs.yaml @@ -22,184 +22,111 @@ - github-maven-release #################### -# Anchors & Macros # +# COMMON FUNCTIONS # #################### -- 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) - # 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. +- lf_maven_common: &lf_maven_common + name: lf-maven-common project-type: freestyle node: '{build-node}' jdk: '{java-version}' - ###################### - # Default parameters # - ###################### - - branch: master - build-timeout: 15 - git-url: '$GIT_URL/$PROJECT' - global-settings-file: global-settings - java-version: openjdk8 - mvn-opts: '' - mvn-params: '' - mvn-version: mvn33 - stream: master - submodule-recursive: true - - ##################### - # Job Configuration # - ##################### - properties: - lf-infra-properties: - # Keep around for 30 days for troubleshooting purposes. - build-days-to-keep: 30 + 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: '{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' - - builders: - - lf-maven-install: - mvn-version: '{mvn-version}' - - lf-provide-maven-settings: - global-settings-file: '{global-settings-file}' - settings-file: '{settings-file}' - - shell: !include-raw-escape: - - ../shell/lftools-install.sh - - ../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}' - publishers: + # TODO: Make email notification work. + # - lf-infra-email-notify: + # email-recipients: '{email-recipients}' + # email-prefix: '[releng]' - lf-infra-publish -- lf_maven_release: &lf_maven_release - name: lf-maven-release +############# +# Maven CLM # +############# - # 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. +- 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) - # 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. - # staging-profile-id: Profile ID of the project's Nexus staging profile. - - project-type: freestyle - node: '{build-node}' - jdk: '{java-version}' + # 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-timeout: 30 + build-days-to-keep: 30 # 30 days for troubleshooting purposes + build-timeout: 15 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 + # Staging repos do not make sense for CLM jobs so set it blank. + staging-profile-id: '' + ##################### # 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}' - 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}' - jenkins-ssh-credential: '{jenkins-ssh-credential}' + triggers: + # Build weekly on Saturdays + - timed: 'H H * * 6' 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}' - - lf-infra-create-netrc: - server-id: opendaylight-staging + global-settings-file: '{mvn-global-settings}' + settings-file: '{mvn-settings}' - 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/sonatype-clm.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 # -################# + - 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: @@ -214,6 +141,8 @@ - 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: @@ -229,9 +158,72 @@ choosing-strategy: default jenkins-ssh-credential: '{jenkins-ssh-credential}' +################# +# 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. + # 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) + + ###################### + # 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 + + ##################### + # 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: opendaylight-staging + - 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 + - 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: @@ -246,6 +238,8 @@ - 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: