3 name: '{project-name}-ci-jobs'
5 # This job group contains all the recommended jobs that should be deployed
15 name: '{project-name}-github-ci-jobs'
17 # This job group contains all the recommended jobs that should be deployed
18 # for any project ci that is using github.
28 name: '{project-name}-packer-jobs'
30 # This job group contains all the recommended jobs that should be deployed
31 # for any project ci that is using packer.
37 - gerrit-packer-verify
41 name: '{project-name}-github-packer-jobs'
43 # This job group contains all the recommended jobs that should be deployed
44 # for any project ci that is using packer.
50 - github-packer-verify
59 - config-file-provider:
62 target: '$HOME/.config/jenkins_jobs/jenkins_jobs.ini'
64 - lf_packer_file_paths: &lf_packer_file_paths
65 name: lf-packer-file-paths
67 # Common files for all projects
69 pattern: 'packer/vars/{platforms}.json'
71 pattern: 'packer/templates/{templates}.json'
73 pattern: 'packer/provision/{templates}.sh'
75 pattern: 'packer/provision/lib/**'
77 - lf_packer: &lf_packer_common
78 name: lf-packer-common
79 # Provide configuration common in packer jobs.
81 ######################
82 # Default parameters #
83 ######################
88 submodule-recursive: true
89 packer-cloud-settings: packer-cloud-env
95 project-type: freestyle
99 - lf-infra-properties:
101 build-days-to-keep: 7
104 - lf-infra-parameters:
108 lftools-version: '{lftools-version}'
109 - lf-infra-packer-parameters:
110 packer-version: '{packer-version}'
114 build-timeout: '{build-timeout}'
115 jenkins-ssh-credential: '{jenkins-ssh-credential}'
121 name: lf-infra-jjb-parameters
125 default: '{jjb-version}'
126 description: Jenkins Job Builder version to download and install.
129 name: lf-infra-packer-parameters
133 default: '{packer-version}'
134 description: Packer version to download and install.
136 - lf_jjb_common: &lf_jjb_common
139 ######################
140 # Default parameters #
141 ######################
146 submodule-recursive: true
148 gerrit_trigger_file_paths:
154 pattern: '**/global-jjb'
156 #####################
157 # Job Configuration #
158 #####################
160 project-type: freestyle
164 - lf-infra-properties:
166 build-days-to-keep: 7
169 - lf-infra-parameters:
173 lftools-version: '{lftools-version}'
174 - lf-infra-jjb-parameters:
175 jjb-version: '{jjb-version}'
179 build-timeout: '{build-timeout}'
180 jenkins-ssh-credential: '{jenkins-ssh-credential}'
189 - lf_jjb_merge: &lf_jjb_merge
192 # JJB Merge job runs `jenkins-jobs update` to update production job configuration
194 # Required parameters:
196 # :build-node: The node to run build on.
197 # :jenkins-ssh-credential: Credential to use for SSH. (Generally should
198 # be configured in defaults.yaml)
199 # :mvn-settings: The name of settings file containing credentials for
202 # Optional parameters:
204 # :branch: Git branch to fetch for the build. (default: master)
205 # :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
206 # :build-timeout: Timeout in seconds before aborting build. (default: 10)
207 # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
208 # :stream: Keyword that can be used to represent a release code-name.
209 # Often the same as the branch. (default: master)
210 # :submodule-recursive: Whether to checkout submodules recursively.
213 # :gerrit_merge_triggers: Override Gerrit Triggers.
214 # :gerrit_trigger_file_paths: Override file paths which can be used to
215 # filter which file modifications will trigger a build.
216 # (default defined by lf_jjb_common)
218 ######################
219 # Default parameters #
220 ######################
222 gerrit_merge_triggers:
223 - change-merged-event
224 - comment-added-contains-event:
225 comment-contains-value: remerge$
227 #####################
228 # Job Configuration #
229 #####################
233 - shell: !include-raw-escape:
234 - ../shell/jjb-install.sh
235 - ../shell/jjb-merge-job.sh
238 name: '{project-name}-jjb-merge'
241 # yamllint disable-line rule:key-duplicates
244 git-url: '$GIT_URL/$GERRIT_PROJECT'
247 - lf-infra-gerrit-scm:
251 submodule-recursive: '{submodule-recursive}'
252 choosing-strategy: default
253 jenkins-ssh-credential: '{jenkins-ssh-credential}'
257 server-name: '{gerrit-server-name}'
258 trigger-on: '{obj:gerrit_merge_triggers}'
260 - project-compare-type: ANT
261 project-pattern: '{project}'
263 - branch-compare-type: ANT
264 branch-pattern: '**/{branch}'
265 file-paths: '{obj:gerrit_trigger_file_paths}'
268 name: '{project-name}-jjb-merge'
271 # yamllint disable-line rule:key-duplicates
276 url: '{git-url}/{github-org}/{project}'
279 - lf-infra-github-scm:
280 url: '{git-clone-url}{github-org}/{project}'
283 submodule-recursive: '{submodule-recursive}'
284 choosing-strategy: default
285 jenkins-ssh-credential: '{jenkins-ssh-credential}'
291 - lf-infra-github-pr-trigger:
292 trigger-phrase: '^remerge$'
293 only-trigger-phrase: true
294 status-context: 'JJB Merge'
297 github-org: '{github-org}'
298 github_pr_whitelist: '{obj:github_pr_whitelist}'
299 github_pr_admin_list: '{obj:github_pr_admin_list}'
305 - lf_jjb_verify: &lf_jjb_verify
308 # JJB Verify job runs `jenkins-jobs test` to validate JJB syntax
310 # Required parameters:
312 # :build-node: The node to run build on.
313 # :jenkins-ssh-credential: Credential to use for SSH. (Generally should
314 # be configured in defaults.yaml)
315 # :mvn-settings: The name of settings file containing credentials for
318 # Optional parameters:
320 # :branch: Git branch to fetch for the build. (default: master)
321 # :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
322 # :build-timeout: Timeout in seconds before aborting build. (default: 10)
323 # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
324 # :stream: Keyword that can be used to represent a release code-name.
325 # Often the same as the branch. (default: master)
326 # :submodule-recursive: Whether to checkout submodules recursively.
329 # :gerrit_verify_triggers: Override Gerrit Triggers.
330 # :gerrit_trigger_file_paths: Override file paths which can be used to
331 # filter which file modifications will trigger a build.
332 # (default defined by lf_jjb_common)
334 ######################
335 # Default parameters #
336 ######################
338 gerrit_verify_triggers:
339 - patchset-created-event:
340 exclude-drafts: false
341 exclude-trivial-rebase: false
342 exclude-no-code-change: false
343 - draft-published-event
344 - comment-added-contains-event:
345 comment-contains-value: recheck$
347 #####################
348 # Job Configuration #
349 #####################
355 - shell: !include-raw-escape:
356 - ../shell/git-validate-jira-urls.sh
357 - ../shell/jjb-install.sh
358 - ../shell/jjb-verify-job.sh
359 - ../shell/jjb-check-unicode.sh
360 - lf-infra-gpg-verify-git-signature
363 name: '{project-name}-jjb-verify'
364 id: gerrit-jjb-verify
366 # yamllint disable-line rule:key-duplicates
369 git-url: '$GIT_URL/$GERRIT_PROJECT'
372 - lf-infra-gerrit-scm:
374 refspec: '$GERRIT_REFSPEC'
375 branch: '$GERRIT_BRANCH'
376 submodule-recursive: '{submodule-recursive}'
377 choosing-strategy: gerrit
378 jenkins-ssh-credential: '{jenkins-ssh-credential}'
382 server-name: '{gerrit-server-name}'
383 trigger-on: '{obj:gerrit_verify_triggers}'
385 - project-compare-type: ANT
386 project-pattern: '{project}'
388 - branch-compare-type: ANT
389 branch-pattern: '**/{branch}'
390 file-paths: '{obj:gerrit_trigger_file_paths}'
393 name: '{project-name}-jjb-verify'
394 id: github-jjb-verify
396 # yamllint disable-line rule:key-duplicates
401 url: '{git-url}/{github-org}/{project}'
404 - lf-infra-github-scm:
405 url: '{git-clone-url}{github-org}/{project}'
406 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
408 submodule-recursive: '{submodule-recursive}'
409 choosing-strategy: default
410 jenkins-ssh-credential: '{jenkins-ssh-credential}'
413 - lf-infra-github-pr-trigger:
414 trigger-phrase: '^recheck$'
415 only-trigger-phrase: false
416 status-context: 'JJB Verify'
422 github_pr_admin_list:
429 - lf_packer_merge: &lf_packer_merge
430 name: lf-packer-merge
432 # Packer Merge job runs `packer build` to build system images in the cloud.
434 # Required parameters:
436 # :build-node: The node to run build on.
437 # :jenkins-ssh-credential: Credential to use for SSH. (Generally should
438 # be configured in defaults.yaml)
439 # :mvn-settings: The name of settings file containing credentials for
441 # :platforms: Platform or distribution to build. Typically json file
442 # found in the packer/vars directory. (Example: centos)
443 # :template: System template to build. Typically shell script found in
444 # the packer/provision directory. (Example: java-builder)
446 # Optional parameters:
448 # :branch: Git branch to fetch for the build. (default: master)
449 # :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
450 # :build-timeout: Timeout in seconds before aborting build. (default: 10)
451 # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
452 # :packer-cloud-settings: Name of settings file containing credentials
453 # for the cloud that packer will build on. (default: packer-cloud-env)
454 # :packer-version: Version of packer to install / use in build. (default: 1.0.2)
455 # :stream: Keyword that can be used to represent a release code-name.
456 # Often the same as the branch. (default: master)
457 # :submodule-recursive: Whether to checkout submodules recursively.
460 # :gerrit_verify_triggers: Override Gerrit Triggers.
461 # :gerrit_trigger_file_paths: Override file paths which can be used to
462 # filter which file modifications will trigger a build.
463 # (default defined by lf_jjb_common)
465 ######################
466 # Default parameters #
467 ######################
469 gerrit_merge_triggers:
470 - change-merged-event
471 - comment-added-contains-event:
472 comment-contains-value: remerge$
474 #####################
475 # Job Configuration #
476 #####################
479 - lf-infra-packer-validate:
480 packer-cloud-settings: '{packer-cloud-settings}'
481 packer-version: '{packer-version}'
482 - lf-infra-packer-build:
483 packer-cloud-settings: '{packer-cloud-settings}'
484 packer-version: '{packer-version}'
485 platform: '{platforms}'
486 template: '{templates}'
489 name: '{project-name}-packer-merge-{platforms}-{templates}'
490 id: gerrit-packer-merge
491 <<: *lf_packer_common
492 # yamllint disable-line rule:key-duplicates
495 git-url: '$GIT_URL/$GERRIT_PROJECT'
498 - lf-infra-gerrit-scm:
500 refspec: '$GERRIT_REFSPEC'
501 branch: '$GERRIT_BRANCH'
502 submodule-recursive: '{submodule-recursive}'
503 choosing-strategy: gerrit
504 jenkins-ssh-credential: '{jenkins-ssh-credential}'
507 - timed: '00 10 1 * *'
509 server-name: '{gerrit-server-name}'
510 trigger-on: '{obj:gerrit_merge_triggers}'
512 - project-compare-type: ANT
513 project-pattern: '{project}'
515 - branch-compare-type: ANT
516 branch-pattern: '**/{branch}'
517 <<: *lf_packer_file_paths
520 name: '{project-name}-packer-merge-{platforms}-{templates}'
521 id: github-packer-merge
522 <<: *lf_packer_common
523 # yamllint disable-line rule:key-duplicates
528 url: '{git-url}/{github-org}/{project}'
531 - lf-infra-github-scm:
532 url: '{git-clone-url}{github-org}/{project}'
535 submodule-recursive: '{submodule-recursive}'
536 choosing-strategy: default
537 jenkins-ssh-credential: '{jenkins-ssh-credential}'
540 - timed: '00 10 1 * *'
544 - lf-infra-github-pr-trigger:
545 trigger-phrase: '^remerge$'
546 only-trigger-phrase: true
547 status-context: 'Packer {platforms}-${templates} Merge'
550 github-org: '{github-org}'
551 github_pr_whitelist: '{obj:github_pr_whitelist}'
552 github_pr_admin_list: '{obj:github_pr_admin_list}'
558 - lf_packer_verify: &lf_packer_verify
559 name: lf-packer-verify
561 # Packer Verify job runs `packer validate` to verify packer configuration.
563 # Required parameters:
565 # :build-node: The node to run build on.
566 # :jenkins-ssh-credential: Credential to use for SSH. (Generally should
567 # be configured in defaults.yaml)
568 # :mvn-settings: The name of settings file containing credentials for
571 # Optional parameters:
573 # :branch: Git branch to fetch for the build. (default: master)
574 # :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
575 # :build-timeout: Timeout in seconds before aborting build. (default: 10)
576 # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
577 # :packer-cloud-settings: Name of settings file containing credentials
578 # for the cloud that packer will build on. (default: packer-cloud-env)
579 # :packer-version: Version of packer to install / use in build. (default: 1.0.2)
580 # :stream: Keyword that can be used to represent a release code-name.
581 # Often the same as the branch. (default: master)
582 # :submodule-recursive: Whether to checkout submodules recursively.
585 # :gerrit_verify_triggers: Override Gerrit Triggers.
586 # :gerrit_trigger_file_paths: Override file paths which can be used to
587 # filter which file modifications will trigger a build.
588 # (default defined by lf_jjb_common)
590 ######################
591 # Default parameters #
592 ######################
596 gerrit_verify_triggers:
597 - patchset-created-event:
598 exclude-drafts: false
599 exclude-trivial-rebase: false
600 exclude-no-code-change: false
601 - draft-published-event
602 - comment-added-contains-event:
603 comment-contains-value: recheck$
605 #####################
606 # Job Configuration #
607 #####################
612 - lf-infra-packer-validate:
613 packer-cloud-settings: '{packer-cloud-settings}'
614 packer-version: '{packer-version}'
617 name: '{project-name}-packer-verify'
618 id: gerrit-packer-verify
619 <<: *lf_packer_common
620 # yamllint disable-line rule:key-duplicates
621 <<: *lf_packer_verify
623 git-url: '$GIT_URL/$GERRIT_PROJECT'
626 - lf-infra-gerrit-scm:
628 refspec: '$GERRIT_REFSPEC'
629 branch: '$GERRIT_BRANCH'
630 submodule-recursive: '{submodule-recursive}'
631 choosing-strategy: gerrit
632 jenkins-ssh-credential: '{jenkins-ssh-credential}'
636 server-name: '{gerrit-server-name}'
637 trigger-on: '{obj:gerrit_verify_triggers}'
639 - project-compare-type: ANT
640 project-pattern: '{project}'
642 - branch-compare-type: ANT
643 branch-pattern: '**/{branch}'
644 <<: *lf_packer_file_paths
647 name: '{project-name}-packer-verify'
648 id: github-packer-verify
649 <<: *lf_packer_common
650 # yamllint disable-line rule:key-duplicates
651 <<: *lf_packer_verify
655 url: '{git-url}/{github-org}/{project}'
658 - lf-infra-github-scm:
659 url: '{git-clone-url}{github-org}/{project}'
660 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
662 submodule-recursive: '{submodule-recursive}'
663 choosing-strategy: default
664 jenkins-ssh-credential: '{jenkins-ssh-credential}'
667 - lf-infra-github-pr-trigger:
668 trigger-phrase: '^recheck$'
669 only-trigger-phrase: false
670 status-context: 'Packer Verify'
676 github_pr_admin_list: