Fix: Remove portal stage job
[ci-management.git] / jjb / global-templates-java.yaml
1 ---
2 - job-template: &verify_java_defaults
3     # Job template for Java verify jobs
4     #
5     # The purpose of this job template is to run:
6     # 1. maven clean install
7     #
8     # Required Variables:
9     #     branch:    git branch (eg. stable/lithium or master)
10
11     name: '{project-name}-{stream}-verify-java'
12
13     project-type: freestyle
14     concurrent: true
15     node: '{build-node}'
16     build-env-variables: ''
17     pattern: '**'
18     pom:
19     mvn-opts: ''
20     java-opts: ''
21     java-version: openjdk8
22     properties:
23       - infra-properties:
24           build-days-to-keep: '{build-days-to-keep}'
25
26     parameters:
27       - infra-parameters:
28           project: '{project}'
29           branch: '{branch}'
30           refspec: 'refs/heads/{branch}'
31           artifacts: '{archive-artifacts}'
32       - maven-exec:
33           maven-version: '{maven-version}'
34       - maven-params:
35           mvn-params: '{mvn-params}'
36
37     scm:
38       - gerrit-trigger-scm:
39           refspec: '$GERRIT_REFSPEC'
40           choosing-strategy: 'gerrit'
41           submodule-recursive: '{submodule-recursive}'
42
43     wrappers:
44       - infra-wrappers:
45           build-timeout: '{build-timeout}'
46
47     triggers:
48       - gerrit-trigger-patch-submitted:
49           server: '{server-name}'
50           project: '{project}'
51           branch: '{branch}'
52           files: '{obj:pattern}'
53
54     builders:
55       - lf-infra-pre-build
56       - lf-update-java-alternatives:
57           java-version: "{java-version}"
58       - provide-maven-settings:
59           global-settings-file: 'global-settings'
60           settings-file: '{mvn-settings}'
61       - inject:
62           properties-content: "{build-env-variables}"
63       - maven-target:
64           maven-version: '{maven-version}'
65           pom: '{obj:pom}'
66           goals: 'clean install -B
67             -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn {mvn-params}'
68           properties:
69             - MAVEN_OPTS='{mvn-opts}'
70           java-opts:
71             - "{java-opts}"
72           settings: '{mvn-settings}'
73           settings-type: cfp
74           global-settings: 'global-settings'
75           global-settings-type: cfp
76
77     publishers:
78       - lf-infra-publish
79
80 - job-template:
81     # Job template for Java verify jobs running checkstyle at the end
82     # When checkstyle will be fully incorporated, it is meant to replace
83     #  '{project-name}-{stream}-verify-java-checkstyle'
84     #
85     # The purpose of this job template is to run:
86     # 1. maven clean install
87     #
88     # This job publishes checkstyle results.
89     #
90     # Required Variables:
91     #     branch:    git branch (eg. stable/lithium or master)
92
93     <<: *verify_java_defaults
94     name: '{project-name}-{stream}-verify-java-checkstyle'
95
96     publishers:
97       - lf-infra-publish
98       - checkstyle-result
99
100 - job-template:
101     # Job template for Java verify jobs with POM not at the root
102     #
103     # The purpose of this job template is to run:
104     # 1. maven clean install
105     #
106     # This job supports subprojects.
107     #
108     # Required Variables:
109     #     branch:    git branch (eg. stable/lithium or master)
110     #     pom:       name/location of the pom.xml file relative to the workspace
111     #     pattern:   ant file-path pattern relative to the workspace used to
112     #                trigger the job
113
114     <<: *verify_java_defaults
115     name: '{project-name}-{stream}-{subproject}-verify-java'
116
117 - job-template:
118     # Job template for Java integration pairwise jobs
119     #
120     # The purpose of this job template is to run:
121     # 1. maven clean install
122     #
123     # Required Variables:
124     #     branch:    git branch (eg. stable/lithium or master)
125
126     <<: *verify_java_defaults
127     name: '{project-name}-{stream}-integration-pairwise'
128     triggers:
129       - timed: '@daily'
130       - gerrit-trigger-patch-submitted:
131           server: '{server-name}'
132           project: '{project}'
133           branch: '{branch}'
134           files: '{obj:pattern}'
135
136 - job-template:
137     # Job template for Java daily release jobs running checkstyle at the end
138     # When checkstyle will be fully incorporated, it is meant to replace
139     #  '{project-name}-{stream}-release-java-daily'
140     #
141     # The purpose of this job template is to run:
142     # 1. maven clean deploy with Sonar scans
143     #
144     # This job publishes checkstyle results.
145     # This job uses a conditional regex match step to set versions.
146     #
147     # Required Variables:
148     #     branch:    git branch (eg. stable/lithium or master)
149
150     name: '{project-name}-{stream}-release-java-daily-checkstyle'
151     project-type: freestyle
152     node: '{build-node}'
153     disabled: '{disabled}'
154     maven-deploy-properties:
155     properties:
156       - infra-properties:
157           build-days-to-keep: '{build-days-to-keep}'
158     parameters:
159       - infra-parameters:
160           project: '{project}'
161           branch: '{branch}'
162           refspec: 'refs/heads/{branch}'
163           artifacts: '{archive-artifacts}'
164       - maven-exec:
165           maven-version: '{maven-version}'
166     scm:
167       - gerrit-trigger-scm:
168           refspec: ''
169           choosing-strategy: 'default'
170           submodule-recursive: '{submodule-recursive}'
171     wrappers:
172       - infra-wrappers:
173           build-timeout: '{build-timeout}'
174     triggers:
175       # 11 AM UTC
176       - timed: '@daily'
177       - gerrit-trigger-release-manually:
178           server: '{server-name}'
179           project: '{project}'
180           branch: '{branch}'
181     builders:
182       - lf-infra-pre-build
183       - provide-maven-settings:
184           global-settings-file: 'global-settings'
185           settings-file: '{mvn-settings}'
186       - conditional-step:
187           condition-kind: regex-match
188           regex: DoSetVersion
189           label: '{setVersion}'
190           steps:
191             - inject:
192                 properties-file: version.properties
193             - maven-set-release-version:
194                 maven-version: '{maven-version}'
195                 mvn-settings: '{mvn-settings}'
196                 pom:
197       - maven-target:
198           maven-version: '{maven-version}'
199           goals: 'clean deploy -B
200             -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
201           properties: '{obj:mvn_properties}'
202           settings: '{mvn-settings}'
203           settings-type: cfp
204           global-settings: 'global-settings'
205           global-settings-type: cfp
206
207     publishers:
208       - lf-infra-publish
209       - checkstyle-result-daily
210
211 - job-template:
212     # Job template for Java daily release jobs
213     #
214     # The purpose of this job template is to run:
215     # 1. maven set versions
216     # 2. maven clean deploy with Sonar scans
217     #
218     # Required Variables:
219     #     branch:    git branch (eg. stable/lithium or master)
220
221     name: '{project-name}-{stream}-release-version-java-daily'
222
223     project-type: freestyle
224     disabled: '{disabled}'
225     node: '{build-node}'
226     maven-deploy-properties:
227     properties:
228       - infra-properties:
229           build-days-to-keep: '{build-days-to-keep}'
230
231     parameters:
232       - infra-parameters:
233           project: '{project}'
234           branch: '{branch}'
235           refspec: 'refs/heads/{branch}'
236           artifacts: '{archive-artifacts}'
237       - maven-exec:
238           maven-version: '{maven-version}'
239
240     scm:
241       - gerrit-trigger-scm:
242           refspec: ''
243           choosing-strategy: 'default'
244           submodule-recursive: '{submodule-recursive}'
245
246     wrappers:
247       - infra-wrappers:
248           build-timeout: '{build-timeout}'
249
250     triggers:
251       # 11 AM UTC
252       - timed: '@daily'
253       - gerrit-trigger-release-manually:
254           server: '{server-name}'
255           project: '{project}'
256           branch: '{branch}'
257
258     builders:
259       - lf-infra-pre-build
260       - provide-maven-settings:
261           global-settings-file: 'global-settings'
262           settings-file: '{mvn-settings}'
263
264       - inject:
265           properties-file: version.properties
266       - maven-set-release-version:
267           maven-version: '{maven-version}'
268           mvn-settings: '{mvn-settings}'
269           pom:
270
271       - maven-target:
272           maven-version: '{maven-version}'
273           goals: 'clean deploy -B
274             -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
275           properties:
276             - '{maven-deploy-properties}'
277           settings: '{mvn-settings}'
278           settings-type: cfp
279           global-settings: 'global-settings'
280           global-settings-type: cfp
281
282     publishers:
283       - lf-infra-publish
284
285 - job-template: &merge_java_defaults
286     # Job template for Java merge jobs
287     #
288     # The purpose of this job template is to run:
289     # 1. maven clean deploy
290     #
291     # Required Variables:
292     #     branch:    git branch (eg. stable/lithium or master)
293
294     name: '{project-name}-{stream}-merge-java'
295
296     project-type: freestyle
297     node: '{build-node}'
298     pattern: '**'
299     pom:
300     mvn_properties: []
301     mvn-params: ''
302     mvn-opts: ''
303     java-opts: ''
304     java-version: openjdk8
305
306     properties:
307       - infra-properties:
308           build-days-to-keep: '{build-days-to-keep}'
309
310     parameters:
311       - infra-parameters:
312           project: '{project}'
313           branch: '{branch}'
314           refspec: 'refs/heads/{branch}'
315           artifacts: '{archive-artifacts}'
316       - maven-exec:
317           maven-version: '{maven-version}'
318
319     scm:
320       - gerrit-trigger-scm:
321           refspec: ''
322           choosing-strategy: 'default'
323           submodule-recursive: '{submodule-recursive}'
324
325     wrappers:
326       - lf-infra-wrappers:
327           build-timeout: '{build-timeout}'
328           jenkins-ssh-credential: '{jenkins-ssh-credential}'
329
330     triggers:
331       - gerrit-trigger-patch-merged:
332           server: '{server-name}'
333           project: '{project}'
334           branch: '{branch}'
335           files: '{pattern}'
336
337     builders:
338       - lf-infra-pre-build
339       - lf-update-java-alternatives:
340           java-version: "{java-version}"
341       - provide-maven-settings:
342           global-settings-file: 'global-settings'
343           settings-file: '{mvn-settings}'
344       - conditional-step:
345           condition-kind: regex-match
346           regex: .*(amd64|arm64).*
347           label: '{project-name}'
348           steps:
349             - shell: !include-raw-escape: global-jjb/shell/docker-login.sh
350       - maven-target:
351           maven-version: '{maven-version}'
352           pom: '{obj:pom}'
353           goals: 'clean deploy -B {mvn-params}
354             -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
355           properties:
356             - MAVEN_OPTS='{mvn-opts}'
357           java-opts:
358             - "{java-opts}"
359           settings: '{mvn-settings}'
360           settings-type: cfp
361           global-settings: 'global-settings'
362           global-settings-type: cfp
363           properties: '{obj:mvn_properties}'
364
365     publishers:
366       - lf-infra-publish
367
368 - job-template:
369     # Job template for Java merge jobs based on
370     #   '{project-name}-{stream}-merge-java'
371     # The purpose of this job template is to run:
372     # 1. maven clean deploy
373     #
374     # This project supports maven properties.
375     #
376     # Required Variables:
377     #     branch:    git branch (eg. stable/lithium or master)
378     #     maven-properties: properties passed to maven
379
380     <<: *merge_java_defaults
381     name: '{project-name}-{stream}-merge-properties-java'
382
383     wrappers:
384       - lf-infra-wrappers:
385           build-timeout: '{build-timeout}'
386           jenkins-ssh-credential: '{jenkins-ssh-credential}'
387
388 - job-template:
389     # Job template for Java merge jobs that takes a maven template
390     #
391     # The purpose of this job template is to run:
392     # 1. maven clean deploy -P {mvn-profile}
393     #
394     # Required Variables:
395     #     branch:    git branch (eg. stable/lithium or master)
396
397     <<: *merge_java_defaults
398     name: '{project-name}-{stream}-merge-profile-java'
399
400     builders:
401       - lf-infra-pre-build
402       - provide-maven-settings:
403           global-settings-file: 'global-settings'
404           settings-file: '{mvn-settings}'
405
406       - docker-login
407
408       - maven-target:
409           maven-version: '{maven-version}'
410           goals: 'clean deploy -P {mvn-profile} -B
411             -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
412           settings: '{mvn-settings}'
413           settings-type: cfp
414           global-settings: 'global-settings'
415           global-settings-type: cfp
416           properties:
417             - docker.pull.registry=nexus3.onap.org:10001
418             - docker.push.registry=nexus3.onap.org:10003
419
420 - job-template:
421     # Job template for Java merge jobs with POM not at the root
422     #
423     # The purpose of this job template is to run:
424     # 1. maven clean deploy
425     #
426     # This job supports subprojects.
427     #
428     # Required Variables:
429     #     branch:    git branch (eg. stable/lithium or master)
430     #     pom:       name/location of the pom.xml file relative to the workspace
431     #     pattern:   ant file-path pattern relative to the workspace used to
432     #                trigger the job
433
434     <<: *merge_java_defaults
435     name: '{project-name}-{stream}-{subproject}-merge-java'
436
437 - job-template: &docker_java_defaults
438     # Job template for Docker daily jobs
439     #
440     # The purpose of this job template is to run:
441     # 1. login to the docker registry
442     # 2. docker push
443     #
444     # Required Variables:
445     #     branch:    git branch (eg. stable/lithium or master)
446
447     name: '{project-name}-{stream}-docker-java-daily'
448     id: '{project-name}-{stream}-docker-java-daily'
449     project-type: freestyle
450     node: '{build-node}'
451     disabled: '{disabled}'
452     java-version: openjdk8
453     properties:
454       - infra-properties:
455           build-days-to-keep: '{build-days-to-keep}'
456
457     parameters:
458       - infra-parameters:
459           project: '{project}'
460           branch: '{branch}'
461           refspec: 'refs/heads/{branch}'
462           artifacts: '{archive-artifacts}'
463       - maven-exec:
464           maven-version: '{maven-version}'
465       - maven-params:
466           mvn-params: '{mvn-params}'
467
468     scm:
469       - gerrit-trigger-scm:
470           refspec: ''
471           choosing-strategy: 'default'
472           submodule-recursive: '{submodule-recursive}'
473
474     wrappers:
475       - infra-wrappers:
476           build-timeout: '{build-timeout}'
477
478     triggers:
479       # 12 AM UTC
480       - timed: '@daily'
481       - gerrit-trigger-release-manually:
482           server: '{server-name}'
483           project: '{project}'
484           branch: '{branch}'
485
486     builders:
487       - lf-infra-pre-build
488       - lf-update-java-alternatives:
489           java-version: "{java-version}"
490
491       - provide-maven-settings:
492           global-settings-file: 'global-settings'
493           settings-file: '{mvn-settings}'
494
495       - docker-login
496
497       - maven-docker-push-daily:
498           maven-version: '{maven-version}'
499           mvn-settings: '{mvn-settings}'
500           pom: '{docker-pom}'
501           # use default as mvn-profile if profile is not needed
502           mvn-profile: '{mvn-profile}'
503           mvn-params: '{mvn-params}'
504
505     publishers:
506       - lf-infra-publish
507
508 - job-template:
509     # Job template for Docker daily jobs
510     #
511     # The purpose of this job template is to run:
512     # 1. login to the docker registry
513     # 2. docker push
514     #
515     # Required Variables:
516     #     branch:    git branch (eg. stable/lithium or master)
517
518     <<: *docker_java_defaults
519     name: '{project-name}-{stream}-docker-java-daily'
520     id: docker-java-daily
521     node: '{build-node}'
522     wrappers:
523       - infra-wrappers-docker-build:
524           build-timeout: '{build-timeout}'
525
526 - job-template:
527     # Job template for building & pushing docker images
528     #
529     # The purpose of this job template is to run:
530     #  1. login to the docker registry
531     #  2. run a specified shell builder
532     #
533     # Required Variables:
534     #     pom:       name/location of the pom.xml file relative to the workspace
535     #     maven-properties: properties passed to maven
536
537     name: '{project-name}-{stream}-docker-java-shell-daily'
538     project-type: freestyle
539     node: '{build-node}'
540     disabled: '{disabled}'
541     properties:
542       - infra-properties:
543           build-days-to-keep: '{build-days-to-keep}'
544
545     parameters:
546       - infra-parameters:
547           project: '{project}'
548           branch: '{branch}'
549           refspec: 'refs/heads/{branch}'
550           artifacts: '{archive-artifacts}'
551       - maven-exec:
552           maven-version: '{maven-version}'
553
554     scm:
555       - gerrit-trigger-scm:
556           refspec: ''
557           choosing-strategy: 'default'
558           submodule-recursive: '{submodule-recursive}'
559
560     wrappers:
561       - infra-wrappers:
562           build-timeout: '{build-timeout}'
563
564     triggers:
565       # 12 AM UTC
566       - timed: '@daily'
567       - gerrit-trigger-release-manually:
568           server: '{server-name}'
569           project: '{project}'
570           branch: '{branch}'
571
572     builders:
573       - lf-infra-pre-build
574       - provide-maven-settings:
575           global-settings-file: 'global-settings'
576           settings-file: '{mvn-settings}'
577
578       - docker-login
579
580       - maven-target:
581           maven-version: '{maven-version}'
582           goals: '{mvn-goals}'
583           settings: '{mvn-settings}'
584           settings-type: cfp
585           global-settings: 'global-settings'
586           global-settings-type: cfp
587
588       - shell: '{script}'
589
590     publishers:
591       - lf-infra-publish
592
593 - job-template:
594     # Job template for building & pushing docker images
595     #
596     # The purpose of this job template is to run:
597     #  1. login to the docker registry
598     #  2. run a specified shell builder
599     #
600     # Required Variables:
601     #     pom:       name/location of the pom.xml file relative to the workspace
602     #     maven-properties: properties passed to maven
603
604     name: '{project-name}-{stream}-{subproject}-docker-java-shell-daily'
605     project-type: freestyle
606     node: '{build-node}'
607     disabled: '{disabled}'
608     properties:
609       - infra-properties:
610           build-days-to-keep: '{build-days-to-keep}'
611
612     parameters:
613       - infra-parameters:
614           project: '{project}'
615           branch: '{branch}'
616           refspec: 'refs/heads/{branch}'
617           artifacts: '{archive-artifacts}'
618       - maven-exec:
619           maven-version: '{maven-version}'
620
621     scm:
622       - gerrit-trigger-scm:
623           refspec: ''
624           choosing-strategy: 'default'
625           submodule-recursive: '{submodule-recursive}'
626
627     wrappers:
628       - infra-wrappers:
629           build-timeout: '{build-timeout}'
630
631     triggers:
632       # 12 AM UTC
633       - timed: '@daily'
634       - gerrit-trigger-release-manually:
635           server: '{server-name}'
636           project: '{project}'
637           branch: '{branch}'
638
639     builders:
640       - lf-infra-pre-build
641       - provide-maven-settings:
642           global-settings-file: 'global-settings'
643           settings-file: '{mvn-settings}'
644
645       - docker-login
646
647       - maven-target:
648           maven-version: '{maven-version}'
649           pom: '{pom}'
650           goals: '{mvn-goals}'
651           settings: '{mvn-settings}'
652           settings-type: cfp
653           global-settings: 'global-settings'
654           global-settings-type: cfp
655
656       - shell: '{script}'
657
658     publishers:
659       - lf-infra-publish
660
661 - job-template:
662     # Job template for building & pushing docker images
663     #
664     # The purpose of this job template is to run:
665     #  1. login to the docker registry
666     #  2. inject a version.properties file and set versions
667     #  3. run a specified shell builder
668     #
669     # Required Variables:
670     #     pom:       name/location of the pom.xml file relative to the workspace
671     #     maven-properties: properties passed to maven
672
673     name: '{project-name}-{stream}-docker-java-version-shell-daily'
674     project-type: freestyle
675     node: '{build-node}'
676     disabled: '{disabled}'
677     properties:
678       - infra-properties:
679           build-days-to-keep: '{build-days-to-keep}'
680
681     parameters:
682       - infra-parameters:
683           project: '{project}'
684           branch: '{branch}'
685           refspec: 'refs/heads/{branch}'
686           artifacts: '{archive-artifacts}'
687       - maven-exec:
688           maven-version: '{maven-version}'
689
690     scm:
691       - gerrit-trigger-scm:
692           refspec: ''
693           choosing-strategy: 'default'
694           submodule-recursive: '{submodule-recursive}'
695
696     wrappers:
697       - infra-wrappers:
698           build-timeout: '{build-timeout}'
699
700     triggers:
701       # 12 AM UTC
702       - timed: '@daily'
703       - gerrit-trigger-release-manually:
704           server: '{server-name}'
705           project: '{project}'
706           branch: '{branch}'
707
708     builders:
709       - lf-infra-pre-build
710       - provide-maven-settings:
711           global-settings-file: 'global-settings'
712           settings-file: '{mvn-settings}'
713
714       - inject:
715           properties-file: version.properties
716       - maven-set-release-version:
717           maven-version: '{maven-version}'
718           mvn-settings: '{mvn-settings}'
719           pom:
720
721       - docker-login
722
723       - maven-target:
724           maven-version: '{maven-version}'
725           goals: '{mvn-goals}'
726           settings: '{mvn-settings}'
727           settings-type: cfp
728           global-settings: 'global-settings'
729           global-settings-type: cfp
730
731       - shell: '{script}'
732
733     publishers:
734       - lf-infra-publish
735
736 - job-template:
737     # Job template for building & pushing docker images
738     #
739     # The purpose of this job template is to run:
740     #  1. login to the docker registry
741     #  2. inject a version.properties file and set versions
742     #  3. run a specified shell builder
743     #
744     # This template supports subprojects.
745     #
746     # Required Variables:
747     #     pom:       name/location of the pom.xml file relative to the workspace
748     #     maven-properties: properties passed to maven
749
750     name: '{project-name}-{stream}-{subproject}-docker-java-version-shell-daily'
751     project-type: freestyle
752     node: 'ubuntu1804-docker-8c-8g'
753     disabled: '{disabled}'
754     properties:
755       - infra-properties:
756           build-days-to-keep: '{build-days-to-keep}'
757
758     parameters:
759       - infra-parameters:
760           project: '{project}'
761           branch: '{branch}'
762           refspec: 'refs/heads/{branch}'
763           artifacts: '{archive-artifacts}'
764       - maven-exec:
765           maven-version: '{maven-version}'
766
767     scm:
768       - gerrit-trigger-scm:
769           refspec: ''
770           choosing-strategy: 'default'
771           submodule-recursive: '{submodule-recursive}'
772
773     wrappers:
774       - infra-wrappers:
775           build-timeout: '{build-timeout}'
776
777     triggers:
778       # 12 AM UTC
779       - timed: '@daily'
780       - gerrit-trigger-release-manually:
781           server: '{server-name}'
782           project: '{project}'
783           branch: '{branch}'
784
785     builders:
786       - lf-infra-pre-build
787       - provide-maven-settings:
788           global-settings-file: 'global-settings'
789           settings-file: '{mvn-settings}'
790
791       - inject:
792           properties-file: version.properties
793       - maven-set-release-version:
794           maven-version: '{maven-version}'
795           mvn-settings: '{mvn-settings}'
796           pom: '{pom}'
797
798       - docker-login
799
800       - maven-target:
801           maven-version: '{maven-version}'
802           pom: '{pom}'
803           goals: '{mvn-goals}'
804           settings: '{mvn-settings}'
805           settings-type: cfp
806           global-settings: 'global-settings'
807           global-settings-type: cfp
808
809       - shell: '{script}'
810
811     publishers:
812       - lf-infra-publish
813
814 - job-template: &docker_version_java_defaults
815     # Job template for building & pushing docker images
816     #
817     # The purpose of this job template is to run:
818     #  1. login to the docker registry
819     #  2. inject a version.properties file and set versions
820     #  3. run a docker push
821     #
822     # Required Variables:
823     #     pom:       name/location of the pom.xml file relative to the workspace
824     #     profile:   the docker profile defined in the pom
825     #     maven-properties: properties passed to maven
826
827     name: '{project-name}-{stream}-docker-version-java-daily'
828     id: '{project-name}-{stream}-docker-version-java-daily'
829     project-type: freestyle
830     node: '{build-node}'
831     disabled: '{disabled}'
832     properties:
833       - infra-properties:
834           build-days-to-keep: '{build-days-to-keep}'
835
836     parameters:
837       - infra-parameters:
838           project: '{project}'
839           branch: '{branch}'
840           refspec: 'refs/heads/{branch}'
841           artifacts: '{archive-artifacts}'
842       - maven-exec:
843           maven-version: '{maven-version}'
844       - maven-params:
845           mvn-params: '{mvn-params}'
846
847     scm:
848       - gerrit-trigger-scm:
849           refspec: ''
850           choosing-strategy: 'default'
851           submodule-recursive: '{submodule-recursive}'
852
853     wrappers:
854       - infra-wrappers:
855           build-timeout: '{build-timeout}'
856
857     triggers:
858       # 12 AM UTC
859       - timed: '@daily'
860       - gerrit-trigger-release-manually:
861           server: '{server-name}'
862           project: '{project}'
863           branch: '{branch}'
864
865     builders:
866       - lf-infra-pre-build
867       - provide-maven-settings:
868           global-settings-file: 'global-settings'
869           settings-file: '{mvn-settings}'
870
871       - inject:
872           properties-file: version.properties
873       - maven-set-release-version:
874           maven-version: '{maven-version}'
875           mvn-settings: '{mvn-settings}'
876           pom:
877
878       - docker-login
879
880       - maven-docker-push-daily:
881           maven-version: '{maven-version}'
882           mvn-settings: '{mvn-settings}'
883           pom: '{docker-pom}'
884           # use default as mvn-profile if profile is not needed
885           mvn-profile: '{mvn-profile}'
886           mvn-params: '{mvn-params}'
887
888     publishers:
889       - lf-infra-publish
890
891 - job-template:
892     # Job template for building & pushing docker images
893     #
894     # The purpose of this job template is to run:
895     #  1. login to the docker registry
896     #  2. inject a version.properties file and set versions
897     #  3. run a docker push
898     #
899     # Required Variables:
900     #     pom:       name/location of the pom.xml file relative to the workspace
901     #     profile:   the docker profile defined in the pom
902     #     maven-properties: properties passed to maven
903
904     <<: *docker_version_java_defaults
905     name: '{project-name}-{stream}-docker-version-java-daily'
906     id: 'docker-version-java-daily'
907     node: '{build-node}'
908     wrappers:
909       - infra-wrappers-docker-build:
910           build-timeout: '{build-timeout}'
911
912 - job-template:
913     # Job template for building & pushing docker images for AAI specific repos
914     #
915     # The purpose of this job template is to run:
916     #  1. login to the docker registry
917     #  2. run maven goals
918     #  3. run include-docker-push.sh
919     #
920     # Required Variables:
921     #     pom:       name/location of the pom.xml file relative to the workspace
922     #     maven-properties: properties passed to maven
923
924     name: '{project-name}-{stream}-aai-docker-java-daily'
925     project-type: freestyle
926     node: '{build-node}'
927     docker-image-name: ''
928     disabled: '{disabled}'
929     java-version: 'openjdk8'
930     properties:
931       - infra-properties:
932           build-days-to-keep: '{build-days-to-keep}'
933
934     parameters:
935       - infra-parameters:
936           project: '{project}'
937           branch: '{branch}'
938           refspec: 'refs/heads/{branch}'
939           artifacts: '{archive-artifacts}'
940       - maven-exec:
941           maven-version: '{maven-version}'
942       - docker-image-name:
943           docker-image-name: '{docker-image-name}'
944
945     scm:
946       - gerrit-trigger-scm:
947           refspec: ''
948           choosing-strategy: 'default'
949           submodule-recursive: '{submodule-recursive}'
950
951     wrappers:
952       - infra-wrappers:
953           build-timeout: '{build-timeout}'
954
955     triggers:
956       # 12 AM UTC
957       - timed: '@daily'
958       - gerrit-trigger-release-manually:
959           server: '{server-name}'
960           project: '{project}'
961           branch: '{branch}'
962
963     builders:
964       - lf-infra-pre-build
965       - lf-update-java-alternatives:
966           java-version: "{java-version}"
967       - provide-maven-settings:
968           global-settings-file: 'global-settings'
969           settings-file: '{mvn-settings}'
970
971       - docker-login
972
973       - maven-target:
974           maven-version: '{maven-version}'
975           pom: 'pom.xml'
976           goals: 'clean install -DskipTests -B
977             -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
978           settings: '{mvn-settings}'
979           settings-type: cfp
980           global-settings: 'global-settings'
981           global-settings-type: cfp
982
983       - maven-target:
984           maven-version: '{maven-version}'
985           pom: '{pom}'
986           goals: '{mvn-goals}'
987           settings: '{mvn-settings}'
988           settings-type: cfp
989           global-settings: 'global-settings'
990           global-settings-type: cfp
991           properties:
992             - maven.test.skip=true
993             - docker.pull.registry=nexus3.onap.org:10001
994             - docker.push.registry=nexus3.onap.org:10003
995
996       - shell: !include-raw-escape: include-docker-push.sh
997
998     publishers:
999       - lf-infra-publish
1000
1001 - job-template:
1002     # Job template for Java merge jobs for SDC specific repos
1003     #
1004     # The purpose of this job template is to run:
1005     # 1. maven clean deploy
1006     #
1007     # Required Variables:
1008     #     branch:    git branch (eg. stable/lithium or master)
1009
1010     <<: *merge_java_defaults
1011     name: '{project-name}-{stream}-sdc-merge-java'
1012
1013     node: '{build-node}'
1014     build-timeout: 120
1015
1016     builders:
1017       - lf-infra-pre-build
1018       - lf-update-java-alternatives:
1019           java-version: "{java-version}"
1020       - provide-maven-settings:
1021           global-settings-file: 'global-settings'
1022           settings-file: '{mvn-settings}'
1023
1024       - docker-login
1025
1026       - maven-docker-push-daily:
1027           maven-version: '{maven-version}'
1028           mvn-settings: '{mvn-settings}'
1029           pom: '{docker-pom}'
1030           # use default as mvn-profile if profile is not needed
1031           mvn-profile: '{mvn-profile}'
1032           mvn-params: ''
1033
1034 - job-template:
1035     # Job template for Java merge jobs on multiple architectures
1036     #
1037     # The purpose of this job template is to:
1038     # 1. Run parallel {project-name}-{stream}-verify-java jobs for each supported architecture
1039     # 2. Build and push a docker manifest list for the images created by
1040     #    the previous jobs
1041
1042     name: '{project-name}-multiarch-{stream}-merge-java'
1043     node: '{build-node}'
1044     project-type: multijob
1045     disabled: '{obj:disabled}'
1046     pattern: '**'
1047
1048     parameters:
1049       - lf-infra-parameters:
1050           project: '{project}'
1051           stream: '{stream}'
1052           branch: '{branch}'
1053       - string:
1054           name: DOCKER_REGISTRY
1055           default: 'none'
1056       - string:
1057           name: DOCKERHUB_REGISTRY
1058           default: 'registry-1.docker.io'
1059
1060     properties:
1061       - throttle:
1062           max-per-node: 1
1063           option: 'project'
1064       - build-blocker:
1065           use-build-blocker: true
1066           blocking-jobs:
1067             - '{project-name}-.*-merge-.*'
1068           blocking-level: 'NODE'
1069
1070     scm:
1071       - gerrit-trigger-scm:
1072           refspec: ''
1073           choosing-strategy: 'default'
1074           submodule-recursive: '{submodule-recursive}'
1075
1076     wrappers:
1077       - infra-wrappers:
1078           build-timeout: '{build-timeout}'
1079
1080     triggers:
1081       - gerrit-trigger-patch-merged:
1082           server: '{server-name}'
1083           project: '{project}'
1084           branch: '{branch}'
1085           files: '{pattern}'
1086
1087     builders:
1088       - multijob:
1089           name: 'build docker images'
1090           condition: ALWAYS
1091           execution-type: PARALLEL
1092           projects:
1093             - name: '{project-name}-amd64-{stream}-merge-java'
1094               kill-phase-on: FAILURE
1095               current-parameters: true
1096             - name: '{project-name}-arm64-{stream}-merge-java'
1097               kill-phase-on: NEVER
1098               current-parameters: true
1099       - multijob:
1100           name: 'publish docker manifest'
1101           condition: SUCCESSFUL
1102           execution-type: PARALLEL
1103           projects:
1104             - name: '{project-name}-docker-manifest-{stream}'
1105               current-parameters: true
1106               predefined-parameters: |
1107                 PARENT_JOB_NAME=$JOB_NAME
1108                 DOCKERHUB_REGISTRY=docker.io