From: Fiete Ostkamp Date: Mon, 7 Aug 2023 12:16:50 +0000 (+0000) Subject: Feat: Add gradle publish job X-Git-Tag: v0.88.4^0 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=386002f778b501b64047f8dcdf1a3ff9ccec932b;p=releng%2Fglobal-jjb.git Feat: Add gradle publish job Issue: RELENG-4763 Change-Id: Ifca59da7e6321815ad1301baa28756461f53ce30 Signed-off-by: Fiete Ostkamp --- diff --git a/docs/jjb/lf-gradle-jobs.rst b/docs/jjb/lf-gradle-jobs.rst index f4a1d5b2..f32ee403 100644 --- a/docs/jjb/lf-gradle-jobs.rst +++ b/docs/jjb/lf-gradle-jobs.rst @@ -21,7 +21,43 @@ Runs a gradle build command to perform the verification. :java-version: Version of Java to execute Maven build. (default: openjdk17) :jenkins-ssh-credential: Credential to use for SSH. (Generally configured in defaults.yaml) :mvn-settings: Maven settings.xml file containing credentials to use. - :wrapper: Use the gradle wrapper (default: false) + :wrapper: Use the gradle wrapper (default: true) + +:Optional parameters: + + :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 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) + :stream: Keyword that represents 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. + +Gradle Publish Jar +------------ + +Runs a gradle publish command to publish the jar. + +:Template Names: + + - {project-name}-gradle-publish-jar-{stream} + +:Comment Trigger: recheck|reverify + +:Required parameters: + :build-node: The node to run build on. + :java-version: Version of Java to execute Maven build. (default: openjdk17) + :jenkins-ssh-credential: Credential to use for SSH. (Generally configured in defaults.yaml) + :mvn-settings: Maven settings.xml file containing credentials to use. + :wrapper: Use the gradle wrapper (default: true) :Optional parameters: diff --git a/jjb/lf-gradle-jobs.yaml b/jjb/lf-gradle-jobs.yaml index b7b93702..301770b6 100644 --- a/jjb/lf-gradle-jobs.yaml +++ b/jjb/lf-gradle-jobs.yaml @@ -126,8 +126,11 @@ - lf-infra-docker-login: global-settings-file: "global-settings" settings-file: "{mvn-settings}" - - shell: | - ./gradlew build + - gradle: + wrapper: "{wrapper}" + executable: true + tasks: | + build scm: - lf-infra-github-scm: @@ -149,3 +152,46 @@ github-hooks: true white-list-target-branches: - "{branch}" + +- job-template: + name: "{project-name}-gradle-publish-jar-{stream}" + id: gerrit-gradle-publish-jar + <<: *lf_gradle_common + + builders: + - lf-infra-pre-build + - lf-update-java-alternatives: + java-version: "{java-version}" + - lf-infra-docker-login: + global-settings-file: "global-settings" + settings-file: "{mvn-settings}" + - gradle: + wrapper: "{wrapper}" + executable: true + tasks: | + shadowJar + publish + + 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_gradle_triggers}" + projects: + - project-compare-type: ANT + project-pattern: "{project}" + branches: + - branch-compare-type: ANT + branch-pattern: "**/{branch}" + file-paths: "{obj:gerrit_trigger_file_paths}"