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'
33 - lf-infra-properties:
34 build-days-to-keep: '{build-days-to-keep}'
37 - lf-infra-parameters:
41 lftools-version: '{lftools-version}'
45 build-timeout: '{build-timeout}'
46 jenkins-ssh-credential: '{jenkins-ssh-credential}'
51 - docker_verify_boiler_plate: &docker_verify_boiler_plate
52 name: docker_verify_boiler_plate
58 refspec: '$GERRIT_REFSPEC'
59 choosing-strategy: 'default'
60 submodule-recursive: '{submodule-recursive}'
63 - gerrit-trigger-patch-submitted:
64 status-context: '{project}-Docker-Verify'
65 server: '{server-name}'
70 - docker_merge_boiler_plate: &docker_merge_boiler_plate
71 name: docker_merge_boiler_plate
75 refspec: '$GERRIT_REFSPEC'
76 choosing-strategy: 'default'
77 submodule-recursive: '{submodule-recursive}'
80 - gerrit-trigger-patch-merged:
81 server: '{server-name}'
92 name: '{project-name}-{stream}-merge-docker'
93 # Job template for Docker merge jobs
95 # The purpose of this job template is to run a docker build, and potentially
96 # test validation of the docker image
98 <<: *docker_job_boiler_plate
99 # yamllint disable-line rule:key-duplicates
100 <<: *docker_merge_boiler_plate
104 - lf-infra-docker-login:
105 global-settings-file: 'global-settings'
106 settings-file: '{mvn-settings}'
107 - shell: '{pre_build_script}'
109 # Docker registry is purposely not using an '_' so as to not conflict
110 # with the Jenkins global env var
111 properties-content: |
112 DOCKER_ARGS={docker_build_args}
113 DOCKER_NAME={docker_name}
114 DOCKER_ROOT={docker_root}
115 DOCKER_TAG={docker_tag}
117 DOCKERREGISTRY={docker_registry}
118 # Do the docker build
119 - shell: !include-raw: ../shell/docker-build.sh
121 # Import the docker image information from the build step
122 properties-file: 'env_inject.txt'
123 # Execute any post build clean-up or testing
124 - shell: '{post_build_script}'
125 # Provided all steps have already passed, push the docker image
126 - shell: !include-raw: ../shell/docker-push.sh
129 name: '{project-name}-{stream}-merge-docker-cascade-trigger'
130 # Job template for Docker merge jobs
132 # The purpose of this job template is to run a docker build, and potentially
133 # test validation of the docker image. This job is triggered by the it's corresponding
134 # job that builds the artifacts from which the docker image is built from. Projects
135 # using the {project-name}-{stream}-merge-docker job should move to this job. Because
136 # the {project-name}-{stream}-merge-docker has no garanties that the docker image is built
137 # from merged artifact.
139 <<: *docker_job_boiler_plate
140 # yamllint disable-line rule:key-duplicates
141 <<: *docker_merge_boiler_plate
145 - lf-infra-docker-login:
146 global-settings-file: 'global-settings'
147 settings-file: '{mvn-settings}'
148 - shell: '{pre_build_script}'
150 # Docker registry is purposely not using an '_' so as to not conflict
151 # with the Jenkins global env var
152 properties-content: |
153 DOCKER_ARGS={docker_build_args}
154 DOCKER_NAME={docker_name}
155 DOCKER_ROOT={docker_root}
156 DOCKER_TAG={docker_tag}
158 DOCKERREGISTRY={docker_registry}
159 # Do the docker build
160 - shell: !include-raw: ../shell/docker-build.sh
162 # Import the docker image information from the build step
163 properties-file: 'env_inject.txt'
164 # Execute any post build clean-up or testing
165 - shell: '{post_build_script}'
166 # Provided all steps have already passed, push the docker image
167 - shell: !include-raw: ../shell/docker-push.sh
175 name: '{project-name}-{stream}-verify-docker'
176 # Job template for Docker verify jobs
178 # The purpose of this job template is to run a docker build, and potentially
179 # test validation of the docker image
181 ######################
182 # Default parameters #
183 ######################
185 <<: *docker_job_boiler_plate
186 # yamllint disable-line rule:key-duplicates
187 <<: *docker_verify_boiler_plate
191 - lf-infra-docker-login:
192 global-settings-file: 'global-settings'
193 settings-file: '{mvn-settings}'
194 - shell: '{pre_build_script}'
196 # Docker registry is purposely not using an '_' so as to not conflict
197 # with the Jenkins global env var
198 properties-content: |
199 DOCKER_ARGS={docker_build_args}
200 DOCKER_NAME={docker_name}
201 DOCKER_ROOT={docker_root}
202 DOCKER_TAG={docker_tag}
204 DOCKERREGISTRY={docker_registry}
205 # Do the docker build
206 - shell: !include-raw: ../shell/docker-build.sh
208 # Import the docker image information from the build step
209 properties-file: 'env_inject.txt'
210 # Execute any post build clean-up or testing
211 - shell: '{post_build_script}'
214 name: '{project-name}-{stream}-verify-docker-cascade-trigger'
215 # Job template for Docker verify jobs
217 # The purpose of this job template is to run a docker build, and potentially
218 # test validation of the docker image. This job is triggered by the it's corresponding
219 # job that builds the artifacts from which the docker image is built from. Projects
220 # using the {project-name}-{stream}-verify-docker job should move to this job. Because
221 # the {project-name}-{stream}-verify-docker has no garanties that the docker image is built
222 # from merged artifact.
224 ######################
225 # Default parameters #
226 ######################
228 <<: *docker_job_boiler_plate
229 # yamllint disable-line rule:key-duplicates
230 <<: *docker_verify_boiler_plate
234 - lf-infra-docker-login:
235 global-settings-file: 'global-settings'
236 settings-file: '{mvn-settings}'
237 - shell: '{pre_build_script}'
239 # Docker registry is purposely not using an '_' so as to not conflict
240 # with the Jenkins global env var
241 properties-content: |
242 DOCKER_ARGS={docker_build_args}
243 DOCKER_NAME={docker_name}
244 DOCKER_ROOT={docker_root}
245 DOCKER_TAG={docker_tag}
247 DOCKERREGISTRY={docker_registry}
248 # Do the docker build
249 - shell: !include-raw: ../shell/docker-build.sh
251 # Import the docker image information from the build step
252 properties-file: 'env_inject.txt'
253 # Execute any post build clean-up or testing
254 - shell: '{post_build_script}'
262 name: '{project-name}-{stream}-release-version-docker-daily-no-sonar'
263 # Job template for Docker daily release jobs
265 # The purpose of this job template is to run "docker build and docker push"
266 # for projects using this template.
268 # Required Variables:
269 # branch: git branch (eg. stable/lithium or master)
270 <<: *docker_job_boiler_plate
272 docker_registry: '$DOCKER_REGISTRY:10003'
275 - lf-infra-gerrit-scm:
276 jenkins-ssh-credential: '{jenkins-ssh-credential}'
277 git-url: '$GIT_URL/$PROJECT'
278 refspec: '$GERRIT_REFSPEC'
279 branch: '$GERRIT_BRANCH'
280 submodule-recursive: true
281 choosing-strategy: default
285 - lf-infra-docker-login:
286 global-settings-file: 'global-settings'
287 settings-file: '{mvn-settings}'
288 - shell: '{pre_build_script}'
290 # Docker registry is purposely not using an '_' so as to not conflict
291 # with the Jenkins global env var
292 properties-content: |
293 DOCKER_ARGS={docker_build_args}
294 DOCKER_NAME={docker_name}
295 DOCKER_ROOT={docker_root}
296 DOCKER_TAG={docker_tag}
297 DOCKERREGISTRY={docker_registry}
300 # Do the docker build
301 - shell: !include-raw: ../shell/snapshot-strip.sh
302 - shell: !include-raw: ../shell/docker-build.sh
304 # Import the docker image information from the build step
305 properties-file: 'env_inject.txt'
306 # Execute any post build clean-up or testing
307 - shell: '{post_build_script}'
308 # Provided all steps have already passed, push the docker image
309 - shell: !include-raw: ../shell/docker-push.sh
314 - gerrit-trigger-release-manually:
315 server: '{server-name}'
320 name: '{project-name}-{stream}-release-version-docker-daily-no-sonar-cascade-trigger'
321 # Job template for Docker daily release job.
323 # The purpose of this job template is to run "docker build and docker push"
324 # for projects using this template. This job is triggered by the daily build
325 # that builds the artifacts required for building the Docker image.
327 # Required Variables:
328 # branch: git branch (eg. stable/lithium or master)
329 <<: *docker_job_boiler_plate
331 docker_registry: '$DOCKER_REGISTRY:10003'
334 - lf-infra-gerrit-scm:
335 jenkins-ssh-credential: '{jenkins-ssh-credential}'
336 git-url: '$GIT_URL/$PROJECT'
337 refspec: '$GERRIT_REFSPEC'
338 branch: '$GERRIT_BRANCH'
339 submodule-recursive: true
340 choosing-strategy: default
344 - lf-infra-docker-login:
345 global-settings-file: 'global-settings'
346 settings-file: '{mvn-settings}'
347 - shell: '{pre_build_script}'
349 # Docker registry is purposely not using an '_' so as to not conflict
350 # with the Jenkins global env var
351 properties-content: |
352 DOCKER_ARGS={docker_build_args}
353 DOCKER_NAME={docker_name}
354 DOCKER_ROOT={docker_root}
355 DOCKER_TAG={docker_tag}
356 DOCKERREGISTRY={docker_registry}
359 # Do the docker build
360 - shell: !include-raw: ../shell/snapshot-strip.sh
361 - shell: !include-raw: ../shell/docker-build.sh
363 # Import the docker image information from the build step
364 properties-file: 'env_inject.txt'
365 # Execute any post build clean-up or testing
366 - shell: '{post_build_script}'
367 # Provided all steps have already passed, push the docker image
368 - shell: !include-raw: ../shell/docker-push.sh
377 name: '{project-name}-{subproject}-{stream}-merge-docker'
378 # Job template for Docker merge jobs
380 # The purpose of this job template is to run a docker build, and potentially
381 # test validation of the docker image
383 <<: *docker_job_boiler_plate
384 # yamllint disable-line rule:key-duplicates
385 <<: *docker_merge_boiler_plate
389 - lf-infra-docker-login:
390 global-settings-file: 'global-settings'
391 settings-file: '{mvn-settings}'
392 - shell: '{pre_build_script}'
394 # Docker registry is purposely not using an '_' so as to not conflict
395 # with the Jenkins global env var
396 properties-content: |
397 DOCKER_ARGS={docker_build_args}
398 DOCKER_NAME={docker_name}
399 DOCKER_ROOT={docker_root}
400 DOCKER_TAG={docker_tag}
401 DOCKERREGISTRY={docker_registry}
403 # Do the docker build
404 - shell: !include-raw: ../shell/docker-build.sh
406 # Import the docker image information from the build step
407 properties-file: 'env_inject.txt'
408 # Execute any post build clean-up or testing
409 - shell: '{post_build_script}'
410 # Provided all steps have already passed, push the docker image
411 - shell: !include-raw: ../shell/docker-push.sh
414 name: '{project-name}-{subproject}-{stream}-merge-docker-cascade-trigger'
415 # Job template for Docker merge jobs
417 # The purpose of this job template is to run a docker build, and potentially
418 # test validation of the docker image. This job is triggered by the merge job
419 # that builds the artifacts required for building the Docker image.
421 <<: *docker_job_boiler_plate
422 # yamllint disable-line rule:key-duplicates
423 <<: *docker_merge_boiler_plate
427 - lf-infra-docker-login:
428 global-settings-file: 'global-settings'
429 settings-file: '{mvn-settings}'
430 - shell: '{pre_build_script}'
432 # Docker registry is purposely not using an '_' so as to not conflict
433 # with the Jenkins global env var
434 properties-content: |
435 DOCKER_ARGS={docker_build_args}
436 DOCKER_NAME={docker_name}
437 DOCKER_ROOT={docker_root}
438 DOCKER_TAG={docker_tag}
439 DOCKERREGISTRY={docker_registry}
441 # Do the docker build
442 - shell: !include-raw: ../shell/docker-build.sh
444 # Import the docker image information from the build step
445 properties-file: 'env_inject.txt'
446 # Execute any post build clean-up or testing
447 - shell: '{post_build_script}'
448 # Provided all steps have already passed, push the docker image
449 - shell: !include-raw: ../shell/docker-push.sh
457 name: '{project-name}-{subproject}-{stream}-verify-docker'
458 # Job template for Docker verify jobs
460 # The purpose of this job template is to run a docker build, and potentially
461 # test validation of the docker image
463 ######################
464 # Default parameters #
465 ######################
467 <<: *docker_job_boiler_plate
468 # yamllint disable-line rule:key-duplicates
469 <<: *docker_verify_boiler_plate
473 - lf-infra-docker-login:
474 global-settings-file: 'global-settings'
475 settings-file: '{mvn-settings}'
476 - shell: '{pre_build_script}'
478 # Docker registry is purposely not using an '_' so as to not conflict
479 # with the Jenkins global env var
480 properties-content: |
481 DOCKER_ARGS={docker_build_args}
482 DOCKER_NAME={docker_name}
483 DOCKER_ROOT={docker_root}
484 DOCKER_TAG={docker_tag}
485 DOCKERREGISTRY={docker_registry}
487 # Do the docker build
488 - shell: !include-raw: ../shell/docker-build.sh
490 # Import the docker image information from the build step
491 properties-file: 'env_inject.txt'
492 # Execute any post build clean-up or testing
493 - shell: '{post_build_script}'
496 name: '{project-name}-{subproject}-{stream}-verify-docker-cascade-trigger'
497 # Job template for Docker verify jobs
499 # The purpose of this job template is to run a docker build, and potentially
500 # test validation of the docker image
502 ######################
503 # Default parameters #
504 ######################
506 <<: *docker_job_boiler_plate
507 # yamllint disable-line rule:key-duplicates
508 <<: *docker_verify_boiler_plate
512 - lf-infra-docker-login:
513 global-settings-file: 'global-settings'
514 settings-file: '{mvn-settings}'
515 - shell: '{pre_build_script}'
517 # Docker registry is purposely not using an '_' so as to not conflict
518 # with the Jenkins global env var
519 properties-content: |
520 DOCKER_ARGS={docker_build_args}
521 DOCKER_NAME={docker_name}
522 DOCKER_ROOT={docker_root}
523 DOCKER_TAG={docker_tag}
524 DOCKERREGISTRY={docker_registry}
526 # Do the docker build
527 - shell: !include-raw: ../shell/docker-build.sh
529 # Import the docker image information from the build step
530 properties-file: 'env_inject.txt'
531 # Execute any post build clean-up or testing
532 - shell: '{post_build_script}'
540 name: '{project-name}-{subproject}-{stream}-release-version-docker-daily-no-sonar'
541 # Job template for Docker daily release jobs
543 # The purpose of this job template is to run "docker build and docker push"
544 # for projects using this template.
546 # Required Variables:
547 # branch: git branch (eg. stable/lithium or master)
548 <<: *docker_job_boiler_plate
550 docker_registry: '$DOCKER_REGISTRY:10003'
553 - lf-infra-gerrit-scm:
554 jenkins-ssh-credential: '{jenkins-ssh-credential}'
555 git-url: '$GIT_URL/$PROJECT'
556 refspec: '$GERRIT_REFSPEC'
557 branch: '$GERRIT_BRANCH'
558 submodule-recursive: true
559 choosing-strategy: default
563 - lf-infra-docker-login:
564 global-settings-file: 'global-settings'
565 settings-file: '{mvn-settings}'
566 - shell: '{pre_build_script}'
568 # Docker registry is purposely not using an '_' so as to not conflict
569 # with the Jenkins global env var
570 properties-content: |
571 DOCKER_ARGS={docker_build_args}
572 DOCKER_NAME={docker_name}
573 DOCKER_ROOT={docker_root}
574 DOCKER_TAG={docker_tag}
575 DOCKERREGISTRY={docker_registry}
578 # Do the docker build
579 - shell: !include-raw: ../shell/snapshot-strip.sh
580 - shell: !include-raw: ../shell/docker-build.sh
582 # Import the docker image information from the build step
583 properties-file: 'env_inject.txt'
584 # Execute any post build clean-up or testing
585 - shell: '{post_build_script}'
586 # Provided all steps have already passed, push the docker image
587 - shell: !include-raw: ../shell/docker-push.sh
592 - gerrit-trigger-release-manually:
593 server: '{server-name}'
598 name: '{project-name}-{subproject}-{stream}-release-version-docker-daily-no-sonar-cascade-trigger'
599 # Job template for Docker daily release jobs
601 # The purpose of this job template is to run "docker build and docker push"
602 # for projects using this template. This job is triggered by the daily job
603 # that builds the artifacts required for building the Docker image.
605 # Required Variables:
606 # branch: git branch (eg. stable/lithium or master)
607 <<: *docker_job_boiler_plate
609 docker_registry: '$DOCKER_REGISTRY:10003'
612 - lf-infra-gerrit-scm:
613 jenkins-ssh-credential: '{jenkins-ssh-credential}'
614 git-url: '$GIT_URL/$PROJECT'
615 refspec: '$GERRIT_REFSPEC'
616 branch: '$GERRIT_BRANCH'
617 submodule-recursive: true
618 choosing-strategy: default
622 - lf-infra-docker-login:
623 global-settings-file: 'global-settings'
624 settings-file: '{mvn-settings}'
625 - shell: '{pre_build_script}'
627 # Docker registry is purposely not using an '_' so as to not conflict
628 # with the Jenkins global env var
629 properties-content: |
630 DOCKER_ARGS={docker_build_args}
631 DOCKER_NAME={docker_name}
632 DOCKER_ROOT={docker_root}
633 DOCKER_TAG={docker_tag}
634 DOCKERREGISTRY={docker_registry}
637 # Do the docker build
638 - shell: !include-raw: ../shell/snapshot-strip.sh
639 - shell: !include-raw: ../shell/docker-build.sh
641 # Import the docker image information from the build step
642 properties-file: 'env_inject.txt'
643 # Execute any post build clean-up or testing
644 - shell: '{post_build_script}'
645 # Provided all steps have already passed, push the docker image
646 - shell: !include-raw: ../shell/docker-push.sh
655 name: '{project-name}-{subproject}-{stream}-release-version-docker-no-sonar'
656 # Job template for Docker final release job
658 # The purpose of this job template is to run "docker build and docker push"
659 # for projects using this template.
661 # Required Variables:
662 # branch: git branch (eg. stable/lithium or master)
663 <<: *docker_job_boiler_plate
665 docker_registry: '$DOCKER_REGISTRY:10003'
668 - lf-infra-gerrit-scm:
669 jenkins-ssh-credential: '{jenkins-ssh-credential}'
670 git-url: '$GIT_URL/$PROJECT'
671 refspec: '$GERRIT_REFSPEC'
672 branch: '$GERRIT_BRANCH'
673 submodule-recursive: true
674 choosing-strategy: default
678 - lf-infra-docker-login:
679 global-settings-file: 'global-settings'
680 settings-file: '{mvn-settings}'
681 - shell: '{pre_build_script}'
683 # Docker registry is purposely not using an '_' so as to not conflict
684 # with the Jenkins global env var
685 properties-content: |
686 DOCKER_ARGS={docker_build_args}
687 DOCKER_NAME={docker_name}
688 DOCKER_ROOT={docker_root}
689 DOCKER_TAG={docker_tag}
690 DOCKERREGISTRY={docker_registry}
693 # Do the docker build
694 - shell: !include-raw: ../shell/snapshot-strip.sh
695 - shell: !include-raw: ../shell/docker-build.sh
697 # Import the docker image information from the build step
698 properties-file: 'env_inject.txt'
699 # Execute any post build clean-up or testing
700 - shell: '{post_build_script}'
701 # Provided all steps have already passed, push the docker image
702 - shell: !include-raw: ../shell/docker-push.sh
705 name: '{project-name}-{subproject}-{stream}-release-version-docker-cascade-trigger-no-sonar'
706 # Job template for Docker final release job
708 # The purpose of this job template is to run "docker build and docker push"
709 # for projects using this template. This job has no cascading counterpart, because the
710 # final release is moved manually to the release repo.
712 # Required Variables:
713 # branch: git branch (eg. stable/lithium or master)
714 <<: *docker_job_boiler_plate
716 docker_registry: '$DOCKER_REGISTRY:10003'
719 - lf-infra-gerrit-scm:
720 jenkins-ssh-credential: '{jenkins-ssh-credential}'
721 git-url: '$GIT_URL/$PROJECT'
722 refspec: '$GERRIT_REFSPEC'
723 branch: '$GERRIT_BRANCH'
724 submodule-recursive: true
725 choosing-strategy: default
729 - lf-infra-docker-login:
730 global-settings-file: 'global-settings'
731 settings-file: '{mvn-settings}'
732 - shell: '{pre_build_script}'
734 # Docker registry is purposely not using an '_' so as to not conflict
735 # with the Jenkins global env var
736 properties-content: |
737 DOCKER_ARGS={docker_build_args}
738 DOCKER_NAME={docker_name}
739 DOCKER_ROOT={docker_root}
740 DOCKER_TAG={docker_tag}
741 DOCKERREGISTRY={docker_registry}
744 # Do the docker build
745 - shell: !include-raw: ../shell/snapshot-strip.sh
746 - shell: !include-raw: ../shell/docker-build.sh
748 # Import the docker image information from the build step
749 properties-file: 'env_inject.txt'
750 # Execute any post build clean-up or testing
751 - shell: '{post_build_script}'
752 # Provided all steps have already passed, push the docker image
753 - shell: !include-raw: ../shell/docker-push.sh