--- /dev/null
+###########
+Gradle Jobs
+###########
+
+Job Templates
+=============
+
+Gradle Build
+------------
+
+Runs a gradle build command to perform the verification.
+
+:Template Names:
+
+ - {project-name}-gradle-build-{stream}
+
+:Comment Trigger: recheck|reverify
+
+:Required parameters:
+ :build-node: The node to run build on.
+ :jenkins-ssh-credential: Credential to use for SSH. (Generally configured in defaults.yaml)
+
+: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.
--- /dev/null
+####################
+# COMMON FUNCTIONS #
+####################
+
+- _lf_gradle_common: &lf_gradle_common
+ name: lf-gradle-common
+
+ ######################
+ # Default parameters #
+ ######################
+
+ branch: master
+ build-days-to-keep: 7
+ build-timeout: 60
+ disable-job: false
+ git-url: "$GIT_URL/$PROJECT"
+ github-url: https://github.com
+ java-version: openjdk17
+ stream: master
+ submodule-recursive: true
+ submodule-timeout: 10
+ submodule-disable: false
+ cron: "@daily"
+
+ archive-artifacts: >
+ **/*.log
+ **/hs_err_*.log
+ **/target/**/feature.xml
+ **/target/failsafe-reports/failsafe-summary.xml
+ **/target/surefire-reports/*-output.txt
+
+ #####################
+ # Job Configuration #
+ #####################
+
+ project-type: freestyle
+ node: "{build-node}"
+
+ properties:
+ - lf-infra-properties:
+ build-days-to-keep: "{build-days-to-keep}"
+
+ parameters:
+ - lf-infra-parameters:
+ project: "{project}"
+ branch: "{branch}"
+ stream: "{stream}"
+ - string:
+ name: ARCHIVE_ARTIFACTS
+ default: "{archive-artifacts}"
+ description: Artifacts to archive to the logs server.
+
+ wrappers:
+ - lf-infra-wrappers:
+ build-timeout: "{build-timeout}"
+ jenkins-ssh-credential: "{jenkins-ssh-credential}"
+
+ publishers:
+ - lf-infra-publish
+
+ gerrit_gradle_triggers:
+ - patchset-created-event:
+ exclude-drafts: true
+ exclude-trivial-rebase: false
+ exclude-no-code-change: false
+ - draft-published-event
+ - comment-added-contains-event:
+ comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
+
+ gerrit_trigger_file_paths:
+ - compare-type: REG_EXP
+ pattern: ".*"
+
+- job-template:
+ name: "{project-name}-gradle-build-{stream}"
+ id: gerrit-gradle-build
+ <<: *lf_gradle_common
+
+ builders:
+ - shell: |
+ ./gradlew build
+
+ 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}"
+
+- job-template:
+ name: "{project-name}-gradle-build-{stream}"
+ id: github-gradle-build
+ <<: *lf_gradle_common
+
+ builders:
+ - shell: |
+ ./gradlew build
+
+ scm:
+ - lf-infra-github-scm:
+ url: "{git-clone-url}{github-org}/{project}"
+ refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
+ branch: "$sha1"
+ submodule-recursive: "{submodule-recursive}"
+ submodule-timeout: "{submodule-timeout}"
+ submodule-disable: "{submodule-disable}"
+ choosing-strategy: default
+ jenkins-ssh-credential: "{jenkins-ssh-credential}"
+
+ triggers:
+ - github-pull-request:
+ trigger-phrase: ^(recheck|reverify)$
+ only-trigger-phrase: false
+ status-context: "Gradle Verify"
+ permit-all: true
+ github-hooks: true
+ white-list-target-branches:
+ - "{branch}"