Feat: Add gradle publish job 33/72033/4 v0.88.4
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>
Mon, 7 Aug 2023 12:16:50 +0000 (12:16 +0000)
committerFiete Ostkamp <Fiete.Ostkamp@telekom.de>
Mon, 7 Aug 2023 12:25:13 +0000 (12:25 +0000)
Issue: RELENG-4763
Change-Id: Ifca59da7e6321815ad1301baa28756461f53ce30
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
docs/jjb/lf-gradle-jobs.rst
jjb/lf-gradle-jobs.yaml

index f4a1d5b..f32ee40 100644 (file)
@@ -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:
 
index b7b9370..301770b 100644 (file)
       - 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:
           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}"