Merge "VNFSDK-Refactor CLM project block"
[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
28     #####################
29     # Job Configuration #
30     #####################
31
32     properties:
33       - lf-infra-properties:
34           build-days-to-keep: '{build-days-to-keep}'
35
36     parameters:
37       - lf-infra-parameters:
38           branch: '{branch}'
39           project: '{project}'
40           stream: '{stream}'
41           lftools-version: '{lftools-version}'
42
43     wrappers:
44       - lf-infra-wrappers:
45           build-timeout: '{build-timeout}'
46           jenkins-ssh-credential: '{jenkins-ssh-credential}'
47
48     publishers:
49       - lf-infra-publish
50
51 - docker_verify_boiler_plate: &docker_verify_boiler_plate
52     name: docker_verify_boiler_plate
53
54     concurrent: true
55
56     scm:
57       - gerrit-trigger-scm:
58           refspec: '$GERRIT_REFSPEC'
59           choosing-strategy: 'default'
60           submodule-recursive: '{submodule-recursive}'
61
62     triggers:
63       - gerrit-trigger-patch-submitted:
64           status-context: '{project}-Docker-Verify'
65           server: '{server-name}'
66           project: '{project}'
67           branch: '{branch}'
68           files: '{files}'
69
70 - docker_merge_boiler_plate: &docker_merge_boiler_plate
71     name: docker_merge_boiler_plate
72
73     scm:
74       - gerrit-trigger-scm:
75           refspec: '$GERRIT_REFSPEC'
76           choosing-strategy: 'default'
77           submodule-recursive: '{submodule-recursive}'
78
79     triggers:
80       - gerrit-trigger-patch-merged:
81           server: '{server-name}'
82           project: '{project}'
83           branch: '{branch}'
84           files: '{files}'
85       - pollscm:
86           cron: ''
87
88 #################
89 # JOB TEMPLATES #
90 #################
91 - job-template:
92     name: '{project-name}-{stream}-merge-docker'
93     # Job template for Docker merge jobs
94     #
95     # The purpose of this job template is to run a docker build, and potentially
96     # test validation of the docker image
97
98     <<: *docker_job_boiler_plate
99     # yamllint disable-line rule:key-duplicates
100     <<: *docker_merge_boiler_plate
101
102     builders:
103       - lf-infra-pre-build
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-pre-build
145       - lf-infra-docker-login:
146           global-settings-file: 'global-settings'
147           settings-file: '{mvn-settings}'
148       - shell: '{pre_build_script}'
149       - inject:
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}
157             BUILD_MODE=SNAPSHOT
158             DOCKERREGISTRY={docker_registry}
159       # Do the docker build
160       - shell: !include-raw: ../shell/docker-build.sh
161       - inject:
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
168     triggers:
169       - reverse:
170           jobs:
171             - '{parent_job}'
172           result: 'success'
173
174 - job-template:
175     name: '{project-name}-{stream}-verify-docker'
176     # Job template for Docker verify jobs
177     #
178     # The purpose of this job template is to run a docker build, and potentially
179     # test validation of the docker image
180
181     ######################
182     # Default parameters #
183     ######################
184
185     <<: *docker_job_boiler_plate
186     # yamllint disable-line rule:key-duplicates
187     <<: *docker_verify_boiler_plate
188
189     builders:
190       - lf-infra-pre-build
191       - lf-infra-docker-login:
192           global-settings-file: 'global-settings'
193           settings-file: '{mvn-settings}'
194       - shell: '{pre_build_script}'
195       - inject:
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}
203             BUILD_MODE=SNAPSHOT
204             DOCKERREGISTRY={docker_registry}
205       # Do the docker build
206       - shell: !include-raw: ../shell/docker-build.sh
207       - inject:
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}'
212
213 - job-template:
214     name: '{project-name}-{stream}-verify-docker-cascade-trigger'
215     # Job template for Docker verify jobs
216     #
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.
223
224     ######################
225     # Default parameters #
226     ######################
227
228     <<: *docker_job_boiler_plate
229     # yamllint disable-line rule:key-duplicates
230     <<: *docker_verify_boiler_plate
231
232     builders:
233       - lf-infra-pre-build
234       - lf-infra-docker-login:
235           global-settings-file: 'global-settings'
236           settings-file: '{mvn-settings}'
237       - shell: '{pre_build_script}'
238       - inject:
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}
246             BUILD_MODE=SNAPSHOT
247             DOCKERREGISTRY={docker_registry}
248       # Do the docker build
249       - shell: !include-raw: ../shell/docker-build.sh
250       - inject:
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}'
255     triggers:
256       - reverse:
257           jobs:
258             - '{parent_job}'
259           result: 'success'
260
261 - job-template:
262     name: '{project-name}-{stream}-release-version-docker-daily-no-sonar'
263     # Job template for Docker daily release jobs
264     #
265     # The purpose of this job template is to run "docker build and docker push"
266     # for projects using this template.
267     #
268     # Required Variables:
269     #     branch:    git branch (eg. stable/lithium or master)
270     <<: *docker_job_boiler_plate
271
272     docker_registry: '$DOCKER_REGISTRY:10003'
273
274     scm:
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
282
283     builders:
284       - lf-infra-pre-build
285       - lf-infra-docker-login:
286           global-settings-file: 'global-settings'
287           settings-file: '{mvn-settings}'
288       - shell: '{pre_build_script}'
289       - inject:
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}
298             BUILD_MODE=STAGING
299
300       # Do the docker build
301       - shell: !include-raw: ../shell/snapshot-strip.sh
302       - shell: !include-raw: ../shell/docker-build.sh
303       - inject:
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
310
311     triggers:
312       # 11 AM UTC
313       - timed: '@daily'
314       - gerrit-trigger-release-manually:
315           server: '{server-name}'
316           project: '{project}'
317           branch: '{branch}'
318
319 - job-template:
320     name: '{project-name}-{stream}-release-version-docker-daily-no-sonar-cascade-trigger'
321     # Job template for Docker daily release job.
322     #
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.
326     #
327     # Required Variables:
328     #     branch:    git branch (eg. stable/lithium or master)
329     <<: *docker_job_boiler_plate
330
331     docker_registry: '$DOCKER_REGISTRY:10003'
332
333     scm:
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
341
342     builders:
343       - lf-infra-pre-build
344       - lf-infra-docker-login:
345           global-settings-file: 'global-settings'
346           settings-file: '{mvn-settings}'
347       - shell: '{pre_build_script}'
348       - inject:
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}
357             BUILD_MODE=STAGING
358
359       # Do the docker build
360       - shell: !include-raw: ../shell/snapshot-strip.sh
361       - shell: !include-raw: ../shell/docker-build.sh
362       - inject:
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
369
370     triggers:
371       - reverse:
372           jobs:
373             - '{parent_job}'
374           result: 'success'
375
376 - job-template:
377     name: '{project-name}-{subproject}-{stream}-merge-docker'
378     # Job template for Docker merge jobs
379     #
380     # The purpose of this job template is to run a docker build, and potentially
381     # test validation of the docker image
382
383     <<: *docker_job_boiler_plate
384     # yamllint disable-line rule:key-duplicates
385     <<: *docker_merge_boiler_plate
386
387     builders:
388       - lf-infra-pre-build
389       - lf-infra-docker-login:
390           global-settings-file: 'global-settings'
391           settings-file: '{mvn-settings}'
392       - shell: '{pre_build_script}'
393       - inject:
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}
402             BUILD_MODE=SNAPSHOT
403       # Do the docker build
404       - shell: !include-raw: ../shell/docker-build.sh
405       - inject:
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
412
413 - job-template:
414     name: '{project-name}-{subproject}-{stream}-merge-docker-cascade-trigger'
415     # Job template for Docker merge jobs
416     #
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.
420
421     <<: *docker_job_boiler_plate
422     # yamllint disable-line rule:key-duplicates
423     <<: *docker_merge_boiler_plate
424
425     builders:
426       - lf-infra-pre-build
427       - lf-infra-docker-login:
428           global-settings-file: 'global-settings'
429           settings-file: '{mvn-settings}'
430       - shell: '{pre_build_script}'
431       - inject:
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}
440             BUILD_MODE=SNAPSHOT
441       # Do the docker build
442       - shell: !include-raw: ../shell/docker-build.sh
443       - inject:
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
450     triggers:
451       - reverse:
452           jobs:
453             - '{parent_job}'
454           result: 'success'
455
456 - job-template:
457     name: '{project-name}-{subproject}-{stream}-verify-docker'
458     # Job template for Docker verify jobs
459     #
460     # The purpose of this job template is to run a docker build, and potentially
461     # test validation of the docker image
462
463     ######################
464     # Default parameters #
465     ######################
466
467     <<: *docker_job_boiler_plate
468     # yamllint disable-line rule:key-duplicates
469     <<: *docker_verify_boiler_plate
470
471     builders:
472       - lf-infra-pre-build
473       - lf-infra-docker-login:
474           global-settings-file: 'global-settings'
475           settings-file: '{mvn-settings}'
476       - shell: '{pre_build_script}'
477       - inject:
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}
486             BUILD_MODE=SNAPSHOT
487       # Do the docker build
488       - shell: !include-raw: ../shell/docker-build.sh
489       - inject:
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}'
494
495 - job-template:
496     name: '{project-name}-{subproject}-{stream}-verify-docker-cascade-trigger'
497     # Job template for Docker verify jobs
498     #
499     # The purpose of this job template is to run a docker build, and potentially
500     # test validation of the docker image
501
502     ######################
503     # Default parameters #
504     ######################
505
506     <<: *docker_job_boiler_plate
507     # yamllint disable-line rule:key-duplicates
508     <<: *docker_verify_boiler_plate
509
510     builders:
511       - lf-infra-pre-build
512       - lf-infra-docker-login:
513           global-settings-file: 'global-settings'
514           settings-file: '{mvn-settings}'
515       - shell: '{pre_build_script}'
516       - inject:
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}
525             BUILD_MODE=SNAPSHOT
526       # Do the docker build
527       - shell: !include-raw: ../shell/docker-build.sh
528       - inject:
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}'
533     triggers:
534       - reverse:
535           jobs:
536             - '{parent_job}'
537           result: 'success'
538
539 - job-template:
540     name: '{project-name}-{subproject}-{stream}-release-version-docker-daily-no-sonar'
541     # Job template for Docker daily release jobs
542     #
543     # The purpose of this job template is to run "docker build and docker push"
544     # for projects using this template.
545     #
546     # Required Variables:
547     #     branch:    git branch (eg. stable/lithium or master)
548     <<: *docker_job_boiler_plate
549
550     docker_registry: '$DOCKER_REGISTRY:10003'
551
552     scm:
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
560
561     builders:
562       - lf-infra-pre-build
563       - lf-infra-docker-login:
564           global-settings-file: 'global-settings'
565           settings-file: '{mvn-settings}'
566       - shell: '{pre_build_script}'
567       - inject:
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}
576             BUILD_MODE=STAGING
577
578       # Do the docker build
579       - shell: !include-raw: ../shell/snapshot-strip.sh
580       - shell: !include-raw: ../shell/docker-build.sh
581       - inject:
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
588
589     triggers:
590       # 11 AM UTC
591       - timed: '@daily'
592       - gerrit-trigger-release-manually:
593           server: '{server-name}'
594           project: '{project}'
595           branch: '{branch}'
596
597 - job-template:
598     name: '{project-name}-{subproject}-{stream}-release-version-docker-daily-no-sonar-cascade-trigger'
599     # Job template for Docker daily release jobs
600     #
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.
604     #
605     # Required Variables:
606     #     branch:    git branch (eg. stable/lithium or master)
607     <<: *docker_job_boiler_plate
608
609     docker_registry: '$DOCKER_REGISTRY:10003'
610
611     scm:
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
619
620     builders:
621       - lf-infra-pre-build
622       - lf-infra-docker-login:
623           global-settings-file: 'global-settings'
624           settings-file: '{mvn-settings}'
625       - shell: '{pre_build_script}'
626       - inject:
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}
635             BUILD_MODE=STAGING
636
637       # Do the docker build
638       - shell: !include-raw: ../shell/snapshot-strip.sh
639       - shell: !include-raw: ../shell/docker-build.sh
640       - inject:
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
647
648     triggers:
649       - reverse:
650           jobs:
651             - '{parent_job}'
652           result: 'success'
653
654 - job-template:
655     name: '{project-name}-{subproject}-{stream}-release-version-docker-no-sonar'
656     # Job template for Docker final release job
657     #
658     # The purpose of this job template is to run "docker build and docker push"
659     # for projects using this template.
660     #
661     # Required Variables:
662     #     branch:    git branch (eg. stable/lithium or master)
663     <<: *docker_job_boiler_plate
664
665     docker_registry: '$DOCKER_REGISTRY:10003'
666
667     scm:
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
675
676     builders:
677       - lf-infra-pre-build
678       - lf-infra-docker-login:
679           global-settings-file: 'global-settings'
680           settings-file: '{mvn-settings}'
681       - shell: '{pre_build_script}'
682       - inject:
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}
691             BUILD_MODE=STAGING
692
693       # Do the docker build
694       - shell: !include-raw: ../shell/snapshot-strip.sh
695       - shell: !include-raw: ../shell/docker-build.sh
696       - inject:
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
703
704 - job-template:
705     name: '{project-name}-{subproject}-{stream}-release-version-docker-cascade-trigger-no-sonar'
706     # Job template for Docker final release job
707     #
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.
711     #
712     # Required Variables:
713     #     branch:    git branch (eg. stable/lithium or master)
714     <<: *docker_job_boiler_plate
715
716     docker_registry: '$DOCKER_REGISTRY:10003'
717
718     scm:
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
726
727     builders:
728       - lf-infra-pre-build
729       - lf-infra-docker-login:
730           global-settings-file: 'global-settings'
731           settings-file: '{mvn-settings}'
732       - shell: '{pre_build_script}'
733       - inject:
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}
742             BUILD_MODE=STAGING
743
744       # Do the docker build
745       - shell: !include-raw: ../shell/snapshot-strip.sh
746       - shell: !include-raw: ../shell/docker-build.sh
747       - inject:
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
754     triggers:
755       - reverse:
756           jobs:
757             - '{parent_job}'
758           result: 'success'
759
760