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
103 - lf-infra-docker-login:
104 global-settings-file: 'global-settings'
105 settings-file: '{mvn-settings}'
106 - shell: '{pre_build_script}'
108 # Docker registry is purposely not using an '_' so as to not conflict
109 # with the Jenkins global env var
110 properties-content: |
111 DOCKER_ARGS={docker_build_args}
112 DOCKER_NAME={docker_name}
113 DOCKER_ROOT={docker_root}
114 DOCKER_TAG={docker_tag}
116 DOCKERREGISTRY={docker_registry}
117 # Do the docker build
118 - shell: !include-raw: ../shell/docker-build.sh
120 # Import the docker image information from the build step
121 properties-file: 'env_inject.txt'
122 # Execute any post build clean-up or testing
123 - shell: '{post_build_script}'
124 # Provided all steps have already passed, push the docker image
125 - shell: !include-raw: ../shell/docker-push.sh
128 name: '{project-name}-{stream}-merge-docker-cascade-trigger'
129 # Job template for Docker merge jobs
131 # The purpose of this job template is to run a docker build, and potentially
132 # test validation of the docker image. This job is triggered by the it's corresponding
133 # job that builds the artifacts from which the docker image is built from. Projects
134 # using the {project-name}-{stream}-merge-docker job should move to this job. Because
135 # the {project-name}-{stream}-merge-docker has no garanties that the docker image is built
136 # from merged artifact.
138 <<: *docker_job_boiler_plate
139 # yamllint disable-line rule:key-duplicates
140 <<: *docker_merge_boiler_plate
143 - lf-infra-docker-login:
144 global-settings-file: 'global-settings'
145 settings-file: '{mvn-settings}'
146 - shell: '{pre_build_script}'
148 # Docker registry is purposely not using an '_' so as to not conflict
149 # with the Jenkins global env var
150 properties-content: |
151 DOCKER_ARGS={docker_build_args}
152 DOCKER_NAME={docker_name}
153 DOCKER_ROOT={docker_root}
154 DOCKER_TAG={docker_tag}
156 DOCKERREGISTRY={docker_registry}
157 # Do the docker build
158 - shell: !include-raw: ../shell/docker-build.sh
160 # Import the docker image information from the build step
161 properties-file: 'env_inject.txt'
162 # Execute any post build clean-up or testing
163 - shell: '{post_build_script}'
164 # Provided all steps have already passed, push the docker image
165 - shell: !include-raw: ../shell/docker-push.sh
173 name: '{project-name}-{stream}-verify-docker'
174 # Job template for Docker verify jobs
176 # The purpose of this job template is to run a docker build, and potentially
177 # test validation of the docker image
179 ######################
180 # Default parameters #
181 ######################
183 <<: *docker_job_boiler_plate
184 # yamllint disable-line rule:key-duplicates
185 <<: *docker_verify_boiler_plate
188 - lf-infra-docker-login:
189 global-settings-file: 'global-settings'
190 settings-file: '{mvn-settings}'
191 - shell: '{pre_build_script}'
193 # Docker registry is purposely not using an '_' so as to not conflict
194 # with the Jenkins global env var
195 properties-content: |
196 DOCKER_ARGS={docker_build_args}
197 DOCKER_NAME={docker_name}
198 DOCKER_ROOT={docker_root}
199 DOCKER_TAG={docker_tag}
201 DOCKERREGISTRY={docker_registry}
202 # Do the docker build
203 - shell: !include-raw: ../shell/docker-build.sh
205 # Import the docker image information from the build step
206 properties-file: 'env_inject.txt'
207 # Execute any post build clean-up or testing
208 - shell: '{post_build_script}'
211 name: '{project-name}-{stream}-verify-docker-cascade-trigger'
212 # Job template for Docker verify jobs
214 # The purpose of this job template is to run a docker build, and potentially
215 # test validation of the docker image. This job is triggered by the it's corresponding
216 # job that builds the artifacts from which the docker image is built from. Projects
217 # using the {project-name}-{stream}-verify-docker job should move to this job. Because
218 # the {project-name}-{stream}-verify-docker has no garanties that the docker image is built
219 # from merged artifact.
221 ######################
222 # Default parameters #
223 ######################
225 <<: *docker_job_boiler_plate
226 # yamllint disable-line rule:key-duplicates
227 <<: *docker_verify_boiler_plate
230 - lf-infra-docker-login:
231 global-settings-file: 'global-settings'
232 settings-file: '{mvn-settings}'
233 - shell: '{pre_build_script}'
235 # Docker registry is purposely not using an '_' so as to not conflict
236 # with the Jenkins global env var
237 properties-content: |
238 DOCKER_ARGS={docker_build_args}
239 DOCKER_NAME={docker_name}
240 DOCKER_ROOT={docker_root}
241 DOCKER_TAG={docker_tag}
243 DOCKERREGISTRY={docker_registry}
244 # Do the docker build
245 - shell: !include-raw: ../shell/docker-build.sh
247 # Import the docker image information from the build step
248 properties-file: 'env_inject.txt'
249 # Execute any post build clean-up or testing
250 - shell: '{post_build_script}'
258 name: '{project-name}-{stream}-release-version-docker-daily-no-sonar'
259 # Job template for Docker daily release jobs
261 # The purpose of this job template is to run "docker build and docker push"
262 # for projects using this template.
264 # Required Variables:
265 # branch: git branch (eg. stable/lithium or master)
266 <<: *docker_job_boiler_plate
268 docker_registry: '$DOCKER_REGISTRY:10003'
271 - lf-infra-gerrit-scm:
272 jenkins-ssh-credential: '{jenkins-ssh-credential}'
273 git-url: '$GIT_URL/$PROJECT'
274 refspec: '$GERRIT_REFSPEC'
275 branch: '$GERRIT_BRANCH'
276 submodule-recursive: true
277 choosing-strategy: default
280 - lf-infra-docker-login:
281 global-settings-file: 'global-settings'
282 settings-file: '{mvn-settings}'
283 - shell: '{pre_build_script}'
285 # Docker registry is purposely not using an '_' so as to not conflict
286 # with the Jenkins global env var
287 properties-content: |
288 DOCKER_ARGS={docker_build_args}
289 DOCKER_NAME={docker_name}
290 DOCKER_ROOT={docker_root}
291 DOCKER_TAG={docker_tag}
292 DOCKERREGISTRY={docker_registry}
295 # Do the docker build
296 - shell: !include-raw: ../shell/snapshot-strip.sh
297 - shell: !include-raw: ../shell/docker-build.sh
299 # Import the docker image information from the build step
300 properties-file: 'env_inject.txt'
301 # Execute any post build clean-up or testing
302 - shell: '{post_build_script}'
303 # Provided all steps have already passed, push the docker image
304 - shell: !include-raw: ../shell/docker-push.sh
308 - timed: 'H 11 * * *'
309 - gerrit-trigger-release-manually:
310 server: '{server-name}'
315 name: '{project-name}-{stream}-release-version-docker-daily-no-sonar-cascade-trigger'
316 # Job template for Docker daily release job.
318 # The purpose of this job template is to run "docker build and docker push"
319 # for projects using this template. This job is triggered by the daily build
320 # that builds the artifacts required for building the Docker image.
322 # Required Variables:
323 # branch: git branch (eg. stable/lithium or master)
324 <<: *docker_job_boiler_plate
326 docker_registry: '$DOCKER_REGISTRY:10003'
329 - lf-infra-gerrit-scm:
330 jenkins-ssh-credential: '{jenkins-ssh-credential}'
331 git-url: '$GIT_URL/$PROJECT'
332 refspec: '$GERRIT_REFSPEC'
333 branch: '$GERRIT_BRANCH'
334 submodule-recursive: true
335 choosing-strategy: default
338 - lf-infra-docker-login:
339 global-settings-file: 'global-settings'
340 settings-file: '{mvn-settings}'
341 - shell: '{pre_build_script}'
343 # Docker registry is purposely not using an '_' so as to not conflict
344 # with the Jenkins global env var
345 properties-content: |
346 DOCKER_ARGS={docker_build_args}
347 DOCKER_NAME={docker_name}
348 DOCKER_ROOT={docker_root}
349 DOCKER_TAG={docker_tag}
350 DOCKERREGISTRY={docker_registry}
353 # Do the docker build
354 - shell: !include-raw: ../shell/snapshot-strip.sh
355 - shell: !include-raw: ../shell/docker-build.sh
357 # Import the docker image information from the build step
358 properties-file: 'env_inject.txt'
359 # Execute any post build clean-up or testing
360 - shell: '{post_build_script}'
361 # Provided all steps have already passed, push the docker image
362 - shell: !include-raw: ../shell/docker-push.sh
371 name: '{project-name}-{subproject}-{stream}-merge-docker'
372 # Job template for Docker merge jobs
374 # The purpose of this job template is to run a docker build, and potentially
375 # test validation of the docker image
377 <<: *docker_job_boiler_plate
378 # yamllint disable-line rule:key-duplicates
379 <<: *docker_merge_boiler_plate
382 - lf-infra-docker-login:
383 global-settings-file: 'global-settings'
384 settings-file: '{mvn-settings}'
385 - shell: '{pre_build_script}'
387 # Docker registry is purposely not using an '_' so as to not conflict
388 # with the Jenkins global env var
389 properties-content: |
390 DOCKER_ARGS={docker_build_args}
391 DOCKER_NAME={docker_name}
392 DOCKER_ROOT={docker_root}
393 DOCKER_TAG={docker_tag}
394 DOCKERREGISTRY={docker_registry}
396 # Do the docker build
397 - shell: !include-raw: ../shell/docker-build.sh
399 # Import the docker image information from the build step
400 properties-file: 'env_inject.txt'
401 # Execute any post build clean-up or testing
402 - shell: '{post_build_script}'
403 # Provided all steps have already passed, push the docker image
404 - shell: !include-raw: ../shell/docker-push.sh
407 name: '{project-name}-{subproject}-{stream}-merge-docker-cascade-trigger'
408 # Job template for Docker merge jobs
410 # The purpose of this job template is to run a docker build, and potentially
411 # test validation of the docker image. This job is triggered by the merge job
412 # that builds the artifacts required for building the Docker image.
414 <<: *docker_job_boiler_plate
415 # yamllint disable-line rule:key-duplicates
416 <<: *docker_merge_boiler_plate
419 - lf-infra-docker-login:
420 global-settings-file: 'global-settings'
421 settings-file: '{mvn-settings}'
422 - shell: '{pre_build_script}'
424 # Docker registry is purposely not using an '_' so as to not conflict
425 # with the Jenkins global env var
426 properties-content: |
427 DOCKER_ARGS={docker_build_args}
428 DOCKER_NAME={docker_name}
429 DOCKER_ROOT={docker_root}
430 DOCKER_TAG={docker_tag}
431 DOCKERREGISTRY={docker_registry}
433 # Do the docker build
434 - shell: !include-raw: ../shell/docker-build.sh
436 # Import the docker image information from the build step
437 properties-file: 'env_inject.txt'
438 # Execute any post build clean-up or testing
439 - shell: '{post_build_script}'
440 # Provided all steps have already passed, push the docker image
441 - shell: !include-raw: ../shell/docker-push.sh
449 name: '{project-name}-{subproject}-{stream}-verify-docker'
450 # Job template for Docker verify jobs
452 # The purpose of this job template is to run a docker build, and potentially
453 # test validation of the docker image
455 ######################
456 # Default parameters #
457 ######################
459 <<: *docker_job_boiler_plate
460 # yamllint disable-line rule:key-duplicates
461 <<: *docker_verify_boiler_plate
464 - lf-infra-docker-login:
465 global-settings-file: 'global-settings'
466 settings-file: '{mvn-settings}'
467 - shell: '{pre_build_script}'
469 # Docker registry is purposely not using an '_' so as to not conflict
470 # with the Jenkins global env var
471 properties-content: |
472 DOCKER_ARGS={docker_build_args}
473 DOCKER_NAME={docker_name}
474 DOCKER_ROOT={docker_root}
475 DOCKER_TAG={docker_tag}
476 DOCKERREGISTRY={docker_registry}
478 # Do the docker build
479 - shell: !include-raw: ../shell/docker-build.sh
481 # Import the docker image information from the build step
482 properties-file: 'env_inject.txt'
483 # Execute any post build clean-up or testing
484 - shell: '{post_build_script}'
487 name: '{project-name}-{subproject}-{stream}-verify-docker-cascade-trigger'
488 # Job template for Docker verify jobs
490 # The purpose of this job template is to run a docker build, and potentially
491 # test validation of the docker image
493 ######################
494 # Default parameters #
495 ######################
497 <<: *docker_job_boiler_plate
498 # yamllint disable-line rule:key-duplicates
499 <<: *docker_verify_boiler_plate
502 - lf-infra-docker-login:
503 global-settings-file: 'global-settings'
504 settings-file: '{mvn-settings}'
505 - shell: '{pre_build_script}'
507 # Docker registry is purposely not using an '_' so as to not conflict
508 # with the Jenkins global env var
509 properties-content: |
510 DOCKER_ARGS={docker_build_args}
511 DOCKER_NAME={docker_name}
512 DOCKER_ROOT={docker_root}
513 DOCKER_TAG={docker_tag}
514 DOCKERREGISTRY={docker_registry}
516 # Do the docker build
517 - shell: !include-raw: ../shell/docker-build.sh
519 # Import the docker image information from the build step
520 properties-file: 'env_inject.txt'
521 # Execute any post build clean-up or testing
522 - shell: '{post_build_script}'
530 name: '{project-name}-{subproject}-{stream}-release-version-docker-daily-no-sonar'
531 # Job template for Docker daily release jobs
533 # The purpose of this job template is to run "docker build and docker push"
534 # for projects using this template.
536 # Required Variables:
537 # branch: git branch (eg. stable/lithium or master)
538 <<: *docker_job_boiler_plate
540 docker_registry: '$DOCKER_REGISTRY:10003'
543 - lf-infra-gerrit-scm:
544 jenkins-ssh-credential: '{jenkins-ssh-credential}'
545 git-url: '$GIT_URL/$PROJECT'
546 refspec: '$GERRIT_REFSPEC'
547 branch: '$GERRIT_BRANCH'
548 submodule-recursive: true
549 choosing-strategy: default
552 - lf-infra-docker-login:
553 global-settings-file: 'global-settings'
554 settings-file: '{mvn-settings}'
555 - shell: '{pre_build_script}'
557 # Docker registry is purposely not using an '_' so as to not conflict
558 # with the Jenkins global env var
559 properties-content: |
560 DOCKER_ARGS={docker_build_args}
561 DOCKER_NAME={docker_name}
562 DOCKER_ROOT={docker_root}
563 DOCKER_TAG={docker_tag}
564 DOCKERREGISTRY={docker_registry}
567 # Do the docker build
568 - shell: !include-raw: ../shell/snapshot-strip.sh
569 - shell: !include-raw: ../shell/docker-build.sh
571 # Import the docker image information from the build step
572 properties-file: 'env_inject.txt'
573 # Execute any post build clean-up or testing
574 - shell: '{post_build_script}'
575 # Provided all steps have already passed, push the docker image
576 - shell: !include-raw: ../shell/docker-push.sh
580 - timed: 'H 11 * * *'
581 - gerrit-trigger-release-manually:
582 server: '{server-name}'
587 name: '{project-name}-{subproject}-{stream}-release-version-docker-daily-no-sonar-cascade-trigger'
588 # Job template for Docker daily release jobs
590 # The purpose of this job template is to run "docker build and docker push"
591 # for projects using this template. This job is triggered by the daily job
592 # that builds the artifacts required for building the Docker image.
594 # Required Variables:
595 # branch: git branch (eg. stable/lithium or master)
596 <<: *docker_job_boiler_plate
598 docker_registry: '$DOCKER_REGISTRY:10003'
601 - lf-infra-gerrit-scm:
602 jenkins-ssh-credential: '{jenkins-ssh-credential}'
603 git-url: '$GIT_URL/$PROJECT'
604 refspec: '$GERRIT_REFSPEC'
605 branch: '$GERRIT_BRANCH'
606 submodule-recursive: true
607 choosing-strategy: default
610 - lf-infra-docker-login:
611 global-settings-file: 'global-settings'
612 settings-file: '{mvn-settings}'
613 - shell: '{pre_build_script}'
615 # Docker registry is purposely not using an '_' so as to not conflict
616 # with the Jenkins global env var
617 properties-content: |
618 DOCKER_ARGS={docker_build_args}
619 DOCKER_NAME={docker_name}
620 DOCKER_ROOT={docker_root}
621 DOCKER_TAG={docker_tag}
622 DOCKERREGISTRY={docker_registry}
625 # Do the docker build
626 - shell: !include-raw: ../shell/snapshot-strip.sh
627 - shell: !include-raw: ../shell/docker-build.sh
629 # Import the docker image information from the build step
630 properties-file: 'env_inject.txt'
631 # Execute any post build clean-up or testing
632 - shell: '{post_build_script}'
633 # Provided all steps have already passed, push the docker image
634 - shell: !include-raw: ../shell/docker-push.sh
643 name: '{project-name}-{subproject}-{stream}-release-version-docker-no-sonar'
644 # Job template for Docker final release job
646 # The purpose of this job template is to run "docker build and docker push"
647 # for projects using this template.
649 # Required Variables:
650 # branch: git branch (eg. stable/lithium or master)
651 <<: *docker_job_boiler_plate
653 docker_registry: '$DOCKER_REGISTRY:10003'
656 - lf-infra-gerrit-scm:
657 jenkins-ssh-credential: '{jenkins-ssh-credential}'
658 git-url: '$GIT_URL/$PROJECT'
659 refspec: '$GERRIT_REFSPEC'
660 branch: '$GERRIT_BRANCH'
661 submodule-recursive: true
662 choosing-strategy: default
665 - lf-infra-docker-login:
666 global-settings-file: 'global-settings'
667 settings-file: '{mvn-settings}'
668 - shell: '{pre_build_script}'
670 # Docker registry is purposely not using an '_' so as to not conflict
671 # with the Jenkins global env var
672 properties-content: |
673 DOCKER_ARGS={docker_build_args}
674 DOCKER_NAME={docker_name}
675 DOCKER_ROOT={docker_root}
676 DOCKER_TAG={docker_tag}
677 DOCKERREGISTRY={docker_registry}
680 # Do the docker build
681 - shell: !include-raw: ../shell/snapshot-strip.sh
682 - shell: !include-raw: ../shell/docker-build.sh
684 # Import the docker image information from the build step
685 properties-file: 'env_inject.txt'
686 # Execute any post build clean-up or testing
687 - shell: '{post_build_script}'
688 # Provided all steps have already passed, push the docker image
689 - shell: !include-raw: ../shell/docker-push.sh
692 name: '{project-name}-{subproject}-{stream}-release-version-docker-cascade-trigger-no-sonar'
693 # Job template for Docker final release job
695 # The purpose of this job template is to run "docker build and docker push"
696 # for projects using this template. This job has no cascading counterpart, because the
697 # final release is moved manually to the release repo.
699 # Required Variables:
700 # branch: git branch (eg. stable/lithium or master)
701 <<: *docker_job_boiler_plate
703 docker_registry: '$DOCKER_REGISTRY:10003'
706 - lf-infra-gerrit-scm:
707 jenkins-ssh-credential: '{jenkins-ssh-credential}'
708 git-url: '$GIT_URL/$PROJECT'
709 refspec: '$GERRIT_REFSPEC'
710 branch: '$GERRIT_BRANCH'
711 submodule-recursive: true
712 choosing-strategy: default
715 - lf-infra-docker-login:
716 global-settings-file: 'global-settings'
717 settings-file: '{mvn-settings}'
718 - shell: '{pre_build_script}'
720 # Docker registry is purposely not using an '_' so as to not conflict
721 # with the Jenkins global env var
722 properties-content: |
723 DOCKER_ARGS={docker_build_args}
724 DOCKER_NAME={docker_name}
725 DOCKER_ROOT={docker_root}
726 DOCKER_TAG={docker_tag}
727 DOCKERREGISTRY={docker_registry}
730 # Do the docker build
731 - shell: !include-raw: ../shell/snapshot-strip.sh
732 - shell: !include-raw: ../shell/docker-build.sh
734 # Import the docker image information from the build step
735 properties-file: 'env_inject.txt'
736 # Execute any post build clean-up or testing
737 - shell: '{post_build_script}'
738 # Provided all steps have already passed, push the docker image
739 - shell: !include-raw: ../shell/docker-push.sh