Fetch CLM updates from global-jjb
[ci-management.git] / jjb / global-templates-docker.yaml
1 ---
2 ###########
3 # ANCHORS #
4 ###########
5 - docker_job_boiler_plate: &docker_job_boiler_plate
6     name: docker_job_boiler_plate
7
8     project-type: freestyle
9     node: '{build-node}'
10
11     ######################
12     # Default parameters #
13     ######################
14
15     branch: master
16     submodule-recursive: true
17
18     # default params for docker jobs
19     pre_build_script: ''
20     post_build_script: ''
21     docker_root: '$WORKSPACE'
22     docker_build_args: ''
23     docker_name: 'unnamed'
24     # Default to LF standard 'snapshots' docker registry
25     docker_registry: '$DOCKER_REGISTRY:10003'
26     docker_tag: 'latest'
27     submodule-timeout: 10
28
29     #####################
30     # Job Configuration #
31     #####################
32
33     properties:
34       - lf-infra-properties:
35           build-days-to-keep: '{build-days-to-keep}'
36
37     parameters:
38       - lf-infra-parameters:
39           branch: '{branch}'
40           project: '{project}'
41           stream: '{stream}'
42           lftools-version: '{lftools-version}'
43
44     wrappers:
45       - lf-infra-wrappers:
46           build-timeout: '{build-timeout}'
47           jenkins-ssh-credential: '{jenkins-ssh-credential}'
48
49     publishers:
50       - lf-infra-publish
51
52 - docker_verify_boiler_plate: &docker_verify_boiler_plate
53     name: docker_verify_boiler_plate
54
55     concurrent: true
56
57     scm:
58       - gerrit-trigger-scm:
59           refspec: '$GERRIT_REFSPEC'
60           choosing-strategy: 'default'
61           submodule-recursive: '{submodule-recursive}'
62
63     triggers:
64       - gerrit-trigger-patch-submitted:
65           status-context: '{project}-Docker-Verify'
66           server: '{server-name}'
67           project: '{project}'
68           branch: '{branch}'
69           files: '{files}'
70
71 - docker_merge_boiler_plate: &docker_merge_boiler_plate
72     name: docker_merge_boiler_plate
73
74     scm:
75       - gerrit-trigger-scm:
76           refspec: '$GERRIT_REFSPEC'
77           choosing-strategy: 'default'
78           submodule-recursive: '{submodule-recursive}'
79
80     triggers:
81       - gerrit-trigger-patch-merged:
82           server: '{server-name}'
83           project: '{project}'
84           branch: '{branch}'
85           files: '{files}'
86       - pollscm:
87           cron: ''
88
89 #################
90 # JOB TEMPLATES #
91 #################
92 - job-template:
93     name: '{project-name}-{stream}-merge-docker'
94     # Job template for Docker merge jobs
95     #
96     # The purpose of this job template is to run a docker build, and potentially
97     # test validation of the docker image
98
99     <<: *docker_job_boiler_plate
100     # yamllint disable-line rule:key-duplicates
101     <<: *docker_merge_boiler_plate
102
103     builders:
104       - lf-infra-docker-login:
105           global-settings-file: 'global-settings'
106           settings-file: '{mvn-settings}'
107       - shell: '{pre_build_script}'
108       - inject:
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}
116             BUILD_MODE=SNAPSHOT
117             DOCKERREGISTRY={docker_registry}
118       # Do the docker build
119       - shell: !include-raw: ../shell/docker-build.sh
120       - inject:
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
127
128 - job-template:
129     name: '{project-name}-{stream}-merge-docker-cascade-trigger'
130     # Job template for Docker merge jobs
131     #
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.
138
139     <<: *docker_job_boiler_plate
140     # yamllint disable-line rule:key-duplicates
141     <<: *docker_merge_boiler_plate
142
143     builders:
144       - lf-infra-docker-login:
145           global-settings-file: 'global-settings'
146           settings-file: '{mvn-settings}'
147       - shell: '{pre_build_script}'
148       - inject:
149           # Docker registry is purposely not using an '_' so as to not conflict
150           # with the Jenkins global env var
151           properties-content: |
152             DOCKER_ARGS={docker_build_args}
153             DOCKER_NAME={docker_name}
154             DOCKER_ROOT={docker_root}
155             DOCKER_TAG={docker_tag}
156             BUILD_MODE=SNAPSHOT
157             DOCKERREGISTRY={docker_registry}
158       # Do the docker build
159       - shell: !include-raw: ../shell/docker-build.sh
160       - inject:
161           # Import the docker image information from the build step
162           properties-file: 'env_inject.txt'
163       # Execute any post build clean-up or testing
164       - shell: '{post_build_script}'
165       # Provided all steps have already passed, push the docker image
166       - shell: !include-raw: ../shell/docker-push.sh
167     triggers:
168       - reverse:
169           jobs:
170             - '{parent_job}'
171           result: 'success'
172
173 - job-template:
174     name: '{project-name}-{stream}-verify-docker'
175     # Job template for Docker verify jobs
176     #
177     # The purpose of this job template is to run a docker build, and potentially
178     # test validation of the docker image
179
180     ######################
181     # Default parameters #
182     ######################
183
184     <<: *docker_job_boiler_plate
185     # yamllint disable-line rule:key-duplicates
186     <<: *docker_verify_boiler_plate
187
188     builders:
189       - lf-infra-docker-login:
190           global-settings-file: 'global-settings'
191           settings-file: '{mvn-settings}'
192       - shell: '{pre_build_script}'
193       - inject:
194           # Docker registry is purposely not using an '_' so as to not conflict
195           # with the Jenkins global env var
196           properties-content: |
197             DOCKER_ARGS={docker_build_args}
198             DOCKER_NAME={docker_name}
199             DOCKER_ROOT={docker_root}
200             DOCKER_TAG={docker_tag}
201             BUILD_MODE=SNAPSHOT
202             DOCKERREGISTRY={docker_registry}
203       # Do the docker build
204       - shell: !include-raw: ../shell/docker-build.sh
205       - inject:
206           # Import the docker image information from the build step
207           properties-file: 'env_inject.txt'
208       # Execute any post build clean-up or testing
209       - shell: '{post_build_script}'
210
211 - job-template:
212     name: '{project-name}-{stream}-verify-docker-cascade-trigger'
213     # Job template for Docker verify jobs
214     #
215     # The purpose of this job template is to run a docker build, and potentially
216     # test validation of the docker image. This job is triggered by the it's corresponding
217     # job that builds the artifacts from which the docker image is built from. Projects
218     # using the {project-name}-{stream}-verify-docker job should move to this job. Because
219     # the {project-name}-{stream}-verify-docker has no garanties that the docker image is built
220     # from merged artifact.
221
222     ######################
223     # Default parameters #
224     ######################
225
226     <<: *docker_job_boiler_plate
227     # yamllint disable-line rule:key-duplicates
228     <<: *docker_verify_boiler_plate
229
230     builders:
231       - lf-infra-docker-login:
232           global-settings-file: 'global-settings'
233           settings-file: '{mvn-settings}'
234       - shell: '{pre_build_script}'
235       - inject:
236           # Docker registry is purposely not using an '_' so as to not conflict
237           # with the Jenkins global env var
238           properties-content: |
239             DOCKER_ARGS={docker_build_args}
240             DOCKER_NAME={docker_name}
241             DOCKER_ROOT={docker_root}
242             DOCKER_TAG={docker_tag}
243             BUILD_MODE=SNAPSHOT
244             DOCKERREGISTRY={docker_registry}
245       # Do the docker build
246       - shell: !include-raw: ../shell/docker-build.sh
247       - inject:
248           # Import the docker image information from the build step
249           properties-file: 'env_inject.txt'
250       # Execute any post build clean-up or testing
251       - shell: '{post_build_script}'
252     triggers:
253       - reverse:
254           jobs:
255             - '{parent_job}'
256           result: 'success'
257
258 - job-template:
259     name: '{project-name}-{stream}-release-version-docker-daily-no-sonar'
260     # Job template for Docker daily release jobs
261     #
262     # The purpose of this job template is to run "docker build and docker push"
263     # for projects using this template.
264     #
265     # Required Variables:
266     #     branch:    git branch (eg. stable/lithium or master)
267     <<: *docker_job_boiler_plate
268
269     docker_registry: '$DOCKER_REGISTRY:10003'
270
271     scm:
272       - lf-infra-gerrit-scm:
273           jenkins-ssh-credential: '{jenkins-ssh-credential}'
274           git-url: '$GIT_URL/$PROJECT'
275           refspec: '$GERRIT_REFSPEC'
276           branch: '$GERRIT_BRANCH'
277           submodule-recursive: true
278           submodule-timeout: '{submodule-timeout}'
279           choosing-strategy: default
280
281     builders:
282       - lf-infra-docker-login:
283           global-settings-file: 'global-settings'
284           settings-file: '{mvn-settings}'
285       - shell: '{pre_build_script}'
286       - inject:
287           # Docker registry is purposely not using an '_' so as to not conflict
288           # with the Jenkins global env var
289           properties-content: |
290             DOCKER_ARGS={docker_build_args}
291             DOCKER_NAME={docker_name}
292             DOCKER_ROOT={docker_root}
293             DOCKER_TAG={docker_tag}
294             DOCKERREGISTRY={docker_registry}
295             BUILD_MODE=STAGING
296
297       # Do the docker build
298       - shell: !include-raw: ../shell/snapshot-strip.sh
299       - shell: !include-raw: ../shell/docker-build.sh
300       - inject:
301           # Import the docker image information from the build step
302           properties-file: 'env_inject.txt'
303       # Execute any post build clean-up or testing
304       - shell: '{post_build_script}'
305       # Provided all steps have already passed, push the docker image
306       - shell: !include-raw: ../shell/docker-push.sh
307
308     triggers:
309       # 11 AM UTC
310       - timed: '@daily'
311       - gerrit-trigger-release-manually:
312           server: '{server-name}'
313           project: '{project}'
314           branch: '{branch}'
315
316 - job-template:
317     name: '{project-name}-{stream}-release-version-docker-daily-no-sonar-cascade-trigger'
318     # Job template for Docker daily release job.
319     #
320     # The purpose of this job template is to run "docker build and docker push"
321     # for projects using this template. This job is triggered by the daily build
322     # that builds the artifacts required for building the Docker image.
323     #
324     # Required Variables:
325     #     branch:    git branch (eg. stable/lithium or master)
326     <<: *docker_job_boiler_plate
327
328     docker_registry: '$DOCKER_REGISTRY:10003'
329
330     scm:
331       - lf-infra-gerrit-scm:
332           jenkins-ssh-credential: '{jenkins-ssh-credential}'
333           git-url: '$GIT_URL/$PROJECT'
334           refspec: '$GERRIT_REFSPEC'
335           branch: '$GERRIT_BRANCH'
336           submodule-recursive: true
337           submodule-timeout: '{submodule-timeout}'
338           choosing-strategy: default
339
340     builders:
341       - lf-infra-docker-login:
342           global-settings-file: 'global-settings'
343           settings-file: '{mvn-settings}'
344       - shell: '{pre_build_script}'
345       - inject:
346           # Docker registry is purposely not using an '_' so as to not conflict
347           # with the Jenkins global env var
348           properties-content: |
349             DOCKER_ARGS={docker_build_args}
350             DOCKER_NAME={docker_name}
351             DOCKER_ROOT={docker_root}
352             DOCKER_TAG={docker_tag}
353             DOCKERREGISTRY={docker_registry}
354             BUILD_MODE=STAGING
355
356       # Do the docker build
357       - shell: !include-raw: ../shell/snapshot-strip.sh
358       - shell: !include-raw: ../shell/docker-build.sh
359       - inject:
360           # Import the docker image information from the build step
361           properties-file: 'env_inject.txt'
362       # Execute any post build clean-up or testing
363       - shell: '{post_build_script}'
364       # Provided all steps have already passed, push the docker image
365       - shell: !include-raw: ../shell/docker-push.sh
366
367     triggers:
368       - reverse:
369           jobs:
370             - '{parent_job}'
371           result: 'success'
372
373 - job-template:
374     name: '{project-name}-{subproject}-{stream}-merge-docker'
375     # Job template for Docker merge jobs
376     #
377     # The purpose of this job template is to run a docker build, and potentially
378     # test validation of the docker image
379
380     <<: *docker_job_boiler_plate
381     # yamllint disable-line rule:key-duplicates
382     <<: *docker_merge_boiler_plate
383
384     builders:
385       - lf-infra-docker-login:
386           global-settings-file: 'global-settings'
387           settings-file: '{mvn-settings}'
388       - shell: '{pre_build_script}'
389       - inject:
390           # Docker registry is purposely not using an '_' so as to not conflict
391           # with the Jenkins global env var
392           properties-content: |
393             DOCKER_ARGS={docker_build_args}
394             DOCKER_NAME={docker_name}
395             DOCKER_ROOT={docker_root}
396             DOCKER_TAG={docker_tag}
397             DOCKERREGISTRY={docker_registry}
398             BUILD_MODE=SNAPSHOT
399       # Do the docker build
400       - shell: !include-raw: ../shell/docker-build.sh
401       - inject:
402           # Import the docker image information from the build step
403           properties-file: 'env_inject.txt'
404       # Execute any post build clean-up or testing
405       - shell: '{post_build_script}'
406       # Provided all steps have already passed, push the docker image
407       - shell: !include-raw: ../shell/docker-push.sh
408
409 - job-template:
410     name: '{project-name}-{subproject}-{stream}-merge-docker-cascade-trigger'
411     # Job template for Docker merge jobs
412     #
413     # The purpose of this job template is to run a docker build, and potentially
414     # test validation of the docker image. This job is triggered by the merge job
415     # that builds the artifacts required for building the Docker image.
416
417     <<: *docker_job_boiler_plate
418     # yamllint disable-line rule:key-duplicates
419     <<: *docker_merge_boiler_plate
420
421     builders:
422       - lf-infra-docker-login:
423           global-settings-file: 'global-settings'
424           settings-file: '{mvn-settings}'
425       - shell: '{pre_build_script}'
426       - inject:
427           # Docker registry is purposely not using an '_' so as to not conflict
428           # with the Jenkins global env var
429           properties-content: |
430             DOCKER_ARGS={docker_build_args}
431             DOCKER_NAME={docker_name}
432             DOCKER_ROOT={docker_root}
433             DOCKER_TAG={docker_tag}
434             DOCKERREGISTRY={docker_registry}
435             BUILD_MODE=SNAPSHOT
436       # Do the docker build
437       - shell: !include-raw: ../shell/docker-build.sh
438       - inject:
439           # Import the docker image information from the build step
440           properties-file: 'env_inject.txt'
441       # Execute any post build clean-up or testing
442       - shell: '{post_build_script}'
443       # Provided all steps have already passed, push the docker image
444       - shell: !include-raw: ../shell/docker-push.sh
445     triggers:
446       - reverse:
447           jobs:
448             - '{parent_job}'
449           result: 'success'
450
451 - job-template:
452     name: '{project-name}-{subproject}-{stream}-verify-docker'
453     # Job template for Docker verify jobs
454     #
455     # The purpose of this job template is to run a docker build, and potentially
456     # test validation of the docker image
457
458     ######################
459     # Default parameters #
460     ######################
461
462     <<: *docker_job_boiler_plate
463     # yamllint disable-line rule:key-duplicates
464     <<: *docker_verify_boiler_plate
465
466     builders:
467       - lf-infra-docker-login:
468           global-settings-file: 'global-settings'
469           settings-file: '{mvn-settings}'
470       - shell: '{pre_build_script}'
471       - inject:
472           # Docker registry is purposely not using an '_' so as to not conflict
473           # with the Jenkins global env var
474           properties-content: |
475             DOCKER_ARGS={docker_build_args}
476             DOCKER_NAME={docker_name}
477             DOCKER_ROOT={docker_root}
478             DOCKER_TAG={docker_tag}
479             DOCKERREGISTRY={docker_registry}
480             BUILD_MODE=SNAPSHOT
481       # Do the docker build
482       - shell: !include-raw: ../shell/docker-build.sh
483       - inject:
484           # Import the docker image information from the build step
485           properties-file: 'env_inject.txt'
486       # Execute any post build clean-up or testing
487       - shell: '{post_build_script}'
488
489 - job-template:
490     name: '{project-name}-{subproject}-{stream}-verify-docker-cascade-trigger'
491     # Job template for Docker verify jobs
492     #
493     # The purpose of this job template is to run a docker build, and potentially
494     # test validation of the docker image
495
496     ######################
497     # Default parameters #
498     ######################
499
500     <<: *docker_job_boiler_plate
501     # yamllint disable-line rule:key-duplicates
502     <<: *docker_verify_boiler_plate
503
504     builders:
505       - lf-infra-docker-login:
506           global-settings-file: 'global-settings'
507           settings-file: '{mvn-settings}'
508       - shell: '{pre_build_script}'
509       - inject:
510           # Docker registry is purposely not using an '_' so as to not conflict
511           # with the Jenkins global env var
512           properties-content: |
513             DOCKER_ARGS={docker_build_args}
514             DOCKER_NAME={docker_name}
515             DOCKER_ROOT={docker_root}
516             DOCKER_TAG={docker_tag}
517             DOCKERREGISTRY={docker_registry}
518             BUILD_MODE=SNAPSHOT
519       # Do the docker build
520       - shell: !include-raw: ../shell/docker-build.sh
521       - inject:
522           # Import the docker image information from the build step
523           properties-file: 'env_inject.txt'
524       # Execute any post build clean-up or testing
525       - shell: '{post_build_script}'
526     triggers:
527       - reverse:
528           jobs:
529             - '{parent_job}'
530           result: 'success'
531
532 - job-template:
533     name: '{project-name}-{subproject}-{stream}-release-version-docker-daily-no-sonar'
534     # Job template for Docker daily release jobs
535     #
536     # The purpose of this job template is to run "docker build and docker push"
537     # for projects using this template.
538     #
539     # Required Variables:
540     #     branch:    git branch (eg. stable/lithium or master)
541     <<: *docker_job_boiler_plate
542
543     docker_registry: '$DOCKER_REGISTRY:10003'
544
545     scm:
546       - lf-infra-gerrit-scm:
547           jenkins-ssh-credential: '{jenkins-ssh-credential}'
548           git-url: '$GIT_URL/$PROJECT'
549           refspec: '$GERRIT_REFSPEC'
550           branch: '$GERRIT_BRANCH'
551           submodule-recursive: true
552           submodule-timeout: '{submodule-timeout}'
553           choosing-strategy: default
554
555     builders:
556       - lf-infra-docker-login:
557           global-settings-file: 'global-settings'
558           settings-file: '{mvn-settings}'
559       - shell: '{pre_build_script}'
560       - inject:
561           # Docker registry is purposely not using an '_' so as to not conflict
562           # with the Jenkins global env var
563           properties-content: |
564             DOCKER_ARGS={docker_build_args}
565             DOCKER_NAME={docker_name}
566             DOCKER_ROOT={docker_root}
567             DOCKER_TAG={docker_tag}
568             DOCKERREGISTRY={docker_registry}
569             BUILD_MODE=STAGING
570
571       # Do the docker build
572       - shell: !include-raw: ../shell/snapshot-strip.sh
573       - shell: !include-raw: ../shell/docker-build.sh
574       - inject:
575           # Import the docker image information from the build step
576           properties-file: 'env_inject.txt'
577       # Execute any post build clean-up or testing
578       - shell: '{post_build_script}'
579       # Provided all steps have already passed, push the docker image
580       - shell: !include-raw: ../shell/docker-push.sh
581
582     triggers:
583       # 11 AM UTC
584       - timed: '@daily'
585       - gerrit-trigger-release-manually:
586           server: '{server-name}'
587           project: '{project}'
588           branch: '{branch}'
589
590 - job-template:
591     name: '{project-name}-{subproject}-{stream}-release-version-docker-daily-no-sonar-cascade-trigger'
592     # Job template for Docker daily release jobs
593     #
594     # The purpose of this job template is to run "docker build and docker push"
595     # for projects using this template. This job is triggered by the daily job
596     # that builds the artifacts required for building the Docker image.
597     #
598     # Required Variables:
599     #     branch:    git branch (eg. stable/lithium or master)
600     <<: *docker_job_boiler_plate
601
602     docker_registry: '$DOCKER_REGISTRY:10003'
603
604     scm:
605       - lf-infra-gerrit-scm:
606           jenkins-ssh-credential: '{jenkins-ssh-credential}'
607           git-url: '$GIT_URL/$PROJECT'
608           refspec: '$GERRIT_REFSPEC'
609           branch: '$GERRIT_BRANCH'
610           submodule-recursive: true
611           submodule-timeout: '{submodule-timeout}'
612           choosing-strategy: default
613
614     builders:
615       - lf-infra-docker-login:
616           global-settings-file: 'global-settings'
617           settings-file: '{mvn-settings}'
618       - shell: '{pre_build_script}'
619       - inject:
620           # Docker registry is purposely not using an '_' so as to not conflict
621           # with the Jenkins global env var
622           properties-content: |
623             DOCKER_ARGS={docker_build_args}
624             DOCKER_NAME={docker_name}
625             DOCKER_ROOT={docker_root}
626             DOCKER_TAG={docker_tag}
627             DOCKERREGISTRY={docker_registry}
628             BUILD_MODE=STAGING
629
630       # Do the docker build
631       - shell: !include-raw: ../shell/snapshot-strip.sh
632       - shell: !include-raw: ../shell/docker-build.sh
633       - inject:
634           # Import the docker image information from the build step
635           properties-file: 'env_inject.txt'
636       # Execute any post build clean-up or testing
637       - shell: '{post_build_script}'
638       # Provided all steps have already passed, push the docker image
639       - shell: !include-raw: ../shell/docker-push.sh
640
641     triggers:
642       - reverse:
643           jobs:
644             - '{parent_job}'
645           result: 'success'
646
647 - job-template:
648     name: '{project-name}-{subproject}-{stream}-release-version-docker-no-sonar'
649     # Job template for Docker final release job
650     #
651     # The purpose of this job template is to run "docker build and docker push"
652     # for projects using this template.
653     #
654     # Required Variables:
655     #     branch:    git branch (eg. stable/lithium or master)
656     <<: *docker_job_boiler_plate
657
658     docker_registry: '$DOCKER_REGISTRY:10003'
659
660     scm:
661       - lf-infra-gerrit-scm:
662           jenkins-ssh-credential: '{jenkins-ssh-credential}'
663           git-url: '$GIT_URL/$PROJECT'
664           refspec: '$GERRIT_REFSPEC'
665           branch: '$GERRIT_BRANCH'
666           submodule-recursive: true
667           submodule-timeout: '{submodule-timeout}'
668           choosing-strategy: default
669
670     builders:
671       - lf-infra-docker-login:
672           global-settings-file: 'global-settings'
673           settings-file: '{mvn-settings}'
674       - shell: '{pre_build_script}'
675       - inject:
676           # Docker registry is purposely not using an '_' so as to not conflict
677           # with the Jenkins global env var
678           properties-content: |
679             DOCKER_ARGS={docker_build_args}
680             DOCKER_NAME={docker_name}
681             DOCKER_ROOT={docker_root}
682             DOCKER_TAG={docker_tag}
683             DOCKERREGISTRY={docker_registry}
684             BUILD_MODE=STAGING
685
686       # Do the docker build
687       - shell: !include-raw: ../shell/snapshot-strip.sh
688       - shell: !include-raw: ../shell/docker-build.sh
689       - inject:
690           # Import the docker image information from the build step
691           properties-file: 'env_inject.txt'
692       # Execute any post build clean-up or testing
693       - shell: '{post_build_script}'
694       # Provided all steps have already passed, push the docker image
695       - shell: !include-raw: ../shell/docker-push.sh
696
697 - job-template:
698     name: '{project-name}-{subproject}-{stream}-release-version-docker-cascade-trigger-no-sonar'
699     # Job template for Docker final release job
700     #
701     # The purpose of this job template is to run "docker build and docker push"
702     # for projects using this template. This job has no cascading counterpart, because the
703     # final release is moved manually to the release repo.
704     #
705     # Required Variables:
706     #     branch:    git branch (eg. stable/lithium or master)
707     <<: *docker_job_boiler_plate
708
709     docker_registry: '$DOCKER_REGISTRY:10003'
710
711     scm:
712       - lf-infra-gerrit-scm:
713           jenkins-ssh-credential: '{jenkins-ssh-credential}'
714           git-url: '$GIT_URL/$PROJECT'
715           refspec: '$GERRIT_REFSPEC'
716           branch: '$GERRIT_BRANCH'
717           submodule-recursive: true
718           submodule-timeout: '{submodule-timeout}'
719           choosing-strategy: default
720
721     builders:
722       - lf-infra-docker-login:
723           global-settings-file: 'global-settings'
724           settings-file: '{mvn-settings}'
725       - shell: '{pre_build_script}'
726       - inject:
727           # Docker registry is purposely not using an '_' so as to not conflict
728           # with the Jenkins global env var
729           properties-content: |
730             DOCKER_ARGS={docker_build_args}
731             DOCKER_NAME={docker_name}
732             DOCKER_ROOT={docker_root}
733             DOCKER_TAG={docker_tag}
734             DOCKERREGISTRY={docker_registry}
735             BUILD_MODE=STAGING
736
737       # Do the docker build
738       - shell: !include-raw: ../shell/snapshot-strip.sh
739       - shell: !include-raw: ../shell/docker-build.sh
740       - inject:
741           # Import the docker image information from the build step
742           properties-file: 'env_inject.txt'
743       # Execute any post build clean-up or testing
744       - shell: '{post_build_script}'
745       # Provided all steps have already passed, push the docker image
746       - shell: !include-raw: ../shell/docker-push.sh
747     triggers:
748       - reverse:
749           jobs:
750             - '{parent_job}'
751           result: 'success'
752
753