X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=docs%2Fjjb%2Flf-maven-jobs.rst;h=575117e6fb2e25ec74a78dd67c19efade2aad427;hb=refs%2Fchanges%2F75%2F15375%2F1;hp=29c565ef67cf3cf6bca7da8c11c0e01e77139b23;hpb=bc80d1d2ea640dfedb2dcfa5097c5ff275c36b71;p=releng%2Fglobal-jjb.git diff --git a/docs/jjb/lf-maven-jobs.rst b/docs/jjb/lf-maven-jobs.rst index 29c565ef..575117e6 100644 --- a/docs/jjb/lf-maven-jobs.rst +++ b/docs/jjb/lf-maven-jobs.rst @@ -5,52 +5,51 @@ Maven Jobs Job Groups ========== -{project-name}-maven-jobs -------------------------- +.. include:: ../job-groups.rst -Jobs for Maven projects using Gerrit. +Below is a list of Maven job groups: -:Includes: +.. literalinclude:: ../../jjb/lf-maven-job-groups.yaml + :language: yaml - - gerrit-maven-clm - - gerrit-maven-release - - gerrit-maven-verify - - gerrit-maven-verify-dependencies -{project-name}-github-maven-jobs --------------------------------- +Macros +====== -Jobs for Maven projects using GitHub. +lf-infra-maven-sonar +-------------------- -:Includes: +Runs Sonar against a Maven project. - - github-maven-clm - - github-maven-release - - github-maven-verify +:Required Parameters: -{project-name}-maven-javadoc-jobs ---------------------------------- + :java-version: Version of Java to execute Sonar with. + :mvn-version: Version of Maven to execute Sonar with. + :mvn-settings: Maven settings.xml file containing credentials to use. -Jobs for Maven projects to generate javadoc using Gerrit. +lf-infra-maven-sonarcloud +------------------------- -:Includes: +Runs Sonar against a Maven project and pushes results to SonarCloud. - - gerrit-maven-javadoc-publish - - gerrit-maven-javadoc-verify +:Required Parameters: -{project-name}-github-maven-javadoc-jobs ----------------------------------------- + :java-version: Version of Java to execute Sonar with. + :mvn-version: Version of Maven to execute Sonar with. + :mvn-settings: Maven settings.xml file containing credentials to use. + :sonarcloud-project-key: SonarCloud project key. + :sonarcloud-project-organization: SonarCloud project organization. + :sonarcloud-api-token: SonarCloud API Token. -Jobs for Maven projects to generate javadoc using GitHub. +lf-maven-build +-------------- -:Includes: - - - github-maven-javadoc-publish - - github-maven-javadoc-verify +Calls the maven build script to perform a maven build. +:Required parameters: -Macros -====== + :mvn-goals: The maven goals to perform for the build. + (default: clean deploy) lf-maven-common --------------- @@ -62,6 +61,40 @@ lf-maven-deploy Calls the maven deploy script to push artifacts to Nexus. +lf-maven-versions-plugin +------------------------ + +Conditionally calls Maven versions plugin to set, update and commit the maven `versions:set`. + +:Required Parameters: + + :maven-versions-plugin: Whether to call Maven versions plugin or not. (default: false) + :mvn-version: Version of Maven to execute Sonar with. + :mvn-pom: Location of pom.xml. + :maven-versions-plugin-set-version: Version number to upgrade to. + :mvn-settings: Maven settings.xml file containing credentials to use. + +lf-maven-stage +--------------- + +Calls the maven stage script to push artifacts to a Nexus staging repository. + +:Required Parameters: + + :mvn-global-settings: The name of the Maven global settings to use for + Maven configuration. + :mvn-settings: The name of settings file containing credentials for the project. + +lf-update-java-alternatives +--------------------------- + +Setup Java alternatives for the Distro. + +:Required Parameters: + + :java-version: Version of Java to set as the default Java. + Eg. openjdk8 + Job Templates ============= @@ -76,6 +109,8 @@ Produces a CLM scan of the code into Nexus IQ Server. - gerrit-maven-clm - github-maven-clm +:Comment Trigger: run-clm + :Required parameters: :build-node: The node to run build on. @@ -87,18 +122,26 @@ Produces a CLM scan of the code into Nexus IQ Server. :branch: The branch to build against. (default: master) :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7) - :build-timeout: Timeout in seconds before aborting build. (default: 60) + :build-timeout: Timeout in minutes before aborting build. (default: 60) :git-url: URL clone project from. (default: $GIT_URL/$PROJECT) :java-version: Version of Java to use for the build. (default: openjdk8) :mvn-global-settings: The name of the Maven global settings to use for Maven configuration. (default: global-settings) :mvn-opts: Sets MAVEN_OPTS. (default: '') :mvn-params: Additional mvn parameters to pass to the cli. (default: '') - :mvn-version: Version of maven to use. (default: mvn33) + :mvn-version: Version of maven to use. (default: mvn35) + :nexus-iq-namespace: Insert a namespace to project AppID for projects that + share a Nexus IQ system to avoid project name collision. We recommend + inserting a trailing - dash if using this parameter. + For example 'odl-'. (default: '') + :nexus-iq-stage: Stage the policy evaluation will be run against on + the Nexus IQ Server. (default: 'build') :stream: Keyword that can be used to represent a release code-name. Often the same as the branch. (default: master) :submodule-recursive: Whether to checkout submodules recursively. (default: true) + :submodule-timeout: Timeout (in minutes) for checkout operation. + (default: 10) :gerrit_merge_triggers: Override Gerrit Triggers. @@ -111,10 +154,12 @@ Expects javadocs to be available in $WORKSPACE/target/site/apidocs :Template Names: - - {project-name}-maven-javadoc-publish-{stream} + - {project-name}-maven-javadoc-publish-{stream}-{java-version} - gerrit-maven-javadoc-publish - github-maven-javadoc-publish +:Comment Trigger: remerge + :Required parameters: :build-node: The node to run build on. @@ -129,18 +174,20 @@ Expects javadocs to be available in $WORKSPACE/target/site/apidocs :branch: The branch to build against. (default: master) :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7) - :build-timeout: Timeout in seconds before aborting build. (default: 60) + :build-timeout: Timeout in minutes before aborting build. (default: 60) :git-url: URL clone project from. (default: $GIT_URL/$PROJECT) :java-version: Version of Java to use for the build. (default: openjdk8) :mvn-global-settings: The name of the Maven global settings to use for Maven configuration. (default: global-settings) :mvn-opts: Sets MAVEN_OPTS. (default: '') :mvn-params: Additional mvn parameters to pass to the cli. (default: '') - :mvn-version: Version of maven to use. (default: mvn33) + :mvn-version: Version of maven to use. (default: mvn35) :stream: Keyword that can be used to represent a release code-name. Often the same as the branch. (default: master) :submodule-recursive: Whether to checkout submodules recursively. (default: true) + :submodule-timeout: Timeout (in minutes) for checkout operation. + (default: 10) :gerrit_merge_triggers: Override Gerrit Triggers. @@ -153,10 +200,12 @@ Expects javadocs to be available in $WORKSPACE/target/site/apidocs :Template Names: - - {project-name}-maven-javadoc-verify-{stream} + - {project-name}-maven-javadoc-verify-{stream}-{java-version} - gerrit-maven-javadoc-verify - github-maven-javadoc-verify +:Comment Trigger: recheck|reverify + :Required parameters: :build-node: The node to run build on. :jenkins-ssh-credential: Credential to use for SSH. (Generally should @@ -167,7 +216,7 @@ Expects javadocs to be available in $WORKSPACE/target/site/apidocs :branch: The branch to build against. (default: master) :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7) - :build-timeout: Timeout in seconds before aborting build. (default: 60) + :build-timeout: Timeout in minutes before aborting build. (default: 60) :deploy-path: The path in Nexus to deploy javadoc to. (default: $PROJECT/$STREAM) :git-url: URL clone project from. (default: $GIT_URL/$PROJECT) :java-version: Version of Java to use for the build. (default: openjdk8) @@ -175,11 +224,13 @@ Expects javadocs to be available in $WORKSPACE/target/site/apidocs Maven configuration. (default: global-settings) :mvn-opts: Sets MAVEN_OPTS. (default: '') :mvn-params: Additional mvn parameters to pass to the cli. (default: '') - :mvn-version: Version of maven to use. (default: mvn33) + :mvn-version: Version of maven to use. (default: mvn35) :stream: Keyword that can be used to represent a release code-name. Often the same as the branch. (default: master) :submodule-recursive: Whether to checkout submodules recursively. (default: true) + :submodule-timeout: Timeout (in minutes) for checkout operation. + (default: 10) :gerrit_verify_triggers: Override Gerrit Triggers. @@ -207,6 +258,8 @@ This job uses the following strategy to deploy jobs to Nexus: - gerrit-maven-merge - github-maven-merge +:Comment Trigger: remerge + :Required parameters: :build-node: The node to run build on. @@ -221,7 +274,7 @@ This job uses the following strategy to deploy jobs to Nexus: :branch: Git branch to fetch for the build. (default: master) :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7) - :build-timeout: Timeout in seconds before aborting build. (default: 60) + :build-timeout: Timeout in minutes before aborting build. (default: 60) :cron: Cron schedule when to trigger the job. This parameter also supports multiline input via YAML pipe | character in cases where one may want to provide more than 1 cron timer. (default: 'H H * * 0' @@ -232,30 +285,35 @@ This job uses the following strategy to deploy jobs to Nexus: Maven configuration. (default: global-settings) :mvn-opts: Sets MAVEN_OPTS. (default: '') :mvn-params: Additional mvn parameters to pass to the cli. (default: '') - :mvn-version: Version of maven to use. (default: mvn33) + :mvn-version: Version of maven to use. (default: mvn35) :nexus-cut-dirs: Number of directories to cut from file path for `wget -r`. :stream: Keyword that can be used to represent a release code-name. Often the same as the branch. (default: master) :submodule-recursive: Whether to checkout submodules recursively. (default: true) + :submodule-timeout: Timeout (in minutes) for checkout operation. + (default: 10) :gerrit_merge_triggers: Override Gerrit Triggers. :gerrit_trigger_file_paths: Override file paths which can be used to filter which file modifications will trigger a build. -Maven Release -------------- +Maven Stage +----------- 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. +The staging repo name is in the format PROJECT-NUMBER for example "aaa-1234", +"autorelease-2000", "odlparent-1201", etc... + +This job runs a Maven build and deploys to $WORKSPACE/m2repo directory. This +directory is then used later to deploy to Nexus. :Template Names: - - {project-name}-maven-release-{stream} - - gerrit-maven-release - - github-maven-release + - {project-name}-maven-stage-{stream} + - gerrit-maven-stage + - github-maven-stage :Required parameters: @@ -272,25 +330,37 @@ directory can then be reused later to deploy to Nexus. :archive-artifacts: Artifacts to archive to the logs server (default: ''). :branch: The branch to build against. (default: master) :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7) - :build-timeout: Timeout in seconds before aborting build. (default: 60) + :build-timeout: Timeout in minutes before aborting build. (default: 60) :cron: Cron schedule when to trigger the job. This parameter also supports multiline input via YAML pipe | character in cases where one may want to provide more than 1 cron timer. (default: '') :deploy-path: The path in Nexus to deploy javadoc to. (default: $PROJECT/$STREAM) :git-url: URL clone project from. (default: $GIT_URL/$PROJECT) :java-version: Version of Java to use for the build. (default: openjdk8) + :mvn-central: Set to 'true' to also stage to OSSRH. This is for projects + that want to release to Maven Central. If set the parameter + ``ossrh-profile-id`` also needs to be set. (default: false) + :maven-versions-plugin: Whether to call Maven versions plugin or not. (default: false) :mvn-global-settings: The name of the Maven global settings to use for Maven configuration. (default: global-settings) :mvn-opts: Sets MAVEN_OPTS. (default: '') :mvn-params: Additional mvn parameters to pass to the cli. (default: '') - :mvn-version: Version of maven to use. (default: mvn33) + :mvn-version: Version of maven to use. (default: mvn35) + :maven-versions-plugin-set-version: New version to use in Maven versions plugin. (default: '') + :ossrh-profile-id: Profile ID for project as provided by OSSRH. + (default: '') + :sign-artifacts: Sign artifacts with Sigul. (default: false) :stream: Keyword that can be used to represent a release code-name. Often the same as the branch. (default: master) :submodule-recursive: Whether to checkout submodules recursively. (default: true) + :submodule-timeout: Timeout (in minutes) for checkout operation. + (default: 10) :gerrit_release_triggers: Override Gerrit Triggers. +.. _maven-sonar: + Maven Sonar ----------- @@ -306,6 +376,8 @@ interest in that kind of support. - gerrit-maven-sonar - github-maven-sonar +:Comment Trigger: run-sonar + :Required parameters: :build-node: The node to run build on. @@ -316,7 +388,7 @@ interest in that kind of support. :Optional parameters: :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7) - :build-timeout: Timeout in seconds before aborting build. (default: 60) + :build-timeout: Timeout in minutes before aborting build. (default: 60) :cron: Cron schedule when to trigger the job. This parameter also supports multiline input via YAML pipe | character in cases where one may want to provide more than 1 cron timer. (default: 'H H * * 6' @@ -327,14 +399,30 @@ interest in that kind of support. Maven configuration. (default: global-settings) :mvn-opts: Sets MAVEN_OPTS. (default: '') :mvn-params: Additional mvn parameters to pass to the cli. (default: '') - :mvn-version: Version of maven to use. (default: mvn33) + :mvn-version: Version of maven to use. (default: mvn35) + :sonar-mvn-goals: Maven goals to run for sonar analysis. + (default: sonar:sonar) + :sonarcloud: Whether or not to use SonarCloud ``true|false``. + (default: false) + :sonarcloud-project-key: SonarCloud project key. (default: '') + :sonarcloud-project-organization: SonarCloud project organization. + (default: '') + :sonarcloud-api-token: SonarCloud API Token. (default: '') :stream: Keyword that can be used to represent a release code-name. Often the same as the branch. (default: master) :submodule-recursive: Whether to checkout submodules recursively. (default: true) + :submodule-timeout: Timeout (in minutes) for checkout operation. + (default: 10) :gerrit_sonar_triggers: Override Gerrit Triggers. + +SonarCloud Example: + +.. literalinclude:: ../../.jjb-test/lf-maven-jobs/maven-sonarcloud.yaml + :language: yaml + Maven Verify ------------ @@ -346,6 +434,8 @@ Verify job which runs mvn clean install to test a project build.. - gerrit-maven-verify - github-maven-verify +:Comment Trigger: recheck|reverify + :Required parameters: :build-node: The node to run build on. @@ -357,18 +447,20 @@ Verify job which runs mvn clean install to test a project build.. :branch: Git branch to fetch for the build. (default: master) :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7) - :build-timeout: Timeout in seconds before aborting build. (default: 60) + :build-timeout: Timeout in minutes before aborting build. (default: 60) :git-url: URL clone project from. (default: $GIT_URL/$PROJECT) :java-version: Version of Java to use for the build. (default: openjdk8) :mvn-global-settings: The name of the Maven global settings to use for Maven configuration. (default: global-settings) :mvn-opts: Sets MAVEN_OPTS. (default: '') :mvn-params: Additional mvn parameters to pass to the cli. (default: '') - :mvn-version: Version of maven to use. (default: mvn33) + :mvn-version: Version of maven to use. (default: mvn35) :stream: Keyword that can be used to represent a release code-name. Often the same as the branch. (default: master) :submodule-recursive: Whether to checkout submodules recursively. (default: true) + :submodule-timeout: Timeout (in minutes) for checkout operation. + (default: 10) :gerrit_verify_triggers: Override Gerrit Triggers. :gerrit_trigger_file_paths: Override file paths which can be used to @@ -401,18 +493,20 @@ via comment trigger. :branch: Git branch to fetch for the build. (default: master) :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7) - :build-timeout: Timeout in seconds before aborting build. (default: 60) + :build-timeout: Timeout in minutes before aborting build. (default: 60) :git-url: URL clone project from. (default: $GIT_URL/$PROJECT) :java-version: Version of Java to use for the build. (default: openjdk8) :mvn-global-settings: The name of the Maven global settings to use for Maven configuration. (default: global-settings) :mvn-opts: Sets MAVEN_OPTS. (default: '') :mvn-params: Additional mvn parameters to pass to the cli. (default: '') - :mvn-version: Version of maven to use. (default: mvn33) + :mvn-version: Version of maven to use. (default: mvn35) :stream: Keyword that can be used to represent a release code-name. Often the same as the branch. (default: master) :submodule-recursive: Whether to checkout submodules recursively. (default: true) + :submodule-timeout: Timeout (in minutes) for checkout operation. + (default: 10) :gerrit_verify_triggers: Override Gerrit Triggers. :gerrit_trigger_file_paths: Override file paths which can be used to