Fix packer verify file path triggering
[releng/global-jjb.git] / jjb / lf-ci-jobs.yaml
1 ---
2 - job-group:
3     name: '{project-name}-ci-jobs'
4
5     # This job group contains all the recommended jobs that should be deployed
6     # for any project ci.
7
8     jjb-version: 1.6.2
9
10     jobs:
11       - gerrit-jjb-deploy-job
12       - gerrit-jjb-merge
13       - gerrit-jjb-verify
14
15 - job-group:
16     name: '{project-name}-github-ci-jobs'
17
18     # This job group contains all the recommended jobs that should be deployed
19     # for any project ci that is using github.
20
21     jjb-version: 1.6.2
22
23     jobs:
24       - github-jjb-deploy-job
25       - github-jjb-merge
26       - github-jjb-verify
27
28
29 - job-group:
30     name: '{project-name}-packer-jobs'
31
32     # This job group contains all the recommended jobs that should be deployed
33     # for any project ci that is using packer.
34
35     packer-version: 1.0.2
36
37     jobs:
38       - gerrit-packer-merge
39       - gerrit-packer-verify
40
41
42 - job-group:
43     name: '{project-name}-github-packer-jobs'
44
45     # This job group contains all the recommended jobs that should be deployed
46     # for any project ci that is using packer.
47
48     packer-version: 1.0.2
49
50     jobs:
51       - github-packer-merge
52       - github-packer-verify
53
54 ####################
55 # COMMON FUNCTIONS #
56 ####################
57
58 - builder:
59     name: lf-infra-jjbini
60     builders:
61       - config-file-provider:
62           files:
63             - file-id: jjbini
64               target: '$HOME/.config/jenkins_jobs/jenkins_jobs.ini'
65
66 - builder:
67     name: lf-infra-jjbini-sandbox
68     # TODO: Consolidate this into jjbini when JJB2.0 is available.
69     builders:
70       - config-file-provider:
71           files:
72             - file-id: jjbini-sandbox
73               target: '$HOME/.config/jenkins_jobs/jenkins_jobs.ini'
74
75 - lf_packer_verify_file_paths: &lf_packer_verify_file_paths
76     name: lf-packer-verify-file-paths
77     file-paths:
78       # Common files for all projects
79       - compare-type: ANT
80         pattern: 'packer/vars/**.json'
81       - compare-type: ANT
82         pattern: 'packer/templates/**.json'
83       - compare-type: ANT
84         pattern: 'packer/provision/**.sh'
85       - compare-type: ANT
86         pattern: 'packer/provision/lib/**'
87
88 - lf_packer_file_paths: &lf_packer_file_paths
89     name: lf-packer-file-paths
90     file-paths:
91       # Common files for all projects
92       - compare-type: ANT
93         pattern: 'packer/vars/{platforms}.json'
94       - compare-type: ANT
95         pattern: 'packer/templates/{templates}.json'
96       - compare-type: ANT
97         pattern: 'packer/provision/{templates}.sh'
98       - compare-type: ANT
99         pattern: 'packer/provision/lib/**'
100
101 - lf_packer: &lf_packer_common
102     name: lf-packer-common
103     # Provide configuration common in packer jobs.
104
105     ######################
106     # Default parameters #
107     ######################
108
109     branch: master
110     build-timeout: 45
111     stream: master
112     submodule-recursive: true
113     packer-cloud-settings: packer-cloud-env
114
115     #####################
116     # Job Configuration #
117     #####################
118
119     project-type: freestyle
120     node: '{build-node}'
121
122     properties:
123       - lf-infra-properties:
124           project: '{project}'
125           build-days-to-keep: 7
126
127     parameters:
128       - lf-infra-parameters:
129           project: '{project}'
130           stream: '{stream}'
131           branch: '{branch}'
132           lftools-version: '{lftools-version}'
133       - lf-infra-packer-parameters:
134           packer-version: '{packer-version}'
135
136     wrappers:
137       - lf-infra-wrappers:
138           build-timeout: '{build-timeout}'
139           jenkins-ssh-credential: '{jenkins-ssh-credential}'
140
141     publishers:
142       - lf-infra-publish
143
144 - parameter:
145     name: lf-infra-jjb-parameters
146     parameters:
147       - string:
148           name: JJB_VERSION
149           default: '{jjb-version}'
150           description: Jenkins Job Builder version to download and install.
151
152 - parameter:
153     name: lf-infra-packer-parameters
154     parameters:
155       - string:
156           name: PACKER_VERSION
157           default: '{packer-version}'
158           description: Packer version to download and install.
159
160 - lf_jjb_common: &lf_jjb_common
161     name: lf-jjb-common
162
163     ######################
164     # Default parameters #
165     ######################
166
167     branch: master
168     build-timeout: 10
169     stream: master
170     submodule-recursive: true
171
172     gerrit_trigger_file_paths:
173       - compare-type: ANT
174         pattern: '**/*.sh'
175       - compare-type: ANT
176         pattern: '**/*.yaml'
177       - compare-type: ANT
178         pattern: '**/global-jjb'
179
180     #####################
181     # Job Configuration #
182     #####################
183
184     project-type: freestyle
185     node: '{build-node}'
186
187     properties:
188       - lf-infra-properties:
189           project: '{project}'
190           build-days-to-keep: 7
191
192     parameters:
193       - lf-infra-parameters:
194           project: '{project}'
195           stream: '{stream}'
196           branch: '{branch}'
197           lftools-version: '{lftools-version}'
198       - lf-infra-jjb-parameters:
199           jjb-version: '{jjb-version}'
200
201     wrappers:
202       - lf-infra-wrappers:
203           build-timeout: '{build-timeout}'
204           jenkins-ssh-credential: '{jenkins-ssh-credential}'
205
206     publishers:
207       - lf-infra-publish
208
209 ######################
210 # Gerrit Branch Lock #
211 ######################
212
213 - job-template:
214     name: '{project-name}-gerrit-branch-lock-{stream}'
215     id: gerrit-branch-lock
216
217     ######################
218     # Default parameters #
219     ######################
220
221     branch: master
222     git-url: '$GIT_URL/$GERRIT_PROJECT'
223     stream: master
224     gerrit_merge_triggers:
225       - comment-added-contains-event:
226           comment-contains-value: (un)?lock branch$
227
228     #####################
229     # Job Configuration #
230     #####################
231
232     project-type: freestyle
233     node: '{build-node}'
234
235     properties:
236       - lf-infra-properties:
237           project: '{project}'
238           build-days-to-keep: 1
239
240     parameters:
241       - lf-infra-parameters:
242           project: '{project}'
243           stream: '{stream}'
244           branch: '{branch}'
245           lftools-version: '{lftools-version}'
246
247     wrappers:
248       - lf-infra-wrappers:
249           build-timeout: 5
250           jenkins-ssh-credential: '{jenkins-ssh-credential}'
251
252     scm:
253       - lf-infra-gerrit-scm:
254           git-url: '{git-url}'
255           refspec: ''
256           branch: '{branch}'
257           submodule-recursive: false
258           choosing-strategy: default
259           jenkins-ssh-credential: '{jenkins-ssh-credential}'
260
261     triggers:
262       - gerrit:
263           server-name: '{gerrit-server-name}'
264           trigger-on: '{obj:gerrit_merge_triggers}'
265           projects:
266             - project-compare-type: ANT
267               project-pattern: '{project}'
268               branches:
269                 - branch-compare-type: ANT
270                   branch-pattern: '**/{branch}'
271
272     builders:
273       - shell: !include-raw-escape: ../shell/gerrit-branch-lock.sh
274
275
276     publishers:
277       - lf-infra-publish
278
279 ##################
280 # JJB DEPLOY JOB #
281 ##################
282
283 - lf_jjb_deploy_job: &lf_jjb_deploy_job
284     name: lf-jjb-deploy-job
285
286     # Deploy jobs to jenkins-sandbox system via code review comment
287     #
288     # This job checks out the current code review patch and then runs a
289     # `jenkins-jobs update` to push a patch defined by the comment.
290     #
291     # Comment Trigger: jjb-deploy JOB_NAME
292     #
293     # JOB_NAME can include the * wildcard character to push multiple jobs
294     # matching the pattern. For example `jjb-deploy builder-jjb-*`` will push
295     # all builder-jjb-* jobs to the sandbox system.
296     #
297     # Required parameters:
298     #
299     #     :build-node: The node to run build on.
300     #     :jenkins-ssh-credential: Credential to use for SSH. (Generally should
301     #         be configured in defaults.yaml)
302     #
303     # Optional parameters:
304     #
305     #     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
306     #     :gerrit_jjb_deploy_job_triggers: Override Gerrit Triggers.
307
308     ######################
309     # Default parameters #
310     ######################
311
312     branch: master
313     git-url: '$GIT_URL/$GERRIT_PROJECT'
314     stream: master
315     gerrit_jjb_deploy_job_triggers:
316       - comment-added-contains-event:
317           comment-contains-value: jjb-deploy (?!\*+$).+$
318
319     #####################
320     # Job Configuration #
321     #####################
322
323     project-type: freestyle
324     node: '{build-node}'
325     concurrent: true
326
327     properties:
328       - lf-infra-properties:
329           project: '{project}'
330           build-days-to-keep: 1
331
332     parameters:
333       - lf-infra-parameters:
334           project: '{project}'
335           stream: '{stream}'
336           branch: '{branch}'
337           lftools-version: '{lftools-version}'
338
339     wrappers:
340       - lf-infra-wrappers:
341           build-timeout: 5
342           jenkins-ssh-credential: '{jenkins-ssh-credential}'
343
344     builders:
345       - lf-pip-install:
346           pip-packages: jenkins-job-builder
347       - lf-infra-jjbini-sandbox
348       - shell: !include-raw-escape: ../shell/jjb-deploy-job.sh
349
350     publishers:
351       - lf-infra-publish
352
353 - job-template:
354     name: '{project-name}-jjb-deploy-job'
355     id: gerrit-jjb-deploy-job
356     <<: *lf_jjb_deploy_job
357
358     scm:
359       - lf-infra-gerrit-scm:
360           git-url: '{git-url}'
361           refspec: 'refs/heads/{branch}'
362           branch: '{branch}'
363           submodule-recursive: true
364           choosing-strategy: default
365           jenkins-ssh-credential: '{jenkins-ssh-credential}'
366
367     triggers:
368       - gerrit:
369           server-name: '{gerrit-server-name}'
370           trigger-on: '{obj:gerrit_jjb_deploy_job_triggers}'
371           projects:
372             - project-compare-type: ANT
373               project-pattern: '{project}'
374               branches:
375                 - branch-compare-type: ANT
376                   branch-pattern: '**/{branch}'
377
378 - job-template:
379     name: '{project-name}-jjb-deploy-job'
380     id: github-jjb-deploy-job
381     <<: *lf_jjb_deploy_job
382
383     properties:
384       - github:
385           url: '{git-url}/{github-org}/{project}'
386
387     scm:
388       - lf-infra-github-scm:
389           url: '{git-clone-url}{github-org}/{project}'
390           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
391           branch: '{branch}'
392           submodule-recursive: true
393           choosing-strategy: default
394           jenkins-ssh-credential: '{jenkins-ssh-credential}'
395
396     triggers:
397       - lf-infra-github-pr-trigger:
398           trigger-phrase: '^jjb-deploy (?!\*+$).+$'
399           only-trigger-phrase: true
400           status-context: 'JJB Deploy Job'
401           permit-all: true
402           github-hooks: true
403           github-org: ''
404           github_pr_whitelist:
405             - ''
406           github_pr_admin_list:
407             - ''
408
409 #############
410 # JJB Merge #
411 #############
412
413 - lf_jjb_merge: &lf_jjb_merge
414     name: lf-jjb-merge
415
416     # JJB Merge job runs `jenkins-jobs update` to update production job configuration
417     #
418     # Required parameters:
419     #
420     #     :build-node: The node to run build on.
421     #     :jenkins-ssh-credential: Credential to use for SSH. (Generally should
422     #         be configured in defaults.yaml)
423     #     :mvn-settings: The name of settings file containing credentials for
424     #         the project.
425     #
426     # Optional parameters:
427     #
428     #     :branch: Git branch to fetch for the build. (default: master)
429     #     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
430     #     :build-timeout: Timeout in seconds before aborting build. (default: 10)
431     #     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
432     #     :stream: Keyword that can be used to represent a release code-name.
433     #         Often the same as the branch. (default: master)
434     #     :submodule-recursive: Whether to checkout submodules recursively.
435     #         (default: true)
436     #
437     #     :gerrit_merge_triggers: Override Gerrit Triggers.
438     #     :gerrit_trigger_file_paths: Override file paths which can be used to
439     #         filter which file modifications will trigger a build.
440     #         (default defined by lf_jjb_common)
441
442     ######################
443     # Default parameters #
444     ######################
445
446     gerrit_merge_triggers:
447       - change-merged-event
448       - comment-added-contains-event:
449           comment-contains-value: remerge$
450
451     #####################
452     # Job Configuration #
453     #####################
454
455     builders:
456       - lf-infra-jjbini
457       - shell: !include-raw-escape:
458           - ../shell/jjb-install.sh
459           - ../shell/jjb-merge-job.sh
460
461 - job-template:
462     name: '{project-name}-jjb-merge'
463     id: gerrit-jjb-merge
464     <<: *lf_jjb_common
465     # yamllint disable-line rule:key-duplicates
466     <<: *lf_jjb_merge
467
468     git-url: '$GIT_URL/$GERRIT_PROJECT'
469
470     scm:
471       - lf-infra-gerrit-scm:
472           git-url: '{git-url}'
473           refspec: ''
474           branch: '{branch}'
475           submodule-recursive: '{submodule-recursive}'
476           choosing-strategy: default
477           jenkins-ssh-credential: '{jenkins-ssh-credential}'
478
479     triggers:
480       - gerrit:
481           server-name: '{gerrit-server-name}'
482           trigger-on: '{obj:gerrit_merge_triggers}'
483           projects:
484             - project-compare-type: ANT
485               project-pattern: '{project}'
486               branches:
487                 - branch-compare-type: ANT
488                   branch-pattern: '**/{branch}'
489               file-paths: '{obj:gerrit_trigger_file_paths}'
490
491 - job-template:
492     name: '{project-name}-jjb-merge'
493     id: github-jjb-merge
494     <<: *lf_jjb_common
495     # yamllint disable-line rule:key-duplicates
496     <<: *lf_jjb_merge
497
498     properties:
499       - github:
500           url: '{git-url}/{github-org}/{project}'
501
502     scm:
503       - lf-infra-github-scm:
504           url: '{git-clone-url}{github-org}/{project}'
505           refspec: ''
506           branch: '{branch}'
507           submodule-recursive: '{submodule-recursive}'
508           choosing-strategy: default
509           jenkins-ssh-credential: '{jenkins-ssh-credential}'
510
511     triggers:
512       - github
513       - pollscm:
514           cron: ''
515       - lf-infra-github-pr-trigger:
516           trigger-phrase: '^remerge$'
517           only-trigger-phrase: true
518           status-context: 'JJB Merge'
519           permit-all: false
520           github-hooks: true
521           github-org: '{github-org}'
522           github_pr_whitelist: '{obj:github_pr_whitelist}'
523           github_pr_admin_list: '{obj:github_pr_admin_list}'
524
525 ##############
526 # JJB Verify #
527 ##############
528
529 - lf_jjb_verify: &lf_jjb_verify
530     name: lf-jjb-verify
531
532     # JJB Verify job runs `jenkins-jobs test` to validate JJB syntax
533     #
534     # Required parameters:
535     #
536     #     :build-node: The node to run build on.
537     #     :jenkins-ssh-credential: Credential to use for SSH. (Generally should
538     #         be configured in defaults.yaml)
539     #     :mvn-settings: The name of settings file containing credentials for
540     #         the project.
541     #
542     # Optional parameters:
543     #
544     #     :branch: Git branch to fetch for the build. (default: master)
545     #     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
546     #     :build-timeout: Timeout in seconds before aborting build. (default: 10)
547     #     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
548     #     :stream: Keyword that can be used to represent a release code-name.
549     #         Often the same as the branch. (default: master)
550     #     :submodule-recursive: Whether to checkout submodules recursively.
551     #         (default: true)
552     #
553     #     :gerrit_verify_triggers: Override Gerrit Triggers.
554     #     :gerrit_trigger_file_paths: Override file paths which can be used to
555     #         filter which file modifications will trigger a build.
556     #         (default defined by lf_jjb_common)
557
558     ######################
559     # Default parameters #
560     ######################
561
562     gerrit_verify_triggers:
563       - patchset-created-event:
564           exclude-drafts: true
565           exclude-trivial-rebase: false
566           exclude-no-code-change: false
567       - draft-published-event
568       - comment-added-contains-event:
569           comment-contains-value: recheck$
570
571     #####################
572     # Job Configuration #
573     #####################
574
575     concurrent: true
576
577     builders:
578       - lf-infra-jjbini
579       - shell: !include-raw-escape:
580           - ../shell/git-validate-jira-urls.sh
581           - ../shell/jjb-install.sh
582           - ../shell/jjb-verify-job.sh
583           - ../shell/jjb-check-unicode.sh
584       - lf-infra-gpg-verify-git-signature
585
586 - job-template:
587     name: '{project-name}-jjb-verify'
588     id: gerrit-jjb-verify
589     <<: *lf_jjb_common
590     # yamllint disable-line rule:key-duplicates
591     <<: *lf_jjb_verify
592
593     git-url: '$GIT_URL/$GERRIT_PROJECT'
594
595     scm:
596       - lf-infra-gerrit-scm:
597           git-url: '{git-url}'
598           refspec: '$GERRIT_REFSPEC'
599           branch: '$GERRIT_BRANCH'
600           submodule-recursive: '{submodule-recursive}'
601           choosing-strategy: gerrit
602           jenkins-ssh-credential: '{jenkins-ssh-credential}'
603
604     triggers:
605       - gerrit:
606           server-name: '{gerrit-server-name}'
607           trigger-on: '{obj:gerrit_verify_triggers}'
608           projects:
609             - project-compare-type: ANT
610               project-pattern: '{project}'
611               branches:
612                 - branch-compare-type: ANT
613                   branch-pattern: '**/{branch}'
614               file-paths: '{obj:gerrit_trigger_file_paths}'
615
616 - job-template:
617     name: '{project-name}-jjb-verify'
618     id: github-jjb-verify
619     <<: *lf_jjb_common
620     # yamllint disable-line rule:key-duplicates
621     <<: *lf_jjb_verify
622
623     properties:
624       - github:
625           url: '{git-url}/{github-org}/{project}'
626
627     scm:
628       - lf-infra-github-scm:
629           url: '{git-clone-url}{github-org}/{project}'
630           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
631           branch: '{branch}'
632           submodule-recursive: '{submodule-recursive}'
633           choosing-strategy: default
634           jenkins-ssh-credential: '{jenkins-ssh-credential}'
635
636     triggers:
637       - lf-infra-github-pr-trigger:
638           trigger-phrase: '^recheck$'
639           only-trigger-phrase: false
640           status-context: 'JJB Verify'
641           permit-all: true
642           github-hooks: true
643           github-org: ''
644           github_pr_whitelist:
645             - ''
646           github_pr_admin_list:
647             - ''
648
649 ################
650 # Packer Merge #
651 ################
652
653 - lf_packer_merge: &lf_packer_merge
654     name: lf-packer-merge
655
656     # Packer Merge job runs `packer build` to build system images in the cloud.
657     #
658     # Required parameters:
659     #
660     #     :build-node: The node to run build on.
661     #     :jenkins-ssh-credential: Credential to use for SSH. (Generally should
662     #         be configured in defaults.yaml)
663     #     :mvn-settings: The name of settings file containing credentials for
664     #         the project.
665     #     :platforms: Platform or distribution to build. Typically json file
666     #         found in the packer/vars directory. (Example: centos)
667     #     :template: System template to build. Typically shell script found in
668     #         the packer/provision directory. (Example: java-builder)
669     #
670     # Optional parameters:
671     #
672     #     :branch: Git branch to fetch for the build. (default: master)
673     #     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
674     #     :build-timeout: Timeout in seconds before aborting build. (default: 10)
675     #     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
676     #     :packer-cloud-settings: Name of settings file containing credentials
677     #         for the cloud that packer will build on. (default: packer-cloud-env)
678     #     :packer-version: Version of packer to install / use in build. (default: 1.0.2)
679     #     :stream: Keyword that can be used to represent a release code-name.
680     #         Often the same as the branch. (default: master)
681     #     :submodule-recursive: Whether to checkout submodules recursively.
682     #         (default: true)
683     #
684     #     :gerrit_verify_triggers: Override Gerrit Triggers.
685     #     :gerrit_trigger_file_paths: Override file paths which can be used to
686     #         filter which file modifications will trigger a build.
687     #         (default defined by lf_jjb_common)
688
689     ######################
690     # Default parameters #
691     ######################
692
693     gerrit_merge_triggers:
694       - change-merged-event
695       - comment-added-contains-event:
696           comment-contains-value: remerge$
697
698     #####################
699     # Job Configuration #
700     #####################
701
702     builders:
703       - lf-infra-packer-validate:
704           packer-cloud-settings: '{packer-cloud-settings}'
705           packer-version: '{packer-version}'
706       - lf-infra-packer-build:
707           packer-cloud-settings: '{packer-cloud-settings}'
708           packer-version: '{packer-version}'
709           platform: '{platforms}'
710           template: '{templates}'
711
712 - job-template:
713     name: '{project-name}-packer-merge-{platforms}-{templates}'
714     id: gerrit-packer-merge
715     <<: *lf_packer_common
716     # yamllint disable-line rule:key-duplicates
717     <<: *lf_packer_merge
718
719     git-url: '$GIT_URL/$GERRIT_PROJECT'
720
721     scm:
722       - lf-infra-gerrit-scm:
723           git-url: '{git-url}'
724           refspec: '$GERRIT_REFSPEC'
725           branch: '$GERRIT_BRANCH'
726           submodule-recursive: '{submodule-recursive}'
727           choosing-strategy: gerrit
728           jenkins-ssh-credential: '{jenkins-ssh-credential}'
729
730     triggers:
731       - timed: '00 10 1 * *'
732       - gerrit:
733           server-name: '{gerrit-server-name}'
734           trigger-on: '{obj:gerrit_merge_triggers}'
735           projects:
736             - project-compare-type: ANT
737               project-pattern: '{project}'
738               branches:
739                 - branch-compare-type: ANT
740                   branch-pattern: '**/{branch}'
741               <<: *lf_packer_file_paths
742
743 - job-template:
744     name: '{project-name}-packer-merge-{platforms}-{templates}'
745     id: github-packer-merge
746     <<: *lf_packer_common
747     # yamllint disable-line rule:key-duplicates
748     <<: *lf_packer_merge
749
750     properties:
751       - github:
752           url: '{git-url}/{github-org}/{project}'
753
754     scm:
755       - lf-infra-github-scm:
756           url: '{git-clone-url}{github-org}/{project}'
757           refspec: ''
758           branch: '{branch}'
759           submodule-recursive: '{submodule-recursive}'
760           choosing-strategy: default
761           jenkins-ssh-credential: '{jenkins-ssh-credential}'
762
763     triggers:
764       - timed: '00 10 1 * *'
765       - github
766       - pollscm:
767           cron: ''
768       - lf-infra-github-pr-trigger:
769           trigger-phrase: '^remerge$'
770           only-trigger-phrase: true
771           status-context: 'Packer {platforms}-${templates} Merge'
772           permit-all: false
773           github-hooks: true
774           github-org: '{github-org}'
775           github_pr_whitelist: '{obj:github_pr_whitelist}'
776           github_pr_admin_list: '{obj:github_pr_admin_list}'
777
778 #################
779 # Packer Verify #
780 #################
781
782 - lf_packer_verify: &lf_packer_verify
783     name: lf-packer-verify
784
785     # Packer Verify job runs `packer validate` to verify packer configuration.
786     #
787     # Required parameters:
788     #
789     #     :build-node: The node to run build on.
790     #     :jenkins-ssh-credential: Credential to use for SSH. (Generally should
791     #         be configured in defaults.yaml)
792     #     :mvn-settings: The name of settings file containing credentials for
793     #         the project.
794     #
795     # Optional parameters:
796     #
797     #     :branch: Git branch to fetch for the build. (default: master)
798     #     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
799     #     :build-timeout: Timeout in seconds before aborting build. (default: 10)
800     #     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
801     #     :packer-cloud-settings: Name of settings file containing credentials
802     #         for the cloud that packer will build on. (default: packer-cloud-env)
803     #     :packer-version: Version of packer to install / use in build. (default: 1.0.2)
804     #     :stream: Keyword that can be used to represent a release code-name.
805     #         Often the same as the branch. (default: master)
806     #     :submodule-recursive: Whether to checkout submodules recursively.
807     #         (default: true)
808     #
809     #     :gerrit_verify_triggers: Override Gerrit Triggers.
810     #     :gerrit_trigger_file_paths: Override file paths which can be used to
811     #         filter which file modifications will trigger a build.
812     #         (default defined by lf_jjb_common)
813
814     ######################
815     # Default parameters #
816     ######################
817
818     build-timeout: 10
819
820     gerrit_verify_triggers:
821       - patchset-created-event:
822           exclude-drafts: true
823           exclude-trivial-rebase: false
824           exclude-no-code-change: false
825       - draft-published-event
826       - comment-added-contains-event:
827           comment-contains-value: recheck$
828
829     #####################
830     # Job Configuration #
831     #####################
832
833     concurrent: true
834
835     builders:
836       - lf-infra-packer-validate:
837           packer-cloud-settings: '{packer-cloud-settings}'
838           packer-version: '{packer-version}'
839
840 - job-template:
841     name: '{project-name}-packer-verify'
842     id: gerrit-packer-verify
843     <<: *lf_packer_common
844     # yamllint disable-line rule:key-duplicates
845     <<: *lf_packer_verify
846
847     git-url: '$GIT_URL/$GERRIT_PROJECT'
848
849     scm:
850       - lf-infra-gerrit-scm:
851           git-url: '{git-url}'
852           refspec: '$GERRIT_REFSPEC'
853           branch: '$GERRIT_BRANCH'
854           submodule-recursive: '{submodule-recursive}'
855           choosing-strategy: gerrit
856           jenkins-ssh-credential: '{jenkins-ssh-credential}'
857
858     triggers:
859       - gerrit:
860           server-name: '{gerrit-server-name}'
861           trigger-on: '{obj:gerrit_verify_triggers}'
862           projects:
863             - project-compare-type: ANT
864               project-pattern: '{project}'
865               branches:
866                 - branch-compare-type: ANT
867                   branch-pattern: '**/{branch}'
868               <<: *lf_packer_verify_file_paths
869
870 - job-template:
871     name: '{project-name}-packer-verify'
872     id: github-packer-verify
873     <<: *lf_packer_common
874     # yamllint disable-line rule:key-duplicates
875     <<: *lf_packer_verify
876
877     properties:
878       - github:
879           url: '{git-url}/{github-org}/{project}'
880
881     scm:
882       - lf-infra-github-scm:
883           url: '{git-clone-url}{github-org}/{project}'
884           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
885           branch: '{branch}'
886           submodule-recursive: '{submodule-recursive}'
887           choosing-strategy: default
888           jenkins-ssh-credential: '{jenkins-ssh-credential}'
889
890     triggers:
891       - lf-infra-github-pr-trigger:
892           trigger-phrase: '^recheck$'
893           only-trigger-phrase: false
894           status-context: 'Packer Verify'
895           permit-all: true
896           github-hooks: true
897           github-org: ''
898           github_pr_whitelist:
899             - ''
900           github_pr_admin_list:
901             - ''