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 #####################
155 # Job Configuration #
156 #####################
158 project-type: freestyle
162 - lf-infra-properties:
164 build-days-to-keep: 7
167 - lf-infra-parameters:
171 lftools-version: '{lftools-version}'
172 - lf-infra-jjb-parameters:
173 jjb-version: '{jjb-version}'
177 build-timeout: '{build-timeout}'
178 jenkins-ssh-credential: '{jenkins-ssh-credential}'
187 - lf_jjb_merge: &lf_jjb_merge
190 # JJB Merge job runs `jenkins-jobs update` to update production job configuration
192 # Required parameters:
194 # :build-node: The node to run build on.
195 # :jenkins-ssh-credential: Credential to use for SSH. (Generally should
196 # be configured in defaults.yaml)
197 # :mvn-settings: The name of settings file containing credentials for
200 # Optional parameters:
202 # :branch: Git branch to fetch for the build. (default: master)
203 # :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
204 # :build-timeout: Timeout in seconds before aborting build. (default: 10)
205 # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
206 # :stream: Keyword that can be used to represent a release code-name.
207 # Often the same as the branch. (default: master)
208 # :submodule-recursive: Whether to checkout submodules recursively.
211 # :gerrit_merge_triggers: Override Gerrit Triggers.
212 # :gerrit_trigger_file_paths: Override file paths which can be used to
213 # filter which file modifications will trigger a build.
214 # (default defined by lf_jjb_common)
216 ######################
217 # Default parameters #
218 ######################
220 gerrit_merge_triggers:
221 - change-merged-event
222 - comment-added-contains-event:
223 comment-contains-value: remerge$
225 #####################
226 # Job Configuration #
227 #####################
231 - shell: !include-raw-escape:
232 - ../shell/jjb-install.sh
233 - ../shell/jjb-merge-job.sh
236 name: '{project-name}-jjb-merge'
239 # yamllint disable-line rule:key-duplicates
242 git-url: '$GIT_URL/$GERRIT_PROJECT'
245 - lf-infra-gerrit-scm:
249 submodule-recursive: '{submodule-recursive}'
250 choosing-strategy: default
251 jenkins-ssh-credential: '{jenkins-ssh-credential}'
255 server-name: '{gerrit-server-name}'
256 trigger-on: '{obj:gerrit_merge_triggers}'
258 - project-compare-type: ANT
259 project-pattern: '{project}'
261 - branch-compare-type: ANT
262 branch-pattern: '**/{branch}'
263 file-paths: '{obj:gerrit_trigger_file_paths}'
266 name: '{project-name}-jjb-merge'
269 # yamllint disable-line rule:key-duplicates
274 url: '{git-url}/{github-org}/{project}'
277 - lf-infra-github-scm:
278 url: '{git-clone-url}{github-org}/{project}'
281 submodule-recursive: '{submodule-recursive}'
282 choosing-strategy: default
283 jenkins-ssh-credential: '{jenkins-ssh-credential}'
289 - lf-infra-github-pr-trigger:
290 trigger-phrase: '^remerge$'
291 only-trigger-phrase: true
292 status-context: 'JJB Merge'
295 github-org: '{github-org}'
296 github_pr_whitelist: '{obj:github_pr_whitelist}'
297 github_pr_admin_list: '{obj:github_pr_admin_list}'
303 - lf_jjb_verify: &lf_jjb_verify
306 # JJB Verify job runs `jenkins-jobs test` to validate JJB syntax
308 # Required parameters:
310 # :build-node: The node to run build on.
311 # :jenkins-ssh-credential: Credential to use for SSH. (Generally should
312 # be configured in defaults.yaml)
313 # :mvn-settings: The name of settings file containing credentials for
316 # Optional parameters:
318 # :branch: Git branch to fetch for the build. (default: master)
319 # :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
320 # :build-timeout: Timeout in seconds before aborting build. (default: 10)
321 # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
322 # :stream: Keyword that can be used to represent a release code-name.
323 # Often the same as the branch. (default: master)
324 # :submodule-recursive: Whether to checkout submodules recursively.
327 # :gerrit_verify_triggers: Override Gerrit Triggers.
328 # :gerrit_trigger_file_paths: Override file paths which can be used to
329 # filter which file modifications will trigger a build.
330 # (default defined by lf_jjb_common)
332 ######################
333 # Default parameters #
334 ######################
336 gerrit_verify_triggers:
337 - patchset-created-event:
338 exclude-drafts: false
339 exclude-trivial-rebase: false
340 exclude-no-code-change: false
341 - draft-published-event
342 - comment-added-contains-event:
343 comment-contains-value: recheck$
345 #####################
346 # Job Configuration #
347 #####################
353 - shell: !include-raw-escape:
354 - ../shell/git-validate-jira-urls.sh
355 - ../shell/jjb-install.sh
356 - ../shell/jjb-verify-job.sh
357 - ../shell/jjb-check-unicode.sh
358 - lf-infra-gpg-verify-git-signature
361 name: '{project-name}-jjb-verify'
362 id: gerrit-jjb-verify
364 # yamllint disable-line rule:key-duplicates
367 git-url: '$GIT_URL/$GERRIT_PROJECT'
370 - lf-infra-gerrit-scm:
372 refspec: '$GERRIT_REFSPEC'
373 branch: '$GERRIT_BRANCH'
374 submodule-recursive: '{submodule-recursive}'
375 choosing-strategy: gerrit
376 jenkins-ssh-credential: '{jenkins-ssh-credential}'
380 server-name: '{gerrit-server-name}'
381 trigger-on: '{obj:gerrit_verify_triggers}'
383 - project-compare-type: ANT
384 project-pattern: '{project}'
386 - branch-compare-type: ANT
387 branch-pattern: '**/{branch}'
388 file-paths: '{obj:gerrit_trigger_file_paths}'
391 name: '{project-name}-jjb-verify'
392 id: github-jjb-verify
394 # yamllint disable-line rule:key-duplicates
399 url: '{git-url}/{github-org}/{project}'
402 - lf-infra-github-scm:
403 url: '{git-clone-url}{github-org}/{project}'
404 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
406 submodule-recursive: '{submodule-recursive}'
407 choosing-strategy: default
408 jenkins-ssh-credential: '{jenkins-ssh-credential}'
411 - lf-infra-github-pr-trigger:
412 trigger-phrase: '^recheck$'
413 only-trigger-phrase: false
414 status-context: 'JJB Verify'
420 github_pr_admin_list:
427 - lf_packer_merge: &lf_packer_merge
428 name: lf-packer-merge
430 # Packer Merge job runs `packer build` to build system images in the cloud.
432 # Required parameters:
434 # :build-node: The node to run build on.
435 # :jenkins-ssh-credential: Credential to use for SSH. (Generally should
436 # be configured in defaults.yaml)
437 # :mvn-settings: The name of settings file containing credentials for
439 # :platforms: Platform or distribution to build. Typically json file
440 # found in the packer/vars directory. (Example: centos)
441 # :template: System template to build. Typically shell script found in
442 # the packer/provision directory. (Example: java-builder)
444 # Optional parameters:
446 # :branch: Git branch to fetch for the build. (default: master)
447 # :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
448 # :build-timeout: Timeout in seconds before aborting build. (default: 10)
449 # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
450 # :packer-cloud-settings: Name of settings file containing credentials
451 # for the cloud that packer will build on. (default: packer-cloud-env)
452 # :packer-version: Version of packer to install / use in build. (default: 1.0.2)
453 # :stream: Keyword that can be used to represent a release code-name.
454 # Often the same as the branch. (default: master)
455 # :submodule-recursive: Whether to checkout submodules recursively.
458 # :gerrit_verify_triggers: Override Gerrit Triggers.
459 # :gerrit_trigger_file_paths: Override file paths which can be used to
460 # filter which file modifications will trigger a build.
461 # (default defined by lf_jjb_common)
463 ######################
464 # Default parameters #
465 ######################
467 gerrit_merge_triggers:
468 - change-merged-event
469 - comment-added-contains-event:
470 comment-contains-value: remerge$
472 #####################
473 # Job Configuration #
474 #####################
477 - lf-infra-packer-validate:
478 packer-cloud-settings: '{packer-cloud-settings}'
479 packer-version: '{packer-version}'
480 - lf-infra-packer-build:
481 packer-cloud-settings: '{packer-cloud-settings}'
482 packer-version: '{packer-version}'
483 platform: '{platforms}'
484 template: '{templates}'
487 name: '{project-name}-packer-merge-{platforms}-{templates}'
488 id: gerrit-packer-merge
489 <<: *lf_packer_common
490 # yamllint disable-line rule:key-duplicates
493 git-url: '$GIT_URL/$GERRIT_PROJECT'
496 - lf-infra-gerrit-scm:
498 refspec: '$GERRIT_REFSPEC'
499 branch: '$GERRIT_BRANCH'
500 submodule-recursive: '{submodule-recursive}'
501 choosing-strategy: gerrit
502 jenkins-ssh-credential: '{jenkins-ssh-credential}'
505 - timed: '00 10 1 * *'
507 server-name: '{gerrit-server-name}'
508 trigger-on: '{obj:gerrit_merge_triggers}'
510 - project-compare-type: ANT
511 project-pattern: '{project}'
513 - branch-compare-type: ANT
514 branch-pattern: '**/{branch}'
515 <<: *lf_packer_file_paths
518 name: '{project-name}-packer-merge-{platforms}-{templates}'
519 id: github-packer-merge
520 <<: *lf_packer_common
521 # yamllint disable-line rule:key-duplicates
526 url: '{git-url}/{github-org}/{project}'
529 - lf-infra-github-scm:
530 url: '{git-clone-url}{github-org}/{project}'
533 submodule-recursive: '{submodule-recursive}'
534 choosing-strategy: default
535 jenkins-ssh-credential: '{jenkins-ssh-credential}'
538 - timed: '00 10 1 * *'
542 - lf-infra-github-pr-trigger:
543 trigger-phrase: '^remerge$'
544 only-trigger-phrase: true
545 status-context: 'Packer {platforms}-${templates} Merge'
548 github-org: '{github-org}'
549 github_pr_whitelist: '{obj:github_pr_whitelist}'
550 github_pr_admin_list: '{obj:github_pr_admin_list}'
556 - lf_packer_verify: &lf_packer_verify
557 name: lf-packer-verify
559 # Packer Verify job runs `packer validate` to verify packer configuration.
561 # Required parameters:
563 # :build-node: The node to run build on.
564 # :jenkins-ssh-credential: Credential to use for SSH. (Generally should
565 # be configured in defaults.yaml)
566 # :mvn-settings: The name of settings file containing credentials for
569 # Optional parameters:
571 # :branch: Git branch to fetch for the build. (default: master)
572 # :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
573 # :build-timeout: Timeout in seconds before aborting build. (default: 10)
574 # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
575 # :packer-cloud-settings: Name of settings file containing credentials
576 # for the cloud that packer will build on. (default: packer-cloud-env)
577 # :packer-version: Version of packer to install / use in build. (default: 1.0.2)
578 # :stream: Keyword that can be used to represent a release code-name.
579 # Often the same as the branch. (default: master)
580 # :submodule-recursive: Whether to checkout submodules recursively.
583 # :gerrit_verify_triggers: Override Gerrit Triggers.
584 # :gerrit_trigger_file_paths: Override file paths which can be used to
585 # filter which file modifications will trigger a build.
586 # (default defined by lf_jjb_common)
588 ######################
589 # Default parameters #
590 ######################
594 gerrit_verify_triggers:
595 - patchset-created-event:
596 exclude-drafts: false
597 exclude-trivial-rebase: false
598 exclude-no-code-change: false
599 - draft-published-event
600 - comment-added-contains-event:
601 comment-contains-value: recheck$
603 #####################
604 # Job Configuration #
605 #####################
610 - lf-infra-packer-validate:
611 packer-cloud-settings: '{packer-cloud-settings}'
612 packer-version: '{packer-version}'
615 name: '{project-name}-packer-verify'
616 id: gerrit-packer-verify
617 <<: *lf_packer_common
618 # yamllint disable-line rule:key-duplicates
619 <<: *lf_packer_verify
621 git-url: '$GIT_URL/$GERRIT_PROJECT'
624 - lf-infra-gerrit-scm:
626 refspec: '$GERRIT_REFSPEC'
627 branch: '$GERRIT_BRANCH'
628 submodule-recursive: '{submodule-recursive}'
629 choosing-strategy: gerrit
630 jenkins-ssh-credential: '{jenkins-ssh-credential}'
634 server-name: '{gerrit-server-name}'
635 trigger-on: '{obj:gerrit_verify_triggers}'
637 - project-compare-type: ANT
638 project-pattern: '{project}'
640 - branch-compare-type: ANT
641 branch-pattern: '**/{branch}'
642 <<: *lf_packer_file_paths
645 name: '{project-name}-packer-verify'
646 id: github-packer-verify
647 <<: *lf_packer_common
648 # yamllint disable-line rule:key-duplicates
649 <<: *lf_packer_verify
653 url: '{git-url}/{github-org}/{project}'
656 - lf-infra-github-scm:
657 url: '{git-clone-url}{github-org}/{project}'
658 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
660 submodule-recursive: '{submodule-recursive}'
661 choosing-strategy: default
662 jenkins-ssh-credential: '{jenkins-ssh-credential}'
665 - lf-infra-github-pr-trigger:
666 trigger-phrase: '^recheck$'
667 only-trigger-phrase: false
668 status-context: 'Packer Verify'
674 github_pr_admin_list: