+#################
+# Packer Verify #
+#################
+
+- lf_packer_verify_builders: &lf_packer_verify_builders
+ name: lf-packer-verify-builders
+
+ # Adds builders section common to verify packer jobs.
+ # {packer-cloud-settings} is passed from the project, defines the managed
+ # file-id name created in Jenkins
+ # (default: packer-cloud-env)
+ # {packer-version}: is global defined in job group level, the version number
+ # can be updated to install the latest version of packer.
+
+ builders:
+ - lf-infra-packer-validate:
+ packer-cloud-settings: '{packer-cloud-settings}'
+ packer-version: '{packer-version}'
+
+- job-template:
+ name: '{project-name}-packer-verify'
+ id: gerrit-packer-verify
+ concurrent: true
+ <<: *lf_jjb_common
+ # yamllint disable-line rule:key-duplicates
+ <<: *lf_packer_common
+ # yamllint disable-line rule:key-duplicates
+ <<: *lf_packer_verify_builders
+
+ ######################
+ # Default parameters #
+ ######################
+
+ build-timeout: 10
+ git-url: '$GIT_URL/$GERRIT_PROJECT'
+
+ gerrit_verify_triggers:
+ - patchset-created-event:
+ exclude-drafts: false
+ exclude-trivial-rebase: false
+ exclude-no-code-change: false
+ - draft-published-event
+ - comment-added-contains-event:
+ comment-contains-value: recheck$
+
+ #####################
+ # Job Configuration #
+ #####################
+
+ scm:
+ - lf-infra-gerrit-scm:
+ git-url: '{git-url}'
+ refspec: '$GERRIT_REFSPEC'
+ branch: '$GERRIT_BRANCH'
+ submodule-recursive: '{submodule-recursive}'
+ choosing-strategy: gerrit
+ jenkins-ssh-credential: '{jenkins-ssh-credential}'
+
+ triggers:
+ - gerrit:
+ server-name: '{gerrit-server-name}'
+ trigger-on: '{obj:gerrit_verify_triggers}'
+ projects:
+ - project-compare-type: ANT
+ project-pattern: '{project}'
+ branches:
+ - branch-compare-type: ANT
+ branch-pattern: '**/{branch}'
+ <<: *lf_packer_file_paths
+