Remove use of user venv by build-jjb-verify job
[releng/global-jjb.git] / jjb / lf-ci-jobs.yaml
1 ---
2 ####################
3 # COMMON FUNCTIONS #
4 ####################
5
6 - builder:
7     name: lf-infra-jjbini
8     builders:
9       - config-file-provider:
10           files:
11             - file-id: jjbini
12               target: "$HOME/.config/jenkins_jobs/jenkins_jobs.ini"
13
14 - lf_packer: &lf_packer_common
15     name: lf-packer-common
16     # Provide configuration common in packer jobs.
17
18     ######################
19     # Default parameters #
20     ######################
21
22     branch: master
23     build-timeout: 90
24     cron: "@monthly"
25     disable-job: false
26     github-url: "https://github.com"
27     stream: master
28     submodule-recursive: true
29     submodule-timeout: 10
30     submodule-disable: false
31     packer-cloud-settings: packer-cloud-env
32     packer-version: 1.4.2
33
34     #####################
35     # Job Configuration #
36     #####################
37
38     project-type: freestyle
39     node: "{build-node}"
40     disabled: "{disable-job}"
41
42     properties:
43       - lf-infra-properties:
44           project: "{project}"
45           build-days-to-keep: 7
46
47     parameters:
48       - lf-infra-parameters:
49           project: "{project}"
50           stream: "{stream}"
51           branch: "{branch}"
52       - lf-packer-parameters:
53           packer-version: "{packer-version}"
54
55     wrappers:
56       - lf-infra-wrappers:
57           build-timeout: "{build-timeout}"
58           jenkins-ssh-credential: "{jenkins-ssh-credential}"
59
60     publishers:
61       - lf-infra-publish
62
63 - parameter:
64     name: lf-infra-jjb-parameters
65     parameters:
66       - string:
67           name: JJB_VERSION
68           default: "{jjb-version}"
69           description: Jenkins Job Builder version to download and install.
70       - string:
71           name: XDG_CACHE_HOME
72           default: "{jjb-cache}"
73           description: Jenkins Job Builder cache location.
74
75 - parameter:
76     name: lf-packer-parameters
77     parameters:
78       - string:
79           name: PACKER_VERSION
80           default: "{packer-version}"
81           description: Packer version to download and install.
82
83 - parameter:
84     name: lf-puppet-parameters
85     parameters:
86       - string:
87           name: PUPPET_LINT_VERSION
88           default: "{puppet-lint-version}"
89           description: Puppet-lint version to download and install.
90
91 - lf_jjb_common: &lf_jjb_common
92     name: lf-jjb-common
93
94     ######################
95     # Default parameters #
96     ######################
97
98     branch: master
99     build-timeout: 10
100     disable-job: false
101     github-url: "https://github.com"
102     jjb-cache: "$HOME/.cache/jenkins_jobs"
103     jjb-version: 2.8.0
104     stream: master
105     submodule-recursive: true
106     submodule-timeout: 10
107     submodule-disable: false
108     throttle_categories: []
109     throttle-enabled: false
110     throttle-max-per-node: 1
111     throttle-max-total: 0
112     throttle-option: "project"
113
114     gerrit_trigger_file_paths:
115       - compare-type: REG_EXP
116         pattern: "jjb/.*"
117       - compare-type: REG_EXP
118         pattern: "global-jjb"
119       - compare-type: REG_EXP
120         pattern: "shell/.*"
121
122     # github_included_regions MUST match gerrit_trigger_file_paths
123     github_included_regions:
124       - "jjb/.*"
125       - "global-jjb"
126       - "shell/.*"
127
128     #####################
129     # Job Configuration #
130     #####################
131
132     project-type: freestyle
133     node: "{build-node}"
134     disabled: "{disable-job}"
135
136     properties:
137       - lf-infra-properties:
138           project: "{project}"
139           build-days-to-keep: 7
140       - throttle:
141           categories: "{obj:throttle_categories}"
142           enabled: "{throttle-enabled}"
143           max-per-node: "{throttle-max-per-node}"
144           max-total: "{throttle-max-total}"
145           option: "{throttle-option}"
146
147     parameters:
148       - lf-infra-parameters:
149           project: "{project}"
150           stream: "{stream}"
151           branch: "{branch}"
152       - lf-infra-jjb-parameters:
153           jjb-cache: "{jjb-cache}"
154           jjb-version: "{jjb-version}"
155
156     wrappers:
157       - lf-infra-wrappers:
158           build-timeout: "{build-timeout}"
159           jenkins-ssh-credential: "{jenkins-ssh-credential}"
160
161     publishers:
162       - lf-infra-publish
163
164 ######################
165 # Gerrit Branch Lock #
166 ######################
167
168 - job-template:
169     name: "{project-name}-gerrit-branch-lock-{stream}"
170     id: gerrit-branch-lock
171
172     ######################
173     # Default parameters #
174     ######################
175
176     branch: master
177     disable-job: false
178     git-url: "$GIT_URL/$GERRIT_PROJECT"
179     stream: master
180     submodule-timeout: 10
181     submodule-disable: false
182     gerrit_merge_triggers:
183       - comment-added-contains-event:
184           comment-contains-value: (un)?lock branch$
185
186     #####################
187     # Job Configuration #
188     #####################
189
190     project-type: freestyle
191     node: "{build-node}"
192     disabled: "{disable-job}"
193
194     properties:
195       - lf-infra-properties:
196           project: "{project}"
197           build-days-to-keep: 1
198
199     parameters:
200       - lf-infra-parameters:
201           project: "{project}"
202           stream: "{stream}"
203           branch: "{branch}"
204
205     wrappers:
206       - lf-infra-wrappers:
207           build-timeout: 5
208           jenkins-ssh-credential: "{jenkins-ssh-credential}"
209
210     scm:
211       - lf-infra-gerrit-scm:
212           git-url: "{git-url}"
213           refspec: ""
214           branch: "{branch}"
215           submodule-recursive: false
216           submodule-timeout: "{submodule-timeout}"
217           submodule-disable: "{submodule-disable}"
218           choosing-strategy: default
219           jenkins-ssh-credential: "{jenkins-ssh-credential}"
220
221     triggers:
222       - gerrit:
223           server-name: "{gerrit-server-name}"
224           trigger-on: "{obj:gerrit_merge_triggers}"
225           projects:
226             - project-compare-type: ANT
227               project-pattern: "{project}"
228               branches:
229                 - branch-compare-type: ANT
230                   branch-pattern: "**/{branch}"
231
232     builders:
233       - shell: !include-raw-escape: ../shell/gerrit-branch-lock.sh
234
235     publishers:
236       - lf-infra-publish
237
238 ##########################################
239 # Jenkins Configuration Management Merge #
240 ##########################################
241
242 - builder:
243     name: lf-jenkins-cfg-clouds
244     builders:
245       - lf-infra-jjbini
246       - inject:
247           properties-content: "jenkins_silos={jenkins-silos}"
248       - shell: !include-raw-escape: ../shell/jenkins-configure-clouds.sh
249       - shell: rm -f "$HOME/.config/jenkins_jobs/jenkins_jobs.ini"
250
251 - builder:
252     name: lf-jenkins-cfg-global-vars
253     builders:
254       - lf-infra-jjbini
255       - inject:
256           properties-content: "jenkins_silos={jenkins-silos}"
257       - shell: !include-raw-escape: ../shell/jenkins-configure-global-vars.sh
258       - shell: rm -f "$HOME/.config/jenkins_jobs/jenkins_jobs.ini"
259
260 - lf_jenkins_configuration: &lf_jenkins_cfg_merge
261     name: lf-jenkins-cfg-merge
262
263     ######################
264     # Default parameters #
265     ######################
266
267     branch: master
268     cron: "@daily"
269     disable-job: false
270     git-url: "$GIT_URL/$GERRIT_PROJECT"
271     github-url: "https://github.com"
272     jenkins-silos: production sandbox
273     submodule-timeout: 10
274     submodule-disable: false
275
276     gerrit_merge_triggers:
277       - change-merged-event
278       - comment-added-contains-event:
279           comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
280
281     gerrit_trigger_file_paths:
282       - compare-type: REG_EXP
283         pattern: 'jenkins-config\/.*'
284
285     # github_included_regions MUST match gerrit_trigger_file_paths
286     github_included_regions:
287       - 'jenkins-config\/.*'
288
289     #####################
290     # Job Configuration #
291     #####################
292
293     project-type: freestyle
294     node: "{build-node}"
295     concurrent: false
296     disabled: "{disable-job}"
297
298     properties:
299       - lf-infra-properties:
300           project: "{project}"
301           build-days-to-keep: 1
302
303     parameters:
304       - lf-infra-parameters:
305           project: "{project}"
306           stream: ""
307           branch: master
308
309     wrappers:
310       - lf-infra-wrappers:
311           build-timeout: 10
312           jenkins-ssh-credential: "{jenkins-ssh-credential}"
313
314     builders:
315       - lf-infra-pre-build
316       - lf-jenkins-cfg-global-vars:
317           jenkins-silos: "{jenkins-silos}"
318       - lf-jenkins-cfg-clouds:
319           jenkins-silos: "{jenkins-silos}"
320
321     publishers:
322       - lf-infra-publish
323
324 - job-template:
325     name: "{project-name}-jenkins-cfg-merge"
326     id: gerrit-jenkins-cfg-merge
327     <<: *lf_jenkins_cfg_merge
328
329     scm:
330       - lf-infra-gerrit-scm:
331           git-url: "{git-url}"
332           refspec: "refs/heads/{branch}"
333           branch: "{branch}"
334           submodule-recursive: true
335           submodule-timeout: "{submodule-timeout}"
336           submodule-disable: "{submodule-disable}"
337           choosing-strategy: default
338           jenkins-ssh-credential: "{jenkins-ssh-credential}"
339
340     triggers:
341       - timed: "{obj:cron}"
342       - gerrit:
343           server-name: "{gerrit-server-name}"
344           trigger-on: "{obj:gerrit_merge_triggers}"
345           projects:
346             - project-compare-type: ANT
347               project-pattern: "{project}"
348               branches:
349                 - branch-compare-type: ANT
350                   branch-pattern: "**/{branch}"
351               file-paths: "{obj:gerrit_trigger_file_paths}"
352
353 - job-template:
354     name: "{project-name}-jenkins-cfg-merge"
355     id: github-jenkins-cfg-merge
356     <<: *lf_jenkins_cfg_merge
357
358     properties:
359       - lf-infra-properties:
360           project: "{project}"
361           build-days-to-keep: 1
362       - github:
363           url: "{github-url}/{github-org}/{project}"
364
365     scm:
366       - lf-infra-github-scm:
367           url: "{git-clone-url}{github-org}/{project}"
368           refspec: ""
369           branch: "refs/heads/{branch}"
370           submodule-recursive: true
371           submodule-timeout: "{submodule-timeout}"
372           submodule-disable: "{submodule-disable}"
373           choosing-strategy: default
374           jenkins-ssh-credential: "{jenkins-ssh-credential}"
375
376     triggers:
377       - timed: "{obj:cron}"
378       - github
379       - pollscm:
380           cron: ""
381       - github-pull-request:
382           trigger-phrase: "^remerge$"
383           only-trigger-phrase: true
384           status-context: "Jenkins CFG Merge"
385           permit-all: true
386           github-hooks: true
387           org-list:
388             - "{github-org}"
389           white-list: "{obj:github_pr_whitelist}"
390           admin-list: "{obj:github_pr_admin_list}"
391           included-regions: "{obj:github_included_regions}"
392           white-list-target-branches:
393             - "{branch}"
394
395 ###########################################
396 # Jenkins Configuration Management Verify #
397 ###########################################
398
399 - lf_jenkins_configuration: &lf_jenkins_cfg_verify
400     name: lf-jenkins-cfg-verify
401
402     ######################
403     # Default parameters #
404     ######################
405
406     branch: master
407     build-days-to-keep: 7
408     disable-job: false
409     git-url: "$GIT_URL/$GERRIT_PROJECT"
410     github-url: "https://github.com"
411     submodule-timeout: 10
412     submodule-disable: false
413
414     gerrit_verify_triggers:
415       - patchset-created-event:
416           exclude-drafts: true
417           exclude-trivial-rebase: false
418           exclude-no-code-change: false
419       - draft-published-event
420       - comment-added-contains-event:
421           comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
422
423     gerrit_trigger_file_paths:
424       - compare-type: REG_EXP
425         pattern: 'jenkins-config\/.*'
426
427     # github_included_regions MUST match gerrit_trigger_file_paths
428     github_included_regions:
429       - 'jenkins-config\/.*'
430
431     #####################
432     # Job Configuration #
433     #####################
434
435     project-type: freestyle
436     node: "{build-node}"
437     concurrent: true
438     disabled: "{disable-job}"
439
440     properties:
441       - lf-infra-properties:
442           project: "{project}"
443           build-days-to-keep: 1
444
445     parameters:
446       - lf-infra-parameters:
447           project: "{project}"
448           stream: ""
449           branch: master
450
451     wrappers:
452       - lf-infra-wrappers:
453           build-timeout: 10
454           jenkins-ssh-credential: "{jenkins-ssh-credential}"
455       - config-file-provider:
456           # Listed after to override openstack-infra-wrappers clouds.yaml
457           # definition
458           files:
459             - file-id: clouds-yaml
460               target: "$HOME/.config/openstack/clouds.yaml"
461             - file-id: npmrc
462               target: "$HOME/.npmrc"
463             - file-id: pipconf
464               target: "$HOME/.config/pip/pip.conf"
465
466     builders:
467       - lf-infra-pre-build
468       - shell: !include-raw-escape: ../shell/jenkins-verify-images.sh
469
470     publishers:
471       - lf-infra-publish
472
473 - job-template:
474     name: "{project-name}-jenkins-cfg-verify"
475     id: gerrit-jenkins-cfg-verify
476     <<: *lf_jenkins_cfg_verify
477
478     scm:
479       - lf-infra-gerrit-scm:
480           git-url: "{git-url}"
481           refspec: "$GERRIT_REFSPEC"
482           branch: "$GERRIT_BRANCH"
483           submodule-recursive: true
484           submodule-timeout: "{submodule-timeout}"
485           submodule-disable: "{submodule-disable}"
486           choosing-strategy: gerrit
487           jenkins-ssh-credential: "{jenkins-ssh-credential}"
488
489     triggers:
490       - gerrit:
491           server-name: "{gerrit-server-name}"
492           trigger-on: "{obj:gerrit_verify_triggers}"
493           projects:
494             - project-compare-type: ANT
495               project-pattern: "{project}"
496               branches:
497                 - branch-compare-type: ANT
498                   branch-pattern: "**/{branch}"
499               file-paths: "{obj:gerrit_trigger_file_paths}"
500
501 - job-template:
502     name: "{project-name}-jenkins-cfg-verify"
503     id: github-jenkins-cfg-verify
504     <<: *lf_jenkins_cfg_verify
505
506     properties:
507       - github:
508           url: "{github-url}/{github-org}/{project}"
509
510     scm:
511       - lf-infra-github-scm:
512           url: "{git-clone-url}{github-org}/{project}"
513           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
514           branch: "$sha1"
515           submodule-recursive: true
516           submodule-timeout: "{submodule-timeout}"
517           submodule-disable: "{submodule-disable}"
518           choosing-strategy: default
519           jenkins-ssh-credential: "{jenkins-ssh-credential}"
520
521     triggers:
522       - github-pull-request:
523           trigger-phrase: "^(recheck|reverify)$"
524           only-trigger-phrase: false
525           status-context: "Jenkins CFG Verify"
526           permit-all: true
527           github-hooks: true
528           included-regions: "{obj:github_included_regions}"
529           white-list-target-branches:
530             - "{branch}"
531
532 ###########################
533 # JENKINS SANDBOX CLEANUP #
534 ###########################
535
536 - lf_jenkins_sandbox_cleanup: &lf_jenkins_sandbox_cleanup
537     name: lf-jenkins-sandbox-cleanup
538
539     ######################
540     # Default parameters #
541     ######################
542
543     build-timeout: 30
544     # Run every Saturday at 08:00 UTC
545     cron: "0 8 * * 6"
546     disable-job: false
547
548     #####################
549     # Job Configuration #
550     #####################
551
552     project-type: freestyle
553     node: "{build-node}"
554     concurrent: true
555     disabled: "{disable-job}"
556
557     parameters:
558       - lf-infra-jjb-parameters:
559           jjb-cache: "{jjb-cache}"
560           jjb-version: "{jjb-version}"
561
562     triggers:
563       - timed: "{obj:cron}"
564
565     builders:
566       - lf-infra-jjbini
567       - shell: !include-raw-escape:
568           - ../shell/jjb-install.sh
569           - ../shell/jenkins-sandbox-cleanup.sh
570           - ../shell/jjb-cleanup.sh
571
572 - job-template:
573     name: "{project-name}-jenkins-sandbox-cleanup"
574     id: gerrit-jenkins-sandbox-cleanup
575     <<: *lf_jjb_common
576     # yamllint disable-line rule:key-duplicates
577     <<: *lf_jenkins_sandbox_cleanup
578
579 - job-template:
580     name: "{project-name}-jenkins-sandbox-cleanup"
581     id: github-jenkins-sandbox-cleanup
582     <<: *lf_jjb_common
583     # yamllint disable-line rule:key-duplicates
584     <<: *lf_jenkins_sandbox_cleanup
585
586 ##################
587 # JJB DEPLOY JOB #
588 ##################
589
590 - lf_jjb_deploy_job: &lf_jjb_deploy_job
591     name: lf-jjb-deploy-job
592
593     ######################
594     # Default parameters #
595     ######################
596
597     branch: master
598     disable-job: false
599     # jjb-deploy should always clone $PROJECT regardless of what
600     # $GERRIT_PROJECT triggered the job.
601     git-url: "$GIT_URL/$PROJECT"
602     github-url: "https://github.com"
603     stream: master
604     submodule-timeout: 10
605     submodule-disable: false
606     gerrit_jjb_deploy_job_triggers:
607       - comment-added-contains-event:
608           comment-contains-value: '^Patch Set\s+\d+:\s+(jjb-deploy[:]* (?!\*+$).+$)'
609
610     #####################
611     # Job Configuration #
612     #####################
613
614     project-type: freestyle
615     node: "{build-node}"
616     concurrent: true
617     disabled: "{disable-job}"
618
619     properties:
620       - lf-infra-properties:
621           project: "{project}"
622           build-days-to-keep: 1
623
624     parameters:
625       - lf-infra-parameters:
626           project: "{project}"
627           stream: "{stream}"
628           branch: "{branch}"
629
630     wrappers:
631       - lf-infra-wrappers:
632           build-timeout: 5
633           jenkins-ssh-credential: "{jenkins-ssh-credential}"
634
635     builders:
636       - lf-pip-install:
637           pip-packages: jenkins-job-builder
638       - lf-infra-jjbini
639       - shell: !include-raw-escape: ../shell/jjb-deploy-job.sh
640
641     publishers:
642       - lf-infra-publish
643
644 - job-template:
645     name: "{project-name}-jjb-deploy-job"
646     id: gerrit-jjb-deploy-job
647     <<: *lf_jjb_deploy_job
648
649     scm:
650       - lf-infra-gerrit-scm:
651           git-url: "{git-url}"
652           refspec: "refs/heads/{branch}"
653           branch: "{branch}"
654           submodule-recursive: true
655           submodule-timeout: "{submodule-timeout}"
656           submodule-disable: "{submodule-disable}"
657           choosing-strategy: default
658           jenkins-ssh-credential: "{jenkins-ssh-credential}"
659
660     triggers:
661       - gerrit:
662           server-name: "{gerrit-server-name}"
663           trigger-on: "{obj:gerrit_jjb_deploy_job_triggers}"
664           projects:
665             - project-compare-type: ANT
666               project-pattern: "**"
667               branches:
668                 - branch-compare-type: ANT
669                   branch-pattern: "**"
670           skip-vote:
671             success: true
672             failed: true
673             unstable: true
674             notbuilt: true
675
676 - job-template:
677     name: "{project-name}-jjb-deploy-job"
678     id: github-jjb-deploy-job
679     <<: *lf_jjb_deploy_job
680
681     properties:
682       - lf-infra-properties:
683           project: "{project}"
684           build-days-to-keep: 1
685       - github:
686           url: "{github-url}/{github-org}/{project}"
687
688     scm:
689       - lf-infra-github-scm:
690           url: "{git-clone-url}{github-org}/{project}"
691           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
692           branch: "$sha1"
693           submodule-recursive: true
694           submodule-timeout: "{submodule-timeout}"
695           submodule-disable: "{submodule-disable}"
696           choosing-strategy: default
697           jenkins-ssh-credential: "{jenkins-ssh-credential}"
698
699     triggers:
700       - github-pull-request:
701           trigger-phrase: '^jjb-deploy (?!\*+$).+$'
702           only-trigger-phrase: true
703           status-context: "JJB Deploy Job"
704           permit-all: true
705           github-hooks: true
706           white-list-target-branches:
707             - "{branch}"
708
709 #############
710 # JJB Merge #
711 #############
712
713 - lf_jjb_merge: &lf_jjb_merge
714     name: lf-jjb-merge
715
716     ######################
717     # Default parameters #
718     ######################
719
720     jjb-workers: 0
721
722     gerrit_merge_triggers:
723       - change-merged-event
724       - comment-added-contains-event:
725           comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
726
727     #####################
728     # Job Configuration #
729     #####################
730
731     builders:
732       - lf-infra-pre-build
733       - lf-infra-jjbini
734       - inject:
735           properties-content: JJB_WORKERS={jjb-workers}
736       - shell: !include-raw-escape:
737           - ../shell/jjb-install.sh
738           - ../shell/jjb-merge-job.sh
739           - ../shell/jjb-cleanup.sh
740
741 - job-template:
742     name: "{project-name}-jjb-merge"
743     id: gerrit-jjb-merge
744     <<: *lf_jjb_common
745     # yamllint disable-line rule:key-duplicates
746     <<: *lf_jjb_merge
747
748     git-url: "$GIT_URL/$GERRIT_PROJECT"
749
750     scm:
751       - lf-infra-gerrit-scm:
752           git-url: "{git-url}"
753           refspec: ""
754           branch: "{branch}"
755           submodule-recursive: "{submodule-recursive}"
756           submodule-timeout: "{submodule-timeout}"
757           submodule-disable: "{submodule-disable}"
758           choosing-strategy: default
759           jenkins-ssh-credential: "{jenkins-ssh-credential}"
760
761     triggers:
762       - gerrit:
763           server-name: "{gerrit-server-name}"
764           trigger-on: "{obj:gerrit_merge_triggers}"
765           projects:
766             - project-compare-type: ANT
767               project-pattern: "{project}"
768               branches:
769                 - branch-compare-type: ANT
770                   branch-pattern: "**/{branch}"
771               file-paths: "{obj:gerrit_trigger_file_paths}"
772
773 - job-template:
774     name: "{project-name}-jjb-merge"
775     id: github-jjb-merge
776     <<: *lf_jjb_common
777     # yamllint disable-line rule:key-duplicates
778     <<: *lf_jjb_merge
779
780     #####################
781     # Job Configuration #
782     #####################
783
784     properties:
785       - lf-infra-properties:
786           project: "{project}"
787           build-days-to-keep: 7
788       - github:
789           url: "{github-url}/{github-org}/{project}"
790
791     scm:
792       - lf-infra-github-scm:
793           url: "{git-clone-url}{github-org}/{project}"
794           refspec: ""
795           branch: "refs/heads/{branch}"
796           submodule-recursive: "{submodule-recursive}"
797           submodule-timeout: "{submodule-timeout}"
798           submodule-disable: "{submodule-disable}"
799           choosing-strategy: default
800           jenkins-ssh-credential: "{jenkins-ssh-credential}"
801
802     triggers:
803       - github
804       - pollscm:
805           cron: ""
806       - github-pull-request:
807           trigger-phrase: "^remerge$"
808           only-trigger-phrase: true
809           status-context: "JJB Merge"
810           permit-all: true
811           github-hooks: true
812           org-list:
813             - "{github-org}"
814           white-list: "{obj:github_pr_whitelist}"
815           admin-list: "{obj:github_pr_admin_list}"
816           included-regions: "{obj:github_included_regions}"
817           white-list-target-branches:
818             - "{branch}"
819
820 ##############
821 # JJB Verify #
822 ##############
823
824 - lf_jjb_verify: &lf_jjb_verify
825     name: lf-jjb-verify
826
827     ######################
828     # Default parameters #
829     ######################
830
831     build-concurrent: true
832
833     gerrit_verify_triggers:
834       - patchset-created-event:
835           exclude-drafts: true
836           exclude-trivial-rebase: false
837           exclude-no-code-change: false
838       - draft-published-event
839       - comment-added-contains-event:
840           comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
841
842     #####################
843     # Job Configuration #
844     #####################
845
846     concurrent: "{build-concurrent}"
847
848     builders:
849       - lf-infra-pre-build
850       - lf-infra-jjbini
851       - shell: !include-raw-escape:
852           - ../shell/jjb-verify-job.sh
853       - lf-infra-gpg-verify-git-signature
854
855 - job-template:
856     name: "{project-name}-jjb-verify"
857     id: gerrit-jjb-verify
858     <<: *lf_jjb_common
859     # yamllint disable-line rule:key-duplicates
860     <<: *lf_jjb_verify
861
862     ######################
863     # Default parameters #
864     ######################
865
866     git-url: "$GIT_URL/$GERRIT_PROJECT"
867
868     #####################
869     # Job Configuration #
870     #####################
871
872     scm:
873       - lf-infra-gerrit-scm:
874           git-url: "{git-url}"
875           refspec: "$GERRIT_REFSPEC"
876           branch: "$GERRIT_BRANCH"
877           submodule-recursive: "{submodule-recursive}"
878           submodule-timeout: "{submodule-timeout}"
879           submodule-disable: "{submodule-disable}"
880           choosing-strategy: gerrit
881           jenkins-ssh-credential: "{jenkins-ssh-credential}"
882
883     triggers:
884       - gerrit:
885           server-name: "{gerrit-server-name}"
886           trigger-on: "{obj:gerrit_verify_triggers}"
887           projects:
888             - project-compare-type: ANT
889               project-pattern: "{project}"
890               branches:
891                 - branch-compare-type: ANT
892                   branch-pattern: "**/{branch}"
893               file-paths: "{obj:gerrit_trigger_file_paths}"
894
895 - job-template:
896     name: "{project-name}-jjb-verify"
897     id: github-jjb-verify
898     <<: *lf_jjb_common
899     # yamllint disable-line rule:key-duplicates
900     <<: *lf_jjb_verify
901
902     #####################
903     # Job Configuration #
904     #####################
905
906     properties:
907       - lf-infra-properties:
908           project: "{project}"
909           build-days-to-keep: 7
910       - github:
911           url: "{github-url}/{github-org}/{project}"
912
913     scm:
914       - lf-infra-github-scm:
915           url: "{git-clone-url}{github-org}/{project}"
916           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
917           branch: "$sha1"
918           submodule-recursive: "{submodule-recursive}"
919           submodule-timeout: "{submodule-timeout}"
920           submodule-disable: "{submodule-disable}"
921           choosing-strategy: default
922           jenkins-ssh-credential: "{jenkins-ssh-credential}"
923
924     triggers:
925       - github-pull-request:
926           trigger-phrase: "^(recheck|reverify)$"
927           only-trigger-phrase: false
928           status-context: "JJB Verify"
929           permit-all: true
930           github-hooks: true
931           included-regions: "{obj:github_included_regions}"
932           white-list-target-branches:
933             - "{branch}"
934
935 ############################
936 # JJB Verify Upstream GJJB #
937 ############################
938
939 - lf_jjb_verify: &lf_jjb_verify_upstream_gjjb
940     name: lf-jjb-verify-upstream-gjjb
941
942     #####################
943     # Job Configuration #
944     #####################
945
946     concurrent: true
947
948     builders:
949       - shell: |
950           cd global-jjb
951           git fetch https://gerrit.linuxfoundation.org/infra/releng/global-jjb $GERRIT_REFSPEC
952           git cherry-pick FETCH_HEAD
953       - lf-infra-jjbini
954       - shell: !include-raw-escape:
955           - ../shell/jjb-verify-job.sh
956       - lf-infra-gpg-verify-git-signature
957
958 - job-template:
959     name: "{project-name}-jjb-verify-upstream-gjjb"
960     id: gerrit-jjb-verify-upstream-gjjb
961     <<: *lf_jjb_common
962     # yamllint disable-line rule:key-duplicates
963     <<: *lf_jjb_verify_upstream_gjjb
964
965     ######################
966     # Default parameters #
967     ######################
968
969     git-url: "$GIT_URL/$PROJECT"
970     submodule-timeout: 10
971     submodule-disable: false
972
973     #####################
974     # Job Configuration #
975     #####################
976
977     scm:
978       - lf-infra-gerrit-scm:
979           git-url: "{git-url}"
980           refspec: ""
981           branch: "master"
982           submodule-recursive: true
983           submodule-timeout: "{submodule-timeout}"
984           submodule-disable: "{submodule-disable}"
985           choosing-strategy: default
986           jenkins-ssh-credential: "{jenkins-ssh-credential}"
987
988     triggers:
989       - gerrit:
990           server-name: "LinuxFoundation"
991           trigger-on:
992             - patchset-created-event:
993                 exclude-drafts: true
994                 exclude-trivial-rebase: false
995                 exclude-no-code-change: false
996             - draft-published-event
997             - comment-added-contains-event:
998                 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
999           projects:
1000             - project-compare-type: ANT
1001               project-pattern: "releng/global-jjb"
1002               branches:
1003                 - branch-compare-type: ANT
1004                   branch-pattern: "**/master"
1005           override-votes: true
1006           gerrit-build-failed-codereview-value: -1
1007           gerrit-build-failed-verified-value: 0
1008           gerrit-build-successful-codereview-value: 1
1009           gerrit-build-successful-verified-value: 0
1010
1011 #################
1012 # License Check #
1013 #################
1014
1015 - lf_license_check: &lf_license_check
1016     name: lf-license-check
1017
1018     ######################
1019     # Default parameters #
1020     ######################
1021
1022     branch: master
1023     build-days-to-keep: 7
1024     build-timeout: 15
1025     disable-job: false
1026     file-patterns: >
1027       *.go
1028       *.groovy
1029       *.java
1030       *.py
1031       *.sh
1032     git-url: "$GIT_URL/$PROJECT"
1033     github-url: "https://github.com"
1034     lhc-version: 0.2.0
1035     license-exclude-paths: ""
1036     licenses-allowed: Apache-2.0,EPL-1.0,MIT
1037     project-pattern: "**"
1038     spdx-disable: false
1039     stream: master
1040     submodule-timeout: 10
1041     submodule-disable: false
1042
1043     #####################
1044     # Job Configuration #
1045     #####################
1046
1047     project-type: freestyle
1048     node: "{build-node}"
1049     concurrent: true
1050     disabled: "{disable-job}"
1051
1052     properties:
1053       - lf-infra-properties:
1054           build-days-to-keep: "{build-days-to-keep}"
1055
1056     parameters:
1057       - lf-infra-parameters:
1058           project: "{project}"
1059           branch: "{branch}"
1060           stream: "{stream}"
1061
1062     wrappers:
1063       - lf-infra-wrappers:
1064           build-timeout: "{build-timeout}"
1065           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1066
1067     builders:
1068       - lf-license-check:
1069           file-patterns: "{file-patterns}"
1070           spdx-disable: "{spdx-disable}"
1071           lhc-version: "{lhc-version}"
1072           license-exclude-paths: "{license-exclude-paths}"
1073           licenses-allowed: "{licenses-allowed}"
1074
1075     publishers:
1076       - lf-infra-publish
1077
1078 - job-template:
1079     name: "{project-name}-license-check"
1080     id: gerrit-license-check
1081     <<: *lf_license_check
1082
1083     git-url: "$GIT_URL/$GERRIT_PROJECT"
1084
1085     scm:
1086       - lf-infra-gerrit-scm:
1087           git-url: "{git-url}"
1088           refspec: "$GERRIT_REFSPEC"
1089           branch: "$GERRIT_BRANCH"
1090           # Submodules are out of the project's control
1091           submodule-recursive: false
1092           submodule-timeout: "{submodule-timeout}"
1093           submodule-disable: "{submodule-disable}"
1094           choosing-strategy: gerrit
1095           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1096
1097     triggers:
1098       - gerrit:
1099           server-name: "{gerrit-server-name}"
1100           # Trigger should not be overridable as we want to always run
1101           trigger-on:
1102             - patchset-created-event:
1103                 exclude-drafts: false
1104                 exclude-trivial-rebase: false
1105                 exclude-no-code-change: false
1106             - draft-published-event
1107             - comment-added-contains-event:
1108                 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
1109           projects:
1110             - project-compare-type: ANT
1111               project-pattern: "{project-pattern}"
1112               branches:
1113                 - branch-compare-type: ANT
1114                   branch-pattern: "**"
1115
1116 - job-template:
1117     name: "{project-name}-license-check"
1118     id: github-license-check
1119     <<: *lf_license_check
1120
1121     properties:
1122       - lf-infra-properties:
1123           build-days-to-keep: "{build-days-to-keep}"
1124       - github:
1125           url: "{github-url}/{github-org}/{project}"
1126
1127     scm:
1128       - lf-infra-github-scm:
1129           url: "{git-clone-url}{github-org}/{project}"
1130           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
1131           branch: "$sha1"
1132           # Submodules are out of the project's control
1133           submodule-recursive: false
1134           submodule-timeout: "{submodule-timeout}"
1135           submodule-disable: "{submodule-disable}"
1136           choosing-strategy: default
1137           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1138
1139     triggers:
1140       - github-pull-request:
1141           trigger-phrase: "^recheck$"
1142           only-trigger-phrase: false
1143           status-context: "License Check"
1144           permit-all: true
1145           github-hooks: true
1146           white-list-target-branches:
1147             - "{branch}"
1148
1149 ####################
1150 # Info YAML Verify #
1151 ####################
1152
1153 - lf_info_yaml_verify: &lf_info_yaml_verify
1154     name: lf-info-yaml-verify
1155
1156     ######################
1157     # Default parameters #
1158     ######################
1159
1160     gerrit_verify_triggers:
1161       - patchset-created-event:
1162           exclude-drafts: true
1163           exclude-trivial-rebase: false
1164           exclude-no-code-change: false
1165       - draft-published-event
1166       - comment-added-contains-event:
1167           comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
1168
1169     #####################
1170     # Job Configuration #
1171     #####################
1172
1173     concurrent: true
1174
1175     builders:
1176       - shell: !include-raw-escape:
1177           - ../shell/git-validate-info-yaml.sh
1178           - ../shell/info-file-validate.sh
1179
1180 - job-template:
1181     name: "{project-name}-info-yaml-verify"
1182     id: gerrit-info-yaml-verify
1183     <<: *lf_jjb_common
1184     # yamllint disable-line rule:key-duplicates
1185     <<: *lf_info_yaml_verify
1186
1187     git-url: "$GIT_URL/$GERRIT_PROJECT"
1188
1189     scm:
1190       - lf-infra-gerrit-scm:
1191           git-url: "{git-url}"
1192           refspec: "$GERRIT_REFSPEC"
1193           branch: "$GERRIT_BRANCH"
1194           submodule-recursive: "{submodule-recursive}"
1195           submodule-timeout: "{submodule-timeout}"
1196           submodule-disable: "{submodule-disable}"
1197           choosing-strategy: gerrit
1198           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1199
1200     triggers:
1201       - gerrit:
1202           server-name: "{gerrit-server-name}"
1203           trigger-on: "{obj:gerrit_verify_triggers}"
1204           projects:
1205             - project-compare-type: ANT
1206               project-pattern: "{project}"
1207               branches:
1208                 - branch-compare-type: ANT
1209                   branch-pattern: "**/{branch}"
1210               file-paths:
1211                 - compare-type: REG_EXP
1212                   pattern: "INFO.yaml"
1213
1214 - job-template:
1215     name: "{project-name}-info-yaml-verify"
1216     id: github-info-yaml-verify
1217     <<: *lf_jjb_common
1218     # yamllint disable-line rule:key-duplicates
1219     <<: *lf_info_yaml_verify
1220
1221     github-url: "https://github.com"
1222     properties:
1223       - github:
1224           url: "{github-url}/{github-org}/{project}"
1225
1226     scm:
1227       - lf-infra-github-scm:
1228           url: "{git-clone-url}{github-org}/{project}"
1229           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
1230           branch: "$sha1"
1231           submodule-recursive: "{submodule-recursive}"
1232           submodule-timeout: "{submodule-timeout}"
1233           submodule-disable: "{submodule-disable}"
1234           choosing-strategy: default
1235           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1236
1237     triggers:
1238       - github-pull-request:
1239           trigger-phrase: "^(recheck|reverify)$"
1240           only-trigger-phrase: false
1241           status-context: "INFO File Verify"
1242           permit-all: true
1243           github-hooks: true
1244           # included-regions MUST match gerrit file-paths
1245           included-regions: "INFO.yaml"
1246           white-list-target-branches:
1247             - "{branch}"
1248
1249 ##################
1250 # OPENSTACK CRON #
1251 ##################
1252
1253 - lf_openstack_cron: &lf_openstack_cron
1254     name: lf-openstack-cron
1255
1256     ######################
1257     # Default parameters #
1258     ######################
1259
1260     branch: master
1261     build-days-to-keep: 7
1262     build-timeout: 10
1263     cron: "@hourly"
1264     disable-job: false
1265     git-url: "$GIT_URL/$PROJECT"
1266     github-url: "https://github.com"
1267     openstack-cloud: vex
1268     openstack-image-cleanup: true
1269     openstack-image-cleanup-age: 30
1270     openstack-image-protect: true
1271     openstack-port-cleanup: true
1272     openstack-server-cleanup: true
1273     openstack-stack-cleanup: true
1274     openstack-volume-cleanup: true
1275     stream: master
1276     submodule-timeout: 10
1277     submodule-disable: false
1278
1279     #####################
1280     # Job Configuration #
1281     #####################
1282
1283     project-type: freestyle
1284     node: "{build-node}"
1285     concurrent: false
1286     disabled: "{disable-job}"
1287
1288     properties:
1289       - lf-infra-properties:
1290           build-days-to-keep: "{build-days-to-keep}"
1291
1292     parameters:
1293       - lf-infra-parameters:
1294           project: "{project}"
1295           stream: "{stream}"
1296           branch: "{branch}"
1297       - string:
1298           name: JENKINS_URLS
1299           default: "{jenkins-urls}"
1300           description: |
1301             Space separated list of Jenkins URLs to check for active builds.
1302
1303     wrappers:
1304       - lf-infra-wrappers:
1305           build-timeout: "{build-timeout}"
1306           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1307       # Listed after to override openstack-infra-wrappers clouds.yaml definition
1308       - config-file-provider:
1309           files:
1310             - file-id: clouds-yaml
1311               target: "$HOME/.config/openstack/clouds.yaml"
1312             - file-id: npmrc
1313               target: "$HOME/.npmrc"
1314             - file-id: pipconf
1315               target: "$HOME/.config/pip/pip.conf"
1316
1317     triggers:
1318       - timed: "{obj:cron}"
1319
1320     builders:
1321       - lf-infra-pre-build
1322       - inject:
1323           properties-content: OS_CLOUD={openstack-cloud}
1324       # Stacks
1325       - conditional-step:
1326           condition-kind: boolean-expression
1327           condition-expression: "{openstack-stack-cleanup}"
1328           steps:
1329             - shell: !include-raw-escape: ../shell/openstack-cleanup-orphaned-stacks.sh
1330       # Servers
1331       - conditional-step:
1332           condition-kind: boolean-expression
1333           condition-expression: "{openstack-server-cleanup}"
1334           steps:
1335             - shell: !include-raw-escape: ../shell/openstack-cleanup-orphaned-servers.sh
1336       # Ports
1337       - conditional-step:
1338           condition-kind: boolean-expression
1339           condition-expression: "{openstack-port-cleanup}"
1340           steps:
1341             - shell: !include-raw-escape: ../shell/openstack-cleanup-orphaned-ports.sh
1342       # Volumes
1343       - conditional-step:
1344           condition-kind: boolean-expression
1345           condition-expression: "{openstack-volume-cleanup}"
1346           steps:
1347             - shell: !include-raw-escape: ../shell/openstack-cleanup-orphaned-volumes.sh
1348       # Images
1349       - conditional-step:
1350           condition-kind: boolean-expression
1351           condition-expression: "{openstack-image-protect}"
1352           steps:
1353             - shell: !include-raw-escape: ../shell/openstack-protect-in-use-images.sh
1354       - conditional-step:
1355           condition-kind: boolean-expression
1356           condition-expression: "{openstack-image-cleanup}"
1357           steps:
1358             - inject:
1359                 properties-content: OS_IMAGE_CLEANUP_AGE={openstack-image-cleanup-age}
1360             - shell: !include-raw-escape: ../shell/openstack-cleanup-old-images.sh
1361
1362     publishers:
1363       - lf-infra-publish
1364
1365 - job-template:
1366     name: "{project-name}-openstack-cron"
1367     id: gerrit-openstack-cron
1368     <<: *lf_openstack_cron
1369
1370     scm:
1371       - lf-infra-gerrit-scm:
1372           git-url: "{git-url}"
1373           refspec: "refs/heads/{branch}"
1374           branch: "{branch}"
1375           submodule-recursive: true
1376           submodule-timeout: "{submodule-timeout}"
1377           submodule-disable: "{submodule-disable}"
1378           choosing-strategy: default
1379           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1380
1381 - job-template:
1382     name: "{project-name}-openstack-cron"
1383     id: github-openstack-cron
1384     <<: *lf_openstack_cron
1385
1386     scm:
1387       - lf-infra-github-scm:
1388           url: "{git-clone-url}{github-org}/{project}"
1389           refspec: ""
1390           branch: "refs/heads/{branch}"
1391           submodule-recursive: true
1392           submodule-timeout: "{submodule-timeout}"
1393           submodule-disable: "{submodule-disable}"
1394           choosing-strategy: default
1395           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1396
1397 ################
1398 # Packer Merge #
1399 ################
1400
1401 - lf_packer_merge: &lf_packer_merge
1402     name: lf-packer-merge
1403
1404     ######################
1405     # Default parameters #
1406     ######################
1407
1408     openstack: true
1409     openstack-cloud: vex
1410     update-cloud-image: false
1411
1412     #####################
1413     # Job Configuration #
1414     #####################
1415
1416     parameters:
1417       - lf-infra-parameters:
1418           project: "{project}"
1419           stream: "{stream}"
1420           branch: "{branch}"
1421       - lf-packer-parameters:
1422           packer-version: "{packer-version}"
1423       - bool:
1424           name: UPDATE_CLOUD_IMAGE
1425           default: "{update-cloud-image}"
1426           description: "Update new built image on the cloud."
1427
1428     builders:
1429       - lf-infra-packer-build:
1430           openstack: "{openstack}"
1431           openstack-cloud: "{openstack-cloud}"
1432           packer-cloud-settings: "{packer-cloud-settings}"
1433           packer-version: "{packer-version}"
1434           platform: "{platforms}"
1435           template: "{templates}"
1436           update-cloud-image: "{update-cloud-image}"
1437       - description-setter:
1438           regexp: '(\s+.*)(ZZCI\s+.*\d+-\d+\.\d+)'
1439           description: 'Image: \2'
1440       # - trigger-builds:
1441       #     - project: '{project-name}-openstack-update-cloud-image'
1442       #       block: false
1443       #       predefined-parameters: |
1444       #         GERRIT_BRANCH=$GERRIT_BRANCH
1445       #         GERRIT_PROJECT=$GERRIT_PROJECT
1446       #         GERRIT_REFSPEC=$GERRIT_REFSPEC
1447       #         NEW_IMAGE_NAME=$NEW_IMAGE_NAME
1448       #       property-file: variables.jenkins-trigger
1449       #       property-file-fail-on-missing: true
1450
1451     publishers:
1452       - lf-infra-publish
1453       - trigger-parameterized-builds:
1454           - project: "{project-name}-openstack-update-cloud-image"
1455             condition: UNSTABLE_OR_BETTER
1456             predefined-parameters: |
1457               NEW_IMAGE_NAME=$NEW_IMAGE_NAME
1458             property-file: variables.jenkins-trigger
1459             fail-on-missing: true
1460
1461 - job-template:
1462     name: "{project-name}-packer-merge-{platforms}-{templates}"
1463     id: gerrit-packer-merge
1464     <<: *lf_packer_common
1465     # yamllint disable-line rule:key-duplicates
1466     <<: *lf_packer_merge
1467
1468     ######################
1469     # Default parameters #
1470     ######################
1471
1472     git-url: "$GIT_URL/$GERRIT_PROJECT"
1473
1474     gerrit_merge_triggers:
1475       - change-merged-event
1476       - comment-added-contains-event:
1477           comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
1478
1479     #####################
1480     # Job Configuration #
1481     #####################
1482
1483     scm:
1484       - lf-infra-gerrit-scm:
1485           git-url: "{git-url}"
1486           refspec: "$GERRIT_REFSPEC"
1487           branch: "$GERRIT_BRANCH"
1488           submodule-recursive: "{submodule-recursive}"
1489           submodule-timeout: "{submodule-timeout}"
1490           submodule-disable: "{submodule-disable}"
1491           choosing-strategy: default
1492           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1493
1494     triggers:
1495       - timed: "{obj:cron}"
1496       - gerrit:
1497           server-name: "{gerrit-server-name}"
1498           trigger-on: "{obj:gerrit_merge_triggers}"
1499           projects:
1500             - project-compare-type: ANT
1501               project-pattern: "{project}"
1502               branches:
1503                 - branch-compare-type: ANT
1504                   branch-pattern: "**/{branch}"
1505               file-paths:
1506                 - compare-type: REG_EXP
1507                   pattern: 'packer\/provision\/.*\.sh'
1508                 - compare-type: REG_EXP
1509                   pattern: 'packer\/provision\/.*\.bat'
1510                 - compare-type: REG_EXP
1511                   pattern: 'packer\/provision\/.*\.ps1'
1512                 - compare-type: REG_EXP
1513                   pattern: 'packer\/provision\/{templates}\.yaml'
1514                 - compare-type: REG_EXP
1515                   pattern: 'packer\/provision\/local-{templates}\.yaml'
1516                 - compare-type: REG_EXP
1517                   pattern: 'packer\/templates\/{templates}\.json'
1518                 - compare-type: REG_EXP
1519                   pattern: 'packer\/vars\/{platforms}\.json'
1520
1521 - job-template:
1522     name: "{project-name}-packer-merge-{platforms}-{templates}"
1523     id: github-packer-merge
1524     <<: *lf_packer_common
1525     # yamllint disable-line rule:key-duplicates
1526     <<: *lf_packer_merge
1527
1528     #####################
1529     # Job Configuration #
1530     #####################
1531
1532     properties:
1533       - lf-infra-properties:
1534           project: "{project}"
1535           build-days-to-keep: 7
1536       - github:
1537           url: "{github-url}/{github-org}/{project}"
1538
1539     scm:
1540       - lf-infra-github-scm:
1541           url: "{git-clone-url}{github-org}/{project}"
1542           refspec: >
1543             +refs/heads/*:refs/remotes/origin/*
1544             +refs/pull/*:refs/remotes/origin/pr/*
1545           branch: "$GERRIT_REFSPEC"
1546           submodule-recursive: "{submodule-recursive}"
1547           submodule-timeout: "{submodule-timeout}"
1548           submodule-disable: "{submodule-disable}"
1549           choosing-strategy: default
1550           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1551
1552     triggers:
1553       - timed: "{obj:cron}"
1554       - github
1555       - pollscm:
1556           cron: ""
1557
1558       - github-pull-request:
1559           trigger-phrase: "^remerge$"
1560           only-trigger-phrase: true
1561           status-context: "Packer {platforms}-{templates} Merge"
1562           permit-all: true
1563           github-hooks: true
1564           org-list:
1565             - "{github-org}"
1566           white-list: "{obj:github_pr_whitelist}"
1567           admin-list: "{obj:github_pr_admin_list}"
1568           # included-regions MUST match Gerrit Trigger file-paths
1569           included-regions:
1570             - 'packer\/provision\/.*\.sh'
1571             - 'packer\/provision\/.*\.bat'
1572             - 'packer\/provision\/.*\.ps1'
1573             - 'packer\/provision\/{templates}\.yaml'
1574             - 'packer\/provision\/local-{templates}\.yaml'
1575             - 'packer\/templates\/{templates}\.json'
1576             - 'packer\/vars\/{platforms}\.json'
1577           white-list-target-branches:
1578             - "{branch}"
1579
1580 #################
1581 # Packer Verify #
1582 #################
1583
1584 - lf_packer_verify: &lf_packer_verify
1585     name: lf-packer-verify
1586
1587     ######################
1588     # Default parameters #
1589     ######################
1590
1591     build-timeout: 10
1592     openstack: true
1593     openstack-cloud: vex
1594
1595     gerrit_verify_triggers:
1596       - patchset-created-event:
1597           exclude-drafts: true
1598           exclude-trivial-rebase: false
1599           exclude-no-code-change: false
1600       - draft-published-event
1601       - comment-added-contains-event:
1602           comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
1603
1604     gerrit_trigger_file_paths:
1605       - compare-type: REG_EXP
1606         pattern: 'packer\/.*'
1607
1608     # github_included_regions MUST match gerrit_trigger_file_paths
1609     github_included_regions:
1610       - 'packer\/.*'
1611
1612     #####################
1613     # Job Configuration #
1614     #####################
1615
1616     concurrent: true
1617
1618     builders:
1619       - lf-infra-packer-validate:
1620           openstack: "{openstack}"
1621           openstack-cloud: "{openstack-cloud}"
1622           packer-cloud-settings: "{packer-cloud-settings}"
1623           packer-version: "{packer-version}"
1624
1625 - job-template:
1626     name: "{project-name}-packer-verify"
1627     id: gerrit-packer-verify
1628     <<: *lf_packer_common
1629     # yamllint disable-line rule:key-duplicates
1630     <<: *lf_packer_verify
1631
1632     ######################
1633     # Default parameters #
1634     ######################
1635
1636     git-url: "$GIT_URL/$GERRIT_PROJECT"
1637
1638     #####################
1639     # Job Configuration #
1640     #####################
1641
1642     scm:
1643       - lf-infra-gerrit-scm:
1644           git-url: "{git-url}"
1645           refspec: "$GERRIT_REFSPEC"
1646           branch: "$GERRIT_BRANCH"
1647           submodule-recursive: "{submodule-recursive}"
1648           submodule-timeout: "{submodule-timeout}"
1649           submodule-disable: "{submodule-disable}"
1650           choosing-strategy: gerrit
1651           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1652
1653     triggers:
1654       - gerrit:
1655           server-name: "{gerrit-server-name}"
1656           trigger-on: "{obj:gerrit_verify_triggers}"
1657           projects:
1658             - project-compare-type: ANT
1659               project-pattern: "{project}"
1660               branches:
1661                 - branch-compare-type: ANT
1662                   branch-pattern: "**/{branch}"
1663               file-paths: "{obj:gerrit_trigger_file_paths}"
1664
1665 - job-template:
1666     name: "{project-name}-packer-verify"
1667     id: github-packer-verify
1668     <<: *lf_packer_common
1669     # yamllint disable-line rule:key-duplicates
1670     <<: *lf_packer_verify
1671
1672     #####################
1673     # Job Configuration #
1674     #####################
1675
1676     properties:
1677       - lf-infra-properties:
1678           project: "{project}"
1679           build-days-to-keep: 7
1680       - github:
1681           url: "{github-url}/{github-org}/{project}"
1682
1683     scm:
1684       - lf-infra-github-scm:
1685           url: "{git-clone-url}{github-org}/{project}"
1686           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
1687           branch: "$sha1"
1688           submodule-recursive: "{submodule-recursive}"
1689           submodule-timeout: "{submodule-timeout}"
1690           submodule-disable: "{submodule-disable}"
1691           choosing-strategy: default
1692           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1693
1694     triggers:
1695       - github-pull-request:
1696           trigger-phrase: "^(recheck|reverify)$"
1697           only-trigger-phrase: false
1698           status-context: "Packer Verify"
1699           permit-all: true
1700           github-hooks: true
1701           included-regions: "{obj:github_included_regions}"
1702           white-list-target-branches:
1703             - "{branch}"
1704
1705 ################################
1706 # Openstack Update Cloud Image #
1707 ################################
1708
1709 - lf_openstack_cron: &lf_openstack_update_cloud_image
1710     name: lf-openstack-update-cloud-image
1711
1712     ######################
1713     # Default parameters #
1714     ######################
1715
1716     branch: master
1717     build-days-to-keep: 7
1718     build-timeout: 10
1719     cron: "@monthly"
1720     disable-job: false
1721     git-url: "$GIT_URL/$PROJECT"
1722     github-url: "https://github.com"
1723     new-image-name: "all"
1724     openstack-cloud: vex
1725     stream: master
1726     submodule-timeout: 10
1727     submodule-disable: false
1728     update-cloud-image: false
1729
1730     #####################
1731     # Job Configuration #
1732     #####################
1733
1734     project-type: freestyle
1735     node: "{build-node}"
1736     concurrent: false
1737     disabled: "{disable-job}"
1738
1739     properties:
1740       - lf-infra-properties:
1741           build-days-to-keep: "{build-days-to-keep}"
1742
1743     parameters:
1744       - lf-infra-parameters:
1745           project: "{project}"
1746           stream: "{stream}"
1747           branch: "{branch}"
1748       - string:
1749           name: NEW_IMAGE_NAME
1750           default: "{new-image-name}"
1751           description: "Name of cloud image to update in Jenkins"
1752
1753     wrappers:
1754       - lf-infra-wrappers:
1755           build-timeout: "{build-timeout}"
1756           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1757       # Listed after to override openstack-infra-wrappers clouds.yaml definition
1758       - config-file-provider:
1759           files:
1760             - file-id: clouds-yaml
1761               target: "$HOME/.config/openstack/clouds.yaml"
1762             - file-id: npmrc
1763               target: "$HOME/.npmrc"
1764             - file-id: pipconf
1765               target: "$HOME/.config/pip/pip.conf"
1766
1767     builders:
1768       - lf-infra-pre-build
1769       - inject:
1770           properties-content: |
1771             OS_CLOUD={openstack-cloud}
1772       - shell: |
1773           #!/bin/bash
1774           echo "Extract the image type for commit message"
1775           # echo IMAGE_TYPE=${{NEW_IMAGE_NAME% -*}} >> image-type.txt
1776           IMAGE_TYPE=$(echo ${{NEW_IMAGE_NAME}} | tr -d "\'\"\ " | awk -F- '{{ print $2 " " $3 " " $4 }}')
1777           echo IMAGE_TYPE=${{IMAGE_TYPE}} >> image-type.txt
1778           cat image-type.txt
1779       - inject:
1780           properties-file: "image-type.txt"
1781       - lf-infra-update-packer-images
1782       - lf-infra-push-gerrit-patch:
1783           project: "{project}"
1784           gerrit-user: "{gerrit-user}"
1785           gerrit-host: "{gerrit-host}"
1786           gerrit-topic: "{gerrit-topic}"
1787           gerrit-commit-message: "Update cloud image $IMAGE_TYPE"
1788           reviewers-email: "{reviewers-email}"
1789
1790     publishers:
1791       - lf-infra-publish
1792
1793 - job-template:
1794     name: "{project-name}-openstack-update-cloud-image"
1795     id: gerrit-openstack-update-cloud-image
1796     <<: *lf_openstack_update_cloud_image
1797
1798     ######################
1799     # Default parameters #
1800     ######################
1801
1802     git-url: "$GIT_URL/$GERRIT_PROJECT"
1803
1804     #####################
1805     # Job Configuration #
1806     #####################
1807
1808     scm:
1809       - lf-infra-gerrit-scm:
1810           git-url: "{git-url}"
1811           refspec: "$GERRIT_REFSPEC"
1812           branch: "$GERRIT_BRANCH"
1813           submodule-recursive: false
1814           submodule-timeout: "{submodule-timeout}"
1815           submodule-disable: "{submodule-disable}"
1816           choosing-strategy: gerrit
1817           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1818
1819     triggers:
1820       - timed: "{obj:cron}"
1821
1822 #################
1823 # Puppet Verify #
1824 #################
1825
1826 - lf_puppet_verify: &lf_puppet_verify
1827     name: lf-puppet-verify
1828
1829     ######################
1830     # Default parameters #
1831     ######################
1832
1833     branch: master
1834     build-days-to-keep: 7
1835     build-timeout: 15
1836     disable-job: false
1837     git-url: "$GIT_URL/$GERRIT_PROJECT"
1838     github-url: "https://github.com"
1839     parallel: true
1840     puppet-dir: ""
1841     puppet-lint-version: 2.3.6
1842     stream: master
1843     submodule-recursive: true
1844     submodule-timeout: 10
1845     submodule-disable: false
1846
1847     gerrit_trigger_file_paths:
1848       - compare-type: REG_EXP
1849         pattern: ".*"
1850
1851     # github_included_regions MUST match gerrit_trigger_file_paths
1852     github_included_regions:
1853       - ".*"
1854
1855     #####################
1856     # Job Configuration #
1857     #####################
1858
1859     project-type: freestyle
1860     node: "{build-node}"
1861     concurrent: true
1862     disabled: "{disable-job}"
1863
1864     properties:
1865       - lf-infra-properties:
1866           build-days-to-keep: "{build-days-to-keep}"
1867
1868     parameters:
1869       - lf-infra-parameters:
1870           project: "{project}"
1871           branch: "{branch}"
1872           stream: "{stream}"
1873       - lf-puppet-parameters:
1874           puppet-lint-version: "{puppet-lint-version}"
1875
1876     wrappers:
1877       - lf-infra-wrappers:
1878           build-timeout: "{build-timeout}"
1879           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1880
1881     builders:
1882       - shell: !include-raw-escape: ../shell/puppet-lint.sh
1883
1884     publishers:
1885       - lf-infra-publish
1886
1887 - job-template:
1888     name: "{project-name}-puppet-verify"
1889     id: gerrit-puppet-verify
1890     <<: *lf_puppet_verify
1891
1892     ######################
1893     # Default parameters #
1894     ######################
1895
1896     gerrit_verify_triggers:
1897       - patchset-created-event:
1898           exclude-drafts: true
1899           exclude-trivial-rebase: false
1900           exclude-no-code-change: false
1901       - draft-published-event
1902       - comment-added-contains-event:
1903           comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
1904
1905     #####################
1906     # Job Configuration #
1907     #####################
1908
1909     scm:
1910       - lf-infra-gerrit-scm:
1911           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1912           git-url: "{git-url}"
1913           refspec: "$GERRIT_REFSPEC"
1914           branch: "$GERRIT_BRANCH"
1915           submodule-recursive: "{submodule-recursive}"
1916           submodule-timeout: "{submodule-timeout}"
1917           submodule-disable: "{submodule-disable}"
1918           choosing-strategy: gerrit
1919
1920     triggers:
1921       - gerrit:
1922           server-name: "{gerrit-server-name}"
1923           trigger-on: "{obj:gerrit_verify_triggers}"
1924           projects:
1925             - project-compare-type: ANT
1926               project-pattern: "{project}"
1927               branches:
1928                 - branch-compare-type: ANT
1929                   branch-pattern: "**/{branch}"
1930               file-paths: "{obj:gerrit_trigger_file_paths}"
1931
1932 - job-template:
1933     name: "{project-name}-puppet-verify"
1934     id: github-puppet-verify
1935     <<: *lf_puppet_verify
1936
1937     #####################
1938     # Job Configuration #
1939     #####################
1940
1941     properties:
1942       - lf-infra-properties:
1943           project: "{project}"
1944           build-days-to-keep: 7
1945       - github:
1946           url: "{github-url}/{github-org}/{project}"
1947
1948     scm:
1949       - lf-infra-github-scm:
1950           url: "{git-clone-url}{github-org}/{project}"
1951           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
1952           branch: "$sha1"
1953           submodule-recursive: "{submodule-recursive}"
1954           submodule-timeout: "{submodule-timeout}"
1955           submodule-disable: "{submodule-disable}"
1956           choosing-strategy: default
1957           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1958
1959     triggers:
1960       - github-pull-request:
1961           trigger-phrase: "^(recheck|reverify)$"
1962           only-trigger-phrase: false
1963           status-context: "Puppet Verify"
1964           permit-all: true
1965           github-hooks: true
1966           included-regions: "{obj:github_included_regions}"
1967           white-list-target-branches:
1968             - "{branch}"
1969
1970 #########
1971 # Sonar #
1972 #########
1973
1974 - lf_sonar_common: &lf_sonar_common
1975     name: lf-sonar-common
1976
1977     ######################
1978     # Default parameters #
1979     ######################
1980
1981     archive-artifacts: >
1982       **/*.log
1983
1984     branch: master # Sonar should always be run on master branch
1985     build-days-to-keep: 7
1986     build-timeout: 60
1987     cron: "H H * * *" # run daily
1988     disable-job: false
1989     git-url: "$GIT_URL/$PROJECT"
1990     github-url: "https://github.com"
1991     stream: master
1992     submodule-recursive: true
1993     submodule-timeout: 10
1994     submodule-disable: false
1995
1996     # Sonar properties
1997     sonar-task: ""
1998     sonar-project-file: "sonar-project.properties"
1999     sonar-properties: ""
2000     sonar-java-opts: ""
2001     sonar-additional-args: ""
2002
2003     gerrit_trigger_file_paths:
2004       - compare-type: REG_EXP
2005         pattern: ".*"
2006
2007     # github_included_regions MUST match gerrit_trigger_file_paths
2008     github_included_regions:
2009       - ".*"
2010
2011     #####################
2012     # Job Configuration #
2013     #####################
2014
2015     project-type: freestyle
2016     node: "{build-node}"
2017
2018     properties:
2019       - lf-infra-properties:
2020           build-days-to-keep: "{build-days-to-keep}"
2021
2022     wrappers:
2023       - lf-infra-wrappers:
2024           build-timeout: "{build-timeout}"
2025           jenkins-ssh-credential: "{jenkins-ssh-credential}"
2026
2027     disabled: "{disable-job}"
2028
2029     parameters:
2030       - lf-infra-parameters:
2031           project: "{project}"
2032           branch: "{branch}"
2033           stream: "{stream}"
2034       - string:
2035           name: ARCHIVE_ARTIFACTS
2036           default: "{archive-artifacts}"
2037           description: Artifacts to archive to the logs server.
2038
2039     publishers:
2040       - lf-infra-publish
2041
2042 - lf_sonar_builders: &lf_sonar_builders
2043     name: lf-sonar-builders
2044     builders:
2045       - lf-infra-pre-build
2046       - lf-infra-sonar:
2047           sonar-task: "{sonar-task}"
2048           sonar-project-file: "{sonar-project-file}"
2049           sonar-properties: "{sonar-properties}"
2050           sonar-java-opts: "{sonar-java-opts}"
2051           sonar-additional-args: "{sonar-additional-args}"
2052
2053 - lf_sonar_builders_prescan: &lf_sonar_builders_prescan
2054     name: lf-sonar-builders-prescan
2055     builders:
2056       - lf-infra-pre-build
2057       - lf-infra-sonar-with-prescan:
2058           sonar-task: "{sonar-task}"
2059           sonar-project-file: "{sonar-project-file}"
2060           sonar-properties: "{sonar-properties}"
2061           sonar-java-opts: "{sonar-java-opts}"
2062           sonar-additional-args: "{sonar-additional-args}"
2063
2064 - lf_sonar_gerrit_common: &lf_sonar_gerrit_common
2065     name: lf-sonar-gerrit-common
2066     gerrit_sonar_triggers:
2067       - comment-added-contains-event:
2068           comment-contains-value: '^Patch Set\s+\d+:\s+run-sonar\s*$'
2069
2070     scm:
2071       - lf-infra-gerrit-scm:
2072           jenkins-ssh-credential: "{jenkins-ssh-credential}"
2073           git-url: "{git-url}"
2074           refspec: $GERRIT_REFSPEC
2075           branch: $GERRIT_BRANCH
2076           submodule-recursive: "{submodule-recursive}"
2077           submodule-timeout: "{submodule-timeout}"
2078           submodule-disable: "{submodule-disable}"
2079           choosing-strategy: default
2080
2081     triggers:
2082       - timed: "{obj:cron}"
2083       - gerrit:
2084           server-name: "{gerrit-server-name}"
2085           trigger-on: "{obj:gerrit_sonar_triggers}"
2086           projects:
2087             - project-compare-type: "ANT"
2088               project-pattern: "{project}"
2089               branches:
2090                 - branch-compare-type: "ANT"
2091                   branch-pattern: "**/{branch}"
2092               file-paths: "{obj:gerrit_trigger_file_paths}"
2093           skip-vote:
2094             successful: true
2095             failed: true
2096             unstable: true
2097             notbuilt: true
2098
2099 - lf_sonar_github_common: &lf_sonar_github_common
2100     name: lf-sonar-github-common
2101     properties:
2102       - lf-infra-properties:
2103           build-days-to-keep: "{build-days-to-keep}"
2104       - github:
2105           url: "{github-url}/{github-org}/{project}"
2106
2107     scm:
2108       - lf-infra-github-scm:
2109           url: "{git-clone-url}{github-org}/{project}"
2110           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
2111           branch: "$sha1"
2112           submodule-recursive: "{submodule-recursive}"
2113           submodule-timeout: "{submodule-timeout}"
2114           submodule-disable: "{submodule-disable}"
2115           choosing-strategy: default
2116           jenkins-ssh-credential: "{jenkins-ssh-credential}"
2117
2118     triggers:
2119       - github-pull-request:
2120           trigger-phrase: "^run-sonar$"
2121           only-trigger-phrase: false
2122           status-context: "Python Sonar"
2123           permit-all: true
2124           github-hooks: true
2125           white-list-target-branches:
2126             - "{branch}"
2127           included-regions: "{obj:github_included_regions}"
2128
2129 - job-template:
2130     name: "{project-name}-sonar"
2131     id: gerrit-sonar
2132     <<: *lf_sonar_common
2133     # yamllint disable-line rule:key-duplicates
2134     <<: *lf_sonar_builders
2135     # yamllint disable-line rule:key-duplicates
2136     <<: *lf_sonar_gerrit_common
2137
2138 - job-template:
2139     name: "{project-name}-sonar"
2140     id: github-sonar
2141     <<: *lf_sonar_common
2142     # yamllint disable-line rule:key-duplicates
2143     <<: *lf_sonar_builders
2144     # yamllint disable-line rule:key-duplicates
2145     <<: *lf_sonar_github_common
2146
2147 - job-template:
2148     name: "{project-name}-sonar-prescan"
2149     id: gerrit-sonar-prescan
2150     <<: *lf_sonar_common
2151     # yamllint disable-line rule:key-duplicates
2152     <<: *lf_sonar_builders_prescan
2153     # yamllint disable-line rule:key-duplicates
2154     <<: *lf_sonar_gerrit_common
2155
2156 - job-template:
2157     name: "{project-name}-sonar-prescan"
2158     id: github-sonar-prescan
2159     <<: *lf_sonar_common
2160     # yamllint disable-line rule:key-duplicates
2161     <<: *lf_sonar_builders_prescan
2162     # yamllint disable-line rule:key-duplicates
2163     <<: *lf_sonar_github_common