5 - docker_job_boiler_plate: &docker_job_boiler_plate
6 name: docker_job_boiler_plate
8 project-type: freestyle
11 ######################
12 # Default parameters #
13 ######################
16 submodule-recursive: true
18 # default params for docker jobs
21 docker_root: '$WORKSPACE'
23 docker_name: 'unnamed'
24 # Default to LF standard 'snapshots' docker registry
25 docker_registry: '$DOCKER_REGISTRY:10003'
34 - lf-infra-properties:
35 build-days-to-keep: '{build-days-to-keep}'
38 - lf-infra-parameters:
42 lftools-version: '{lftools-version}'
46 build-timeout: '{build-timeout}'
47 jenkins-ssh-credential: '{jenkins-ssh-credential}'
52 - docker_verify_boiler_plate: &docker_verify_boiler_plate
53 name: docker_verify_boiler_plate
59 refspec: '$GERRIT_REFSPEC'
60 choosing-strategy: 'default'
61 submodule-recursive: '{submodule-recursive}'
64 - gerrit-trigger-patch-submitted:
65 status-context: '{project}-Docker-Verify'
66 server: '{server-name}'
71 - docker_merge_boiler_plate: &docker_merge_boiler_plate
72 name: docker_merge_boiler_plate
76 refspec: '$GERRIT_REFSPEC'
77 choosing-strategy: 'default'
78 submodule-recursive: '{submodule-recursive}'
81 - gerrit-trigger-patch-merged:
82 server: '{server-name}'
93 name: '{project-name}-{stream}-merge-docker'
94 # Job template for Docker merge jobs
96 # The purpose of this job template is to run a docker build, and potentially
97 # test validation of the docker image
99 <<: *docker_job_boiler_plate
100 # yamllint disable-line rule:key-duplicates
101 <<: *docker_merge_boiler_plate
105 - lf-infra-docker-login:
106 global-settings-file: 'global-settings'
107 settings-file: '{mvn-settings}'
108 - shell: '{pre_build_script}'
110 # Docker registry is purposely not using an '_' so as to not conflict
111 # with the Jenkins global env var
112 properties-content: |
113 DOCKER_ARGS={docker_build_args}
114 DOCKER_NAME={docker_name}
115 DOCKER_ROOT={docker_root}
116 DOCKER_TAG={docker_tag}
118 DOCKERREGISTRY={docker_registry}
119 # Do the docker build
120 - shell: !include-raw: ../shell/docker-build.sh
122 # Import the docker image information from the build step
123 properties-file: 'env_inject.txt'
124 # Execute any post build clean-up or testing
125 - shell: '{post_build_script}'
126 # Provided all steps have already passed, push the docker image
127 - shell: !include-raw: ../shell/docker-push.sh
130 name: '{project-name}-{stream}-merge-docker-cascade-trigger'
131 # Job template for Docker merge jobs
133 # The purpose of this job template is to run a docker build, and potentially
134 # test validation of the docker image. This job is triggered by the it's corresponding
135 # job that builds the artifacts from which the docker image is built from. Projects
136 # using the {project-name}-{stream}-merge-docker job should move to this job. Because
137 # the {project-name}-{stream}-merge-docker has no garanties that the docker image is built
138 # from merged artifact.
140 <<: *docker_job_boiler_plate
141 # yamllint disable-line rule:key-duplicates
142 <<: *docker_merge_boiler_plate
146 - lf-infra-docker-login:
147 global-settings-file: 'global-settings'
148 settings-file: '{mvn-settings}'
149 - shell: '{pre_build_script}'
151 # Docker registry is purposely not using an '_' so as to not conflict
152 # with the Jenkins global env var
153 properties-content: |
154 DOCKER_ARGS={docker_build_args}
155 DOCKER_NAME={docker_name}
156 DOCKER_ROOT={docker_root}
157 DOCKER_TAG={docker_tag}
159 DOCKERREGISTRY={docker_registry}
160 # Do the docker build
161 - shell: !include-raw: ../shell/docker-build.sh
163 # Import the docker image information from the build step
164 properties-file: 'env_inject.txt'
165 # Execute any post build clean-up or testing
166 - shell: '{post_build_script}'
167 # Provided all steps have already passed, push the docker image
168 - shell: !include-raw: ../shell/docker-push.sh
176 name: '{project-name}-{stream}-verify-docker'
177 # Job template for Docker verify jobs
179 # The purpose of this job template is to run a docker build, and potentially
180 # test validation of the docker image
182 ######################
183 # Default parameters #
184 ######################
186 <<: *docker_job_boiler_plate
187 # yamllint disable-line rule:key-duplicates
188 <<: *docker_verify_boiler_plate
192 - lf-infra-docker-login:
193 global-settings-file: 'global-settings'
194 settings-file: '{mvn-settings}'
195 - shell: '{pre_build_script}'
197 # Docker registry is purposely not using an '_' so as to not conflict
198 # with the Jenkins global env var
199 properties-content: |
200 DOCKER_ARGS={docker_build_args}
201 DOCKER_NAME={docker_name}
202 DOCKER_ROOT={docker_root}
203 DOCKER_TAG={docker_tag}
205 DOCKERREGISTRY={docker_registry}
206 # Do the docker build
207 - shell: !include-raw: ../shell/docker-build.sh
209 # Import the docker image information from the build step
210 properties-file: 'env_inject.txt'
211 # Execute any post build clean-up or testing
212 - shell: '{post_build_script}'
215 name: '{project-name}-{stream}-verify-docker-cascade-trigger'
216 # Job template for Docker verify jobs
218 # The purpose of this job template is to run a docker build, and potentially
219 # test validation of the docker image. This job is triggered by the it's corresponding
220 # job that builds the artifacts from which the docker image is built from. Projects
221 # using the {project-name}-{stream}-verify-docker job should move to this job. Because
222 # the {project-name}-{stream}-verify-docker has no garanties that the docker image is built
223 # from merged artifact.
225 ######################
226 # Default parameters #
227 ######################
229 <<: *docker_job_boiler_plate
230 # yamllint disable-line rule:key-duplicates
231 <<: *docker_verify_boiler_plate
235 - lf-infra-docker-login:
236 global-settings-file: 'global-settings'
237 settings-file: '{mvn-settings}'
238 - shell: '{pre_build_script}'
240 # Docker registry is purposely not using an '_' so as to not conflict
241 # with the Jenkins global env var
242 properties-content: |
243 DOCKER_ARGS={docker_build_args}
244 DOCKER_NAME={docker_name}
245 DOCKER_ROOT={docker_root}
246 DOCKER_TAG={docker_tag}
248 DOCKERREGISTRY={docker_registry}
249 # Do the docker build
250 - shell: !include-raw: ../shell/docker-build.sh
252 # Import the docker image information from the build step
253 properties-file: 'env_inject.txt'
254 # Execute any post build clean-up or testing
255 - shell: '{post_build_script}'
263 name: '{project-name}-{stream}-release-version-docker-daily-no-sonar'
264 # Job template for Docker daily release jobs
266 # The purpose of this job template is to run "docker build and docker push"
267 # for projects using this template.
269 # Required Variables:
270 # branch: git branch (eg. stable/lithium or master)
271 <<: *docker_job_boiler_plate
273 docker_registry: '$DOCKER_REGISTRY:10003'
276 - lf-infra-gerrit-scm:
277 jenkins-ssh-credential: '{jenkins-ssh-credential}'
278 git-url: '$GIT_URL/$PROJECT'
279 refspec: '$GERRIT_REFSPEC'
280 branch: '$GERRIT_BRANCH'
281 submodule-recursive: true
282 submodule-timeout: '{submodule-timeout}'
283 choosing-strategy: default
287 - lf-infra-docker-login:
288 global-settings-file: 'global-settings'
289 settings-file: '{mvn-settings}'
290 - shell: '{pre_build_script}'
292 # Docker registry is purposely not using an '_' so as to not conflict
293 # with the Jenkins global env var
294 properties-content: |
295 DOCKER_ARGS={docker_build_args}
296 DOCKER_NAME={docker_name}
297 DOCKER_ROOT={docker_root}
298 DOCKER_TAG={docker_tag}
299 DOCKERREGISTRY={docker_registry}
302 # Do the docker build
303 - shell: !include-raw: ../shell/snapshot-strip.sh
304 - shell: !include-raw: ../shell/docker-build.sh
306 # Import the docker image information from the build step
307 properties-file: 'env_inject.txt'
308 # Execute any post build clean-up or testing
309 - shell: '{post_build_script}'
310 # Provided all steps have already passed, push the docker image
311 - shell: !include-raw: ../shell/docker-push.sh
316 - gerrit-trigger-release-manually:
317 server: '{server-name}'
322 name: '{project-name}-{stream}-release-version-docker-daily-no-sonar-cascade-trigger'
323 # Job template for Docker daily release job.
325 # The purpose of this job template is to run "docker build and docker push"
326 # for projects using this template. This job is triggered by the daily build
327 # that builds the artifacts required for building the Docker image.
329 # Required Variables:
330 # branch: git branch (eg. stable/lithium or master)
331 <<: *docker_job_boiler_plate
333 docker_registry: '$DOCKER_REGISTRY:10003'
336 - lf-infra-gerrit-scm:
337 jenkins-ssh-credential: '{jenkins-ssh-credential}'
338 git-url: '$GIT_URL/$PROJECT'
339 refspec: '$GERRIT_REFSPEC'
340 branch: '$GERRIT_BRANCH'
341 submodule-recursive: true
342 submodule-timeout: '{submodule-timeout}'
343 choosing-strategy: default
347 - lf-infra-docker-login:
348 global-settings-file: 'global-settings'
349 settings-file: '{mvn-settings}'
350 - shell: '{pre_build_script}'
352 # Docker registry is purposely not using an '_' so as to not conflict
353 # with the Jenkins global env var
354 properties-content: |
355 DOCKER_ARGS={docker_build_args}
356 DOCKER_NAME={docker_name}
357 DOCKER_ROOT={docker_root}
358 DOCKER_TAG={docker_tag}
359 DOCKERREGISTRY={docker_registry}
362 # Do the docker build
363 - shell: !include-raw: ../shell/snapshot-strip.sh
364 - shell: !include-raw: ../shell/docker-build.sh
366 # Import the docker image information from the build step
367 properties-file: 'env_inject.txt'
368 # Execute any post build clean-up or testing
369 - shell: '{post_build_script}'
370 # Provided all steps have already passed, push the docker image
371 - shell: !include-raw: ../shell/docker-push.sh
380 name: '{project-name}-{subproject}-{stream}-merge-docker'
381 # Job template for Docker merge jobs
383 # The purpose of this job template is to run a docker build, and potentially
384 # test validation of the docker image
386 <<: *docker_job_boiler_plate
387 # yamllint disable-line rule:key-duplicates
388 <<: *docker_merge_boiler_plate
392 - lf-infra-docker-login:
393 global-settings-file: 'global-settings'
394 settings-file: '{mvn-settings}'
395 - shell: '{pre_build_script}'
397 # Docker registry is purposely not using an '_' so as to not conflict
398 # with the Jenkins global env var
399 properties-content: |
400 DOCKER_ARGS={docker_build_args}
401 DOCKER_NAME={docker_name}
402 DOCKER_ROOT={docker_root}
403 DOCKER_TAG={docker_tag}
404 DOCKERREGISTRY={docker_registry}
406 # Do the docker build
407 - shell: !include-raw: ../shell/docker-build.sh
409 # Import the docker image information from the build step
410 properties-file: 'env_inject.txt'
411 # Execute any post build clean-up or testing
412 - shell: '{post_build_script}'
413 # Provided all steps have already passed, push the docker image
414 - shell: !include-raw: ../shell/docker-push.sh
417 name: '{project-name}-{subproject}-{stream}-merge-docker-cascade-trigger'
418 # Job template for Docker merge jobs
420 # The purpose of this job template is to run a docker build, and potentially
421 # test validation of the docker image. This job is triggered by the merge job
422 # that builds the artifacts required for building the Docker image.
424 <<: *docker_job_boiler_plate
425 # yamllint disable-line rule:key-duplicates
426 <<: *docker_merge_boiler_plate
430 - lf-infra-docker-login:
431 global-settings-file: 'global-settings'
432 settings-file: '{mvn-settings}'
433 - shell: '{pre_build_script}'
435 # Docker registry is purposely not using an '_' so as to not conflict
436 # with the Jenkins global env var
437 properties-content: |
438 DOCKER_ARGS={docker_build_args}
439 DOCKER_NAME={docker_name}
440 DOCKER_ROOT={docker_root}
441 DOCKER_TAG={docker_tag}
442 DOCKERREGISTRY={docker_registry}
444 # Do the docker build
445 - shell: !include-raw: ../shell/docker-build.sh
447 # Import the docker image information from the build step
448 properties-file: 'env_inject.txt'
449 # Execute any post build clean-up or testing
450 - shell: '{post_build_script}'
451 # Provided all steps have already passed, push the docker image
452 - shell: !include-raw: ../shell/docker-push.sh
460 name: '{project-name}-{subproject}-{stream}-verify-docker'
461 # Job template for Docker verify jobs
463 # The purpose of this job template is to run a docker build, and potentially
464 # test validation of the docker image
466 ######################
467 # Default parameters #
468 ######################
470 <<: *docker_job_boiler_plate
471 # yamllint disable-line rule:key-duplicates
472 <<: *docker_verify_boiler_plate
476 - lf-infra-docker-login:
477 global-settings-file: 'global-settings'
478 settings-file: '{mvn-settings}'
479 - shell: '{pre_build_script}'
481 # Docker registry is purposely not using an '_' so as to not conflict
482 # with the Jenkins global env var
483 properties-content: |
484 DOCKER_ARGS={docker_build_args}
485 DOCKER_NAME={docker_name}
486 DOCKER_ROOT={docker_root}
487 DOCKER_TAG={docker_tag}
488 DOCKERREGISTRY={docker_registry}
490 # Do the docker build
491 - shell: !include-raw: ../shell/docker-build.sh
493 # Import the docker image information from the build step
494 properties-file: 'env_inject.txt'
495 # Execute any post build clean-up or testing
496 - shell: '{post_build_script}'
499 name: '{project-name}-{subproject}-{stream}-verify-docker-cascade-trigger'
500 # Job template for Docker verify jobs
502 # The purpose of this job template is to run a docker build, and potentially
503 # test validation of the docker image
505 ######################
506 # Default parameters #
507 ######################
509 <<: *docker_job_boiler_plate
510 # yamllint disable-line rule:key-duplicates
511 <<: *docker_verify_boiler_plate
515 - lf-infra-docker-login:
516 global-settings-file: 'global-settings'
517 settings-file: '{mvn-settings}'
518 - shell: '{pre_build_script}'
520 # Docker registry is purposely not using an '_' so as to not conflict
521 # with the Jenkins global env var
522 properties-content: |
523 DOCKER_ARGS={docker_build_args}
524 DOCKER_NAME={docker_name}
525 DOCKER_ROOT={docker_root}
526 DOCKER_TAG={docker_tag}
527 DOCKERREGISTRY={docker_registry}
529 # Do the docker build
530 - shell: !include-raw: ../shell/docker-build.sh
532 # Import the docker image information from the build step
533 properties-file: 'env_inject.txt'
534 # Execute any post build clean-up or testing
535 - shell: '{post_build_script}'
543 name: '{project-name}-{subproject}-{stream}-release-version-docker-daily-no-sonar'
544 # Job template for Docker daily release jobs
546 # The purpose of this job template is to run "docker build and docker push"
547 # for projects using this template.
549 # Required Variables:
550 # branch: git branch (eg. stable/lithium or master)
551 <<: *docker_job_boiler_plate
553 docker_registry: '$DOCKER_REGISTRY:10003'
556 - lf-infra-gerrit-scm:
557 jenkins-ssh-credential: '{jenkins-ssh-credential}'
558 git-url: '$GIT_URL/$PROJECT'
559 refspec: '$GERRIT_REFSPEC'
560 branch: '$GERRIT_BRANCH'
561 submodule-recursive: true
562 submodule-timeout: '{submodule-timeout}'
563 choosing-strategy: default
567 - lf-infra-docker-login:
568 global-settings-file: 'global-settings'
569 settings-file: '{mvn-settings}'
570 - shell: '{pre_build_script}'
572 # Docker registry is purposely not using an '_' so as to not conflict
573 # with the Jenkins global env var
574 properties-content: |
575 DOCKER_ARGS={docker_build_args}
576 DOCKER_NAME={docker_name}
577 DOCKER_ROOT={docker_root}
578 DOCKER_TAG={docker_tag}
579 DOCKERREGISTRY={docker_registry}
582 # Do the docker build
583 - shell: !include-raw: ../shell/snapshot-strip.sh
584 - shell: !include-raw: ../shell/docker-build.sh
586 # Import the docker image information from the build step
587 properties-file: 'env_inject.txt'
588 # Execute any post build clean-up or testing
589 - shell: '{post_build_script}'
590 # Provided all steps have already passed, push the docker image
591 - shell: !include-raw: ../shell/docker-push.sh
596 - gerrit-trigger-release-manually:
597 server: '{server-name}'
602 name: '{project-name}-{subproject}-{stream}-release-version-docker-daily-no-sonar-cascade-trigger'
603 # Job template for Docker daily release jobs
605 # The purpose of this job template is to run "docker build and docker push"
606 # for projects using this template. This job is triggered by the daily job
607 # that builds the artifacts required for building the Docker image.
609 # Required Variables:
610 # branch: git branch (eg. stable/lithium or master)
611 <<: *docker_job_boiler_plate
613 docker_registry: '$DOCKER_REGISTRY:10003'
616 - lf-infra-gerrit-scm:
617 jenkins-ssh-credential: '{jenkins-ssh-credential}'
618 git-url: '$GIT_URL/$PROJECT'
619 refspec: '$GERRIT_REFSPEC'
620 branch: '$GERRIT_BRANCH'
621 submodule-recursive: true
622 submodule-timeout: '{submodule-timeout}'
623 choosing-strategy: default
627 - lf-infra-docker-login:
628 global-settings-file: 'global-settings'
629 settings-file: '{mvn-settings}'
630 - shell: '{pre_build_script}'
632 # Docker registry is purposely not using an '_' so as to not conflict
633 # with the Jenkins global env var
634 properties-content: |
635 DOCKER_ARGS={docker_build_args}
636 DOCKER_NAME={docker_name}
637 DOCKER_ROOT={docker_root}
638 DOCKER_TAG={docker_tag}
639 DOCKERREGISTRY={docker_registry}
642 # Do the docker build
643 - shell: !include-raw: ../shell/snapshot-strip.sh
644 - shell: !include-raw: ../shell/docker-build.sh
646 # Import the docker image information from the build step
647 properties-file: 'env_inject.txt'
648 # Execute any post build clean-up or testing
649 - shell: '{post_build_script}'
650 # Provided all steps have already passed, push the docker image
651 - shell: !include-raw: ../shell/docker-push.sh
660 name: '{project-name}-{subproject}-{stream}-release-version-docker-no-sonar'
661 # Job template for Docker final release job
663 # The purpose of this job template is to run "docker build and docker push"
664 # for projects using this template.
666 # Required Variables:
667 # branch: git branch (eg. stable/lithium or master)
668 <<: *docker_job_boiler_plate
670 docker_registry: '$DOCKER_REGISTRY:10003'
673 - lf-infra-gerrit-scm:
674 jenkins-ssh-credential: '{jenkins-ssh-credential}'
675 git-url: '$GIT_URL/$PROJECT'
676 refspec: '$GERRIT_REFSPEC'
677 branch: '$GERRIT_BRANCH'
678 submodule-recursive: true
679 submodule-timeout: '{submodule-timeout}'
680 choosing-strategy: default
684 - lf-infra-docker-login:
685 global-settings-file: 'global-settings'
686 settings-file: '{mvn-settings}'
687 - shell: '{pre_build_script}'
689 # Docker registry is purposely not using an '_' so as to not conflict
690 # with the Jenkins global env var
691 properties-content: |
692 DOCKER_ARGS={docker_build_args}
693 DOCKER_NAME={docker_name}
694 DOCKER_ROOT={docker_root}
695 DOCKER_TAG={docker_tag}
696 DOCKERREGISTRY={docker_registry}
699 # Do the docker build
700 - shell: !include-raw: ../shell/snapshot-strip.sh
701 - shell: !include-raw: ../shell/docker-build.sh
703 # Import the docker image information from the build step
704 properties-file: 'env_inject.txt'
705 # Execute any post build clean-up or testing
706 - shell: '{post_build_script}'
707 # Provided all steps have already passed, push the docker image
708 - shell: !include-raw: ../shell/docker-push.sh
711 name: '{project-name}-{subproject}-{stream}-release-version-docker-cascade-trigger-no-sonar'
712 # Job template for Docker final release job
714 # The purpose of this job template is to run "docker build and docker push"
715 # for projects using this template. This job has no cascading counterpart, because the
716 # final release is moved manually to the release repo.
718 # Required Variables:
719 # branch: git branch (eg. stable/lithium or master)
720 <<: *docker_job_boiler_plate
722 docker_registry: '$DOCKER_REGISTRY:10003'
725 - lf-infra-gerrit-scm:
726 jenkins-ssh-credential: '{jenkins-ssh-credential}'
727 git-url: '$GIT_URL/$PROJECT'
728 refspec: '$GERRIT_REFSPEC'
729 branch: '$GERRIT_BRANCH'
730 submodule-recursive: true
731 submodule-timeout: '{submodule-timeout}'
732 choosing-strategy: default
736 - lf-infra-docker-login:
737 global-settings-file: 'global-settings'
738 settings-file: '{mvn-settings}'
739 - shell: '{pre_build_script}'
741 # Docker registry is purposely not using an '_' so as to not conflict
742 # with the Jenkins global env var
743 properties-content: |
744 DOCKER_ARGS={docker_build_args}
745 DOCKER_NAME={docker_name}
746 DOCKER_ROOT={docker_root}
747 DOCKER_TAG={docker_tag}
748 DOCKERREGISTRY={docker_registry}
751 # Do the docker build
752 - shell: !include-raw: ../shell/snapshot-strip.sh
753 - shell: !include-raw: ../shell/docker-build.sh
755 # Import the docker image information from the build step
756 properties-file: 'env_inject.txt'
757 # Execute any post build clean-up or testing
758 - shell: '{post_build_script}'
759 # Provided all steps have already passed, push the docker image
760 - shell: !include-raw: ../shell/docker-push.sh