X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=docs%2Fjjb%2Flf-maven-jobs.rst;h=3c45aaf667839f97d97e56242fe49becadac631b;hb=a43f74d71d53a8fb70cf0bed85bfa0449b80a0c2;hp=02de9f1f13b6907f285b2243f9d433598c075554;hpb=75cd5909da184179c77a55d1909f7159d9eea34b;p=releng%2Fglobal-jjb.git diff --git a/docs/jjb/lf-maven-jobs.rst b/docs/jjb/lf-maven-jobs.rst index 02de9f1f..3c45aaf6 100644 --- a/docs/jjb/lf-maven-jobs.rst +++ b/docs/jjb/lf-maven-jobs.rst @@ -5,48 +5,12 @@ Maven Jobs Job Groups ========== -{project-name}-maven-jobs -------------------------- - -Jobs for Maven projects using Gerrit. - -:Includes: - - - gerrit-maven-clm - - gerrit-maven-stage - - gerrit-maven-verify - - gerrit-maven-verify-dependencies - -{project-name}-github-maven-jobs --------------------------------- - -Jobs for Maven projects using GitHub. - -:Includes: - - - github-maven-clm - - github-maven-stage - - github-maven-verify - -{project-name}-maven-javadoc-jobs ---------------------------------- - -Jobs for Maven projects to generate javadoc using Gerrit. - -:Includes: +.. include:: ../job-groups.rst - - gerrit-maven-javadoc-publish - - gerrit-maven-javadoc-verify - -{project-name}-github-maven-javadoc-jobs ----------------------------------------- +Below is a list of Maven job groups: -Jobs for Maven projects to generate javadoc using GitHub. - -:Includes: - - - github-maven-javadoc-publish - - github-maven-javadoc-verify +.. literalinclude:: ../../jjb/lf-maven-job-groups.yaml + :language: yaml Macros @@ -63,6 +27,20 @@ Runs Sonar against a Maven project. :mvn-version: Version of Maven to execute Sonar with. :mvn-settings: Maven settings.xml file containing credentials to use. +lf-infra-maven-sonarcloud +------------------------- + +Runs Sonar against a Maven project and pushes results to SonarCloud. + +:Required Parameters: + + :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. + lf-maven-build -------------- @@ -83,11 +61,31 @@ 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) + :version-properties-file: Name and path of the version properties file. + (default: version.properties) + :mvn-version: Version of Maven to execute Sonar with. + :mvn-pom: Location of pom.xml. + :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 --------------------------- @@ -98,6 +96,16 @@ Setup Java alternatives for the Distro. :java-version: Version of Java to set as the default Java. Eg. openjdk8 +lf-infra-sonatype-clm +--------------------- + +Runs a Sonatype CLM scan against a Maven project and pushes results to +Nexus IQ server. + +:Optional parameters: + :mvn-goals: The maven goals to perform for the build. + (default: clean install) + Job Templates ============= @@ -130,15 +138,25 @@ Produces a CLM scan of the code into Nexus IQ Server. :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-goals: The maven goals to perform for the build. + (default: clean install) + :mvn-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '') :mvn-params: Additional mvn parameters to pass to the cli. (default: '') :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) + :submodule-disable: Disable submodule checkout operation. + (default: false) :gerrit_merge_triggers: Override Gerrit Triggers. @@ -147,11 +165,13 @@ Maven JavaDoc Publish Produces and publishes javadocs for a Maven project. -Expects javadocs to be available in $WORKSPACE/target/site/apidocs +Expects javadocs to be available in $WORKSPACE/target/site/apidocs, unless +the mvn-dir parameter is supplied, in which case expects javadocs to be +available in $WORKSPACE/{mvn-dir}/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 @@ -174,15 +194,21 @@ Expects javadocs to be available in $WORKSPACE/target/site/apidocs :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-dir: Directory supplied as argument to -f option (default: '.') :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-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '') :mvn-params: Additional mvn parameters to pass to the cli. (default: '') + Must not include a "-f" option; see parameter mvn-dir. :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) + :submodule-disable: Disable submodule checkout operation. + (default: false) :gerrit_merge_triggers: Override Gerrit Triggers. @@ -191,11 +217,13 @@ Maven JavaDoc Verify Produces javadocs for a Maven project. -Expects javadocs to be available in $WORKSPACE/target/site/apidocs +Expects javadocs to be available in $WORKSPACE/target/site/apidocs, unless +the mvn-dir parameter is supplied, in which case expects javadocs to be +available in $WORKSPACE/{mvn-dir}/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 @@ -215,15 +243,21 @@ Expects javadocs to be available in $WORKSPACE/target/site/apidocs :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-dir: Directory supplied as argument to -f option (default: '.') :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-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '') :mvn-params: Additional mvn parameters to pass to the cli. (default: '') + Must not include a "-f" option; see parameter mvn-dir. :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) + :submodule-disable: Disable submodule checkout operation. + (default: false) :gerrit_verify_triggers: Override Gerrit Triggers. @@ -276,7 +310,7 @@ This job uses the following strategy to deploy jobs to Nexus: :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-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '') :mvn-params: Additional mvn parameters to pass to the cli. (default: '') :mvn-version: Version of maven to use. (default: mvn35) :nexus-cut-dirs: Number of directories to cut from file path for `wget -r`. @@ -284,11 +318,42 @@ This job uses the following strategy to deploy jobs to Nexus: 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) + :submodule-disable: Disable submodule checkout operation. + (default: false) :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 Merge for Docker +---------------------- + +Produces a snapshot docker image in a Nexus registry. Appropriate for +Java projects that do not need to deploy any POM or JAR files. + +Similar to Maven Merge as described above but logs in to Docker +registries first and skips the lf-maven-deploy builder. The project +POM file should invoke a plugin to build and push a Docker image. The +base image should be pulled from the registry in the environment +variable CONTAINER_PULL_REGISTRY. The new image should be pushed to the +registry in the environment variable CONTAINER_PUSH_REGISTRY. + +:Template Names: + + - {project-name}-maven-docker-merge-{stream} + - gerrit-maven-docker-merge + - github-maven-docker-merge + +:Required parameters: + + :container-public-registry: Docker registry source with base images. + :container-snapshot-registry: Docker registry target for the deploy action. + +All other required and optional parameters are identical to the Maven Merge job +described above. + Maven Stage ----------- @@ -306,6 +371,8 @@ directory is then used later to deploy to Nexus. - gerrit-maven-stage - github-maven-stage +:Comment Trigger: "stage-release" or "stage-maven-release" + :Required parameters: :build-node: The node to run build on. @@ -328,17 +395,68 @@ directory is then used later to deploy to Nexus. :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-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '') :mvn-params: Additional mvn parameters to pass to the cli. (default: '') :mvn-version: Version of maven to use. (default: mvn35) + :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) + :submodule-disable: Disable submodule checkout operation. + (default: false) + :version-properties-file: Name and path of the version properties file. + (default: version.properties) :gerrit_release_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 Stage for Docker +---------------------- + +Produces a release candidate docker image in a Nexus registry. +Appropriate for Java projects that do not need to deploy any POM or +JAR files. + +Similar to Maven Stage as described above but logs in to Docker +registries first and skips the lf-maven-deploy builder. The project +POM file should invoke a plugin to build and push a Docker image. The +base image should be pulled from the registry in the environment +variable CONTAINER_PULL_REGISTRY. The new image should be pushed to the +registry in the environment variable CONTAINER_PUSH_REGISTRY. + +:Template Names: + + - {project-name}-maven-docker-stage-{stream} + - gerrit-maven-docker-stage + - github-maven-docker-stage + +:Comment Trigger: "stage-release" or "stage-docker-release" + +:Required parameters: + + :container-public-registry: Docker registry source with base images. + :container-staging-registry: Docker registry target for the deploy action. + +:Optional parameters: + + :gerrit_release_docker_triggers: Override Gerrit Triggers. + +All other required and optional parameters are identical to the Maven Stage job +described above. + +.. _maven-sonar: Maven Sonar ----------- @@ -376,16 +494,36 @@ interest in that kind of support. :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-goals: The maven goals to perform for the build. + (default: clean install) + :mvn-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '') :mvn-params: Additional mvn parameters to pass to the cli. (default: '') :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) + :submodule-disable: Disable submodule checkout operation. + (default: false) :gerrit_sonar_triggers: Override Gerrit Triggers. + +SonarCloud Example: + +.. literalinclude:: ../../.jjb-test/lf-maven-jobs/maven-sonarcloud.yaml + :language: yaml + Maven Verify ------------ @@ -415,19 +553,44 @@ Verify job which runs mvn clean install to test a project build.. :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-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '') :mvn-params: Additional mvn parameters to pass to the cli. (default: '') :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) + :submodule-disable: Disable submodule checkout operation. + (default: false) :gerrit_verify_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 Verify /w Dependencies +Maven Verify for Docker +----------------------- + +Similar to Maven Verify as described above but logs in to Docker +registries first. The project POM file should invoke a plugin to build +a Docker image. The base image should be pulled from the registry in +the environment variable CONTAINER_PULL_REGISTRY. + +:Template Names: + + - {project-name}-maven-docker-verify-{stream}-{mvn-version}-{java-version} + - gerrit-maven-docker-verify + - github-maven-docker-verify + +:Required parameters: + + :container-public-registry: Docker registry source with base images. + +All other required and optional parameters are identical to the Maven Verify job +described above. + +Maven Verify w/ Dependencies ---------------------------- Verify job which runs mvn clean install to test a project build /w deps @@ -441,7 +604,7 @@ via comment trigger. - {project-name}-maven-verify-deps-{stream}-{mvn-version}-{java-version} - gerrit-maven-verify-dependencies -:Comment Trigger: recheck: SPACE_SEPERATED_LIST_OF_PATCHES +:Comment Trigger: recheck: SPACE_SEPARATED_LIST_OF_PATCHES :Required parameters: @@ -459,13 +622,17 @@ via comment trigger. :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-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '') :mvn-params: Additional mvn parameters to pass to the cli. (default: '') :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) + :submodule-disable: Disable submodule checkout operation. + (default: false) :gerrit_verify_triggers: Override Gerrit Triggers. :gerrit_trigger_file_paths: Override file paths which can be used to