+ 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}"
+ - bool:
+ name: MAVEN_VERSIONS_PLUGIN
+ default: "{maven-versions-plugin}"
+ description: Use maven-versions-plugin to update pom versions.
+ - 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.
+ - string:
+ name: SBOM_GENERATOR_VERSION
+ default: "{sbom-generator-version}"
+ description: SBOM generator version to download and run.
+ - string:
+ name: SBOM_PATH
+ default: "{sbom-path}"
+ description: path where SBOM needs to be executed.
+
+ 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-maven-versions-plugin:
+ maven-versions-plugin: "{maven-versions-plugin}"
+ version-properties-file: "{version-properties-file}"
+ mvn-version: "{mvn-version}"
+ mvn-pom: "{mvn-pom}"
+ mvn-settings: "{mvn-settings}"
+ - shell: !include-raw-escape: ../shell/maven-patch-release.sh
+ - lf-maven-build:
+ mvn-goals: "{mvn-goals}"
+ # With SBOM Generator
+ - conditional-step:
+ condition-kind: boolean-expression
+ condition-expression: "{sbom-generator}"
+ steps:
+ - shell: echo 'Running SBOM Generator'
+ - lf-infra-maven-sbom-generator:
+ sbom-flags: "{sbom-flags}"
+ - lf-sigul-sign-dir:
+ sign-artifacts: "{sign-artifacts}"
+ sign-dir: "$WORKSPACE/m2repo"
+ sign-mode: "{sign-mode}"
+ - 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-stage-{stream}"
+ id: gerrit-maven-stage
+ <<: *lf_maven_common
+ # yamllint disable-line rule:key-duplicates
+ <<: *lf_maven_stage
+
+ 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}"
+ submodule-timeout: "{submodule-timeout}"
+ submodule-disable: "{submodule-disable}"
+ 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}"
+ file-paths: "{obj:gerrit_trigger_file_paths}"
+
+- job-template:
+ name: "{project-name}-maven-stage-{stream}"
+ id: github-maven-stage
+ <<: *lf_maven_common
+ # yamllint disable-line rule:key-duplicates
+ <<: *lf_maven_stage
+
+ properties:
+ - lf-infra-properties:
+ build-days-to-keep: "{build-days-to-keep}"
+ - github:
+ 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}"
+ submodule-recursive: "{submodule-recursive}"
+ submodule-timeout: "{submodule-timeout}"
+ submodule-disable: "{submodule-disable}"
+ choosing-strategy: default
+ jenkins-ssh-credential: "{jenkins-ssh-credential}"
+
+ triggers:
+ - timed: "{obj:cron}"
+ - github-pull-request:
+ trigger-phrase: "^stage-(maven-)?release$"
+ only-trigger-phrase: true
+ status-context: "Maven Release"
+ permit-all: true
+ github-hooks: true
+ white-list-target-branches:
+ - "{branch}"
+ included-regions: "{obj:github_included_regions}"
+
+##########################
+# Maven Stage for Docker #
+##########################
+
+- _lf_maven_docker_stage: &lf_maven_docker_stage
+ name: lf-maven-docker-stage
+
+ 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-infra-docker-login:
+ global-settings-file: "{mvn-global-settings}"
+ settings-file: "{mvn-settings}"
+ # must provide maven settings AFTER docker-login due to its cleanup
+ - lf-provide-maven-settings:
+ global-settings-file: "{mvn-global-settings}"
+ settings-file: "{mvn-settings}"
+ - lf-maven-versions-plugin:
+ maven-versions-plugin: "{maven-versions-plugin}"
+ version-properties-file: "{version-properties-file}"
+ mvn-version: "{mvn-version}"
+ mvn-pom: "{mvn-pom}"
+ mvn-settings: "{mvn-settings}"
+ - shell: !include-raw-escape: ../shell/maven-patch-release.sh
+ - inject:
+ properties-content: |
+ CONTAINER_PULL_REGISTRY={container-public-registry}
+ CONTAINER_PUSH_REGISTRY={container-staging-registry}
+ - lf-maven-build:
+ mvn-goals: "{mvn-goals}"
+ - lf-sigul-sign-dir:
+ sign-artifacts: "{sign-artifacts}"
+ sign-dir: "$WORKSPACE/m2repo"
+ sign-mode: "{sign-mode}"
+ # NO lf-maven-stage
+ # NO lf-maven-central
+ - lf-provide-maven-settings-cleanup
+
+ gerrit_release_docker_triggers:
+ - comment-added-contains-event:
+ comment-contains-value: '^Patch Set\s+\d+:\s+stage-(docker-)?release\s*$'
+
+- job-template:
+ name: "{project-name}-maven-docker-stage-{stream}"
+ id: gerrit-maven-docker-stage
+ <<: *lf_maven_common
+ # yamllint disable-line rule:key-duplicates
+ <<: *lf_maven_stage
+ # yamllint disable-line rule:key-duplicates
+ <<: *lf_maven_docker_stage
+
+ 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}"
+ submodule-timeout: "{submodule-timeout}"
+ submodule-disable: "{submodule-disable}"
+ choosing-strategy: default
+
+ triggers:
+ - timed: "{obj:cron}"
+ - gerrit:
+ server-name: "{gerrit-server-name}"
+ trigger-on: "{obj:gerrit_release_docker_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-docker-stage-{stream}"
+ id: github-maven-docker-stage
+ <<: *lf_maven_common
+ # yamllint disable-line rule:key-duplicates
+ <<: *lf_maven_stage
+ # yamllint disable-line rule:key-duplicates
+ <<: *lf_maven_docker_stage
+
+ properties:
+ - lf-infra-properties:
+ build-days-to-keep: "{build-days-to-keep}"
+ - github:
+ 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}"
+ submodule-recursive: "{submodule-recursive}"
+ submodule-timeout: "{submodule-timeout}"
+ submodule-disable: "{submodule-disable}"
+ choosing-strategy: default
+ jenkins-ssh-credential: "{jenkins-ssh-credential}"
+
+ triggers:
+ - timed: "{obj:cron}"
+ - github-pull-request:
+ trigger-phrase: "^stage-(docker-)?release$"
+ only-trigger-phrase: true
+ status-context: "Maven Release"
+ permit-all: true
+ github-hooks: true
+ white-list-target-branches:
+ - "{branch}"
+ included-regions: "{obj:github_included_regions}"
+
+###############
+# Maven Sonar #
+###############
+
+- _lf_maven_sonar: &lf_maven_sonar
+ name: lf-maven-sonar
+
+ ######################
+ # Default parameters #
+ ######################
+
+ branch: master # Sonar should always be run on master branch
+ build-days-to-keep: 7
+ build-timeout: 60
+ cron: "H H * * 6" # run weekly
+ disable-job: false
+ git-url: "$GIT_URL/$PROJECT"
+ github-url: "https://github.com"
+ java-version: openjdk11
+ java-opts: ""
+ mvn-global-settings: global-settings
+ mvn-goals: clean install
+ mvn-opts: ""
+ mvn-params: ""
+ mvn-version: mvn35
+ sonar-mvn-goal: "sonar:sonar"
+ sonarcloud: false
+ sonarcloud-project-key: ""
+ sonarcloud-project-organization: ""
+ sonarcloud-api-token-cred-id: sonarcloud-api-token
+ sonarcloud-qualitygate-wait: false
+ # SonarCloud scan using jdk8 will become deprecated by Oct, 2020
+ # Projects not compatible with jdk11 can set java-version to something else
+ sonarcloud-java-version: openjdk11
+ stream: master
+ submodule-recursive: true
+ submodule-timeout: 10
+ submodule-disable: false
+ scan-dev-branch: false
+
+ gerrit_sonar_triggers:
+ - comment-added-contains-event:
+ comment-contains-value: '^Patch Set\s+\d+:\s+run-sonar\s*$'
+
+ #####################
+ # 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: JAVA_OPTS
+ default: "{java-opts}"
+ description: |
+ Java options. Example: -Xmx1024m
+ - 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".
+
+ wrappers:
+ - credentials-binding:
+ - text:
+ credential-id: "{sonarcloud-api-token-cred-id}"
+ variable: API_TOKEN
+
+ triggers:
+ - timed: "{obj:cron}"
+ - gerrit:
+ server-name: "{gerrit-server-name}"
+ trigger-on: "{obj:gerrit_sonar_triggers}"