Refactor: Cleanup for pre-commit
[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                 # yamllint disable rule:line-length
67                 goals: "clean install -B
68                     -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn {mvn-params}"
69                 # yamlline enable
70                 properties:
71                     - MAVEN_OPTS='{mvn-opts}'
72                 java-opts:
73                     - "{java-opts}"
74                 settings: "{mvn-settings}"
75                 settings-type: cfp
76                 global-settings: "global-settings"
77                 global-settings-type: cfp
78
79       publishers:
80           - lf-infra-publish
81
82 - job-template:
83       # Job template for Java verify jobs running checkstyle at the end
84       # When checkstyle will be fully incorporated, it is meant to replace
85       #  '{project-name}-{stream}-verify-java-checkstyle'
86       #
87       # The purpose of this job template is to run:
88       # 1. maven clean install
89       #
90       # This job publishes checkstyle results.
91       #
92       # Required Variables:
93       #     branch:    git branch (eg. stable/lithium or master)
94
95       <<: *verify_java_defaults
96       name: "{project-name}-{stream}-verify-java-checkstyle"
97
98       publishers:
99           - lf-infra-publish
100           - checkstyle-result
101
102 - job-template:
103       # Job template for Java verify jobs with POM not at the root
104       #
105       # The purpose of this job template is to run:
106       # 1. maven clean install
107       #
108       # This job supports subprojects.
109       #
110       # Required Variables:
111       #     branch:    git branch (eg. stable/lithium or master)
112       #     pom:       name/location of the pom.xml file relative to the workspace
113       #     pattern:   ant file-path pattern relative to the workspace used to
114       #                trigger the job
115
116       <<: *verify_java_defaults
117       name: "{project-name}-{stream}-{subproject}-verify-java"
118
119 - job-template:
120       # Job template for Java integration pairwise jobs
121       #
122       # The purpose of this job template is to run:
123       # 1. maven clean install
124       #
125       # Required Variables:
126       #     branch:    git branch (eg. stable/lithium or master)
127
128       <<: *verify_java_defaults
129       name: "{project-name}-{stream}-integration-pairwise"
130       triggers:
131           - timed: "@daily"
132           - gerrit-trigger-patch-submitted:
133                 server: "{server-name}"
134                 project: "{project}"
135                 branch: "{branch}"
136                 files: "{obj:pattern}"
137
138 - job-template:
139       # Job template for Java daily release jobs running checkstyle at the end
140       # When checkstyle will be fully incorporated, it is meant to replace
141       #  '{project-name}-{stream}-release-java-daily'
142       #
143       # The purpose of this job template is to run:
144       # 1. maven clean deploy with Sonar scans
145       #
146       # This job publishes checkstyle results.
147       # This job uses a conditional regex match step to set versions.
148       #
149       # Required Variables:
150       #     branch:    git branch (eg. stable/lithium or master)
151
152       name: "{project-name}-{stream}-release-java-daily-checkstyle"
153       project-type: freestyle
154       node: "{build-node}"
155       disabled: false
156       maven-deploy-properties:
157       properties:
158           - infra-properties:
159                 build-days-to-keep: "{build-days-to-keep}"
160       parameters:
161           - infra-parameters:
162                 project: "{project}"
163                 branch: "{branch}"
164                 refspec: "refs/heads/{branch}"
165                 artifacts: "{archive-artifacts}"
166           - maven-exec:
167                 maven-version: "{maven-version}"
168       scm:
169           - gerrit-trigger-scm:
170                 refspec: ""
171                 choosing-strategy: "default"
172                 submodule-recursive: "{submodule-recursive}"
173       wrappers:
174           - infra-wrappers:
175                 build-timeout: "{build-timeout}"
176       triggers:
177           # 11 AM UTC
178           - timed: "@daily"
179           - gerrit-trigger-release-manually:
180                 server: "{server-name}"
181                 project: "{project}"
182                 branch: "{branch}"
183       builders:
184           - lf-infra-pre-build
185           - provide-maven-settings:
186                 global-settings-file: "global-settings"
187                 settings-file: "{mvn-settings}"
188           - conditional-step:
189                 condition-kind: regex-match
190                 regex: DoSetVersion
191                 label: "{setVersion}"
192                 steps:
193                     - inject:
194                           properties-file: version.properties
195                     - maven-set-release-version:
196                           maven-version: "{maven-version}"
197                           mvn-settings: "{mvn-settings}"
198                           pom:
199           - maven-target:
200                 maven-version: "{maven-version}"
201                 goals: "clean deploy -B
202                     -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
203                 properties: "{obj:mvn_properties}"
204                 settings: "{mvn-settings}"
205                 settings-type: cfp
206                 global-settings: "global-settings"
207                 global-settings-type: cfp
208
209       publishers:
210           - lf-infra-publish
211           - checkstyle-result-daily
212
213 - job-template:
214       # Job template for Java daily release jobs
215       #
216       # The purpose of this job template is to run:
217       # 1. maven set versions
218       # 2. maven clean deploy with Sonar scans
219       #
220       # Required Variables:
221       #     branch:    git branch (eg. stable/lithium or master)
222
223       name: "{project-name}-{stream}-release-version-java-daily"
224
225       project-type: freestyle
226       disabled: false
227       node: "{build-node}"
228       maven-deploy-properties:
229       properties:
230           - infra-properties:
231                 build-days-to-keep: "{build-days-to-keep}"
232
233       parameters:
234           - infra-parameters:
235                 project: "{project}"
236                 branch: "{branch}"
237                 refspec: "refs/heads/{branch}"
238                 artifacts: "{archive-artifacts}"
239           - maven-exec:
240                 maven-version: "{maven-version}"
241
242       scm:
243           - gerrit-trigger-scm:
244                 refspec: ""
245                 choosing-strategy: "default"
246                 submodule-recursive: "{submodule-recursive}"
247
248       wrappers:
249           - infra-wrappers:
250                 build-timeout: "{build-timeout}"
251
252       triggers:
253           # 11 AM UTC
254           - timed: "@daily"
255           - gerrit-trigger-release-manually:
256                 server: "{server-name}"
257                 project: "{project}"
258                 branch: "{branch}"
259
260       builders:
261           - lf-infra-pre-build
262           - provide-maven-settings:
263                 global-settings-file: "global-settings"
264                 settings-file: "{mvn-settings}"
265
266           - inject:
267                 properties-file: version.properties
268           - maven-set-release-version:
269                 maven-version: "{maven-version}"
270                 mvn-settings: "{mvn-settings}"
271                 pom:
272
273           - maven-target:
274                 maven-version: "{maven-version}"
275                 goals: "clean deploy -B
276                     -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
277                 properties:
278                     - "{maven-deploy-properties}"
279                 settings: "{mvn-settings}"
280                 settings-type: cfp
281                 global-settings: "global-settings"
282                 global-settings-type: cfp
283
284       publishers:
285           - lf-infra-publish
286
287 - job-template: &merge_java_defaults
288       # Job template for Java merge jobs
289       #
290       # The purpose of this job template is to run:
291       # 1. maven clean deploy
292       #
293       # Required Variables:
294       #     branch:    git branch (eg. stable/lithium or master)
295
296       name: "{project-name}-{stream}-merge-java"
297
298       project-type: freestyle
299       node: "{build-node}"
300       pattern: "**"
301       pom:
302       mvn_properties: []
303       mvn-params: ""
304       mvn-opts: ""
305       java-opts: ""
306       java-version: openjdk8
307
308       properties:
309           - infra-properties:
310                 build-days-to-keep: "{build-days-to-keep}"
311
312       parameters:
313           - infra-parameters:
314                 project: "{project}"
315                 branch: "{branch}"
316                 refspec: "refs/heads/{branch}"
317                 artifacts: "{archive-artifacts}"
318           - maven-exec:
319                 maven-version: "{maven-version}"
320
321       scm:
322           - gerrit-trigger-scm:
323                 refspec: ""
324                 choosing-strategy: "default"
325                 submodule-recursive: "{submodule-recursive}"
326
327       wrappers:
328           - lf-infra-wrappers:
329                 build-timeout: "{build-timeout}"
330                 jenkins-ssh-credential: "{jenkins-ssh-credential}"
331
332       triggers:
333           - gerrit-trigger-patch-merged:
334                 server: "{server-name}"
335                 project: "{project}"
336                 branch: "{branch}"
337                 files: "{pattern}"
338
339       builders:
340           - lf-infra-pre-build
341           - lf-update-java-alternatives:
342                 java-version: "{java-version}"
343           - provide-maven-settings:
344                 global-settings-file: "global-settings"
345                 settings-file: "{mvn-settings}"
346           - conditional-step:
347                 condition-kind: regex-match
348                 regex: .*(amd64|arm64).*
349                 label: "{project-name}"
350                 steps:
351                     - shell: !include-raw-escape: global-jjb/shell/docker-login.sh
352           - maven-target:
353                 maven-version: "{maven-version}"
354                 pom: "{obj:pom}"
355                 goals: "clean deploy -B {mvn-params}
356                     -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
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: false
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: false
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: false
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: false
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: false
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: false
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: false
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