blob: eecedd464bfaf151748bf059ea1e7ec5beda4e07 [file] [log] [blame]
Jessica Wagantalld9c235c2018-03-21 13:03:59 -07001---
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'
Jessica Wagantall11a31f02019-05-13 12:28:14 -070027 submodule-disable: false
Jessica Wagantall7d10bdf2018-10-29 11:17:16 -070028 submodule-timeout: 10
Jessica Wagantalld9c235c2018-03-21 13:03:59 -070029
30 #####################
31 # Job Configuration #
32 #####################
33
34 properties:
35 - lf-infra-properties:
36 build-days-to-keep: '{build-days-to-keep}'
37
38 parameters:
39 - lf-infra-parameters:
40 branch: '{branch}'
41 project: '{project}'
42 stream: '{stream}'
43 lftools-version: '{lftools-version}'
44
45 wrappers:
46 - lf-infra-wrappers:
47 build-timeout: '{build-timeout}'
48 jenkins-ssh-credential: '{jenkins-ssh-credential}'
49
50 publishers:
51 - lf-infra-publish
52
53- docker_verify_boiler_plate: &docker_verify_boiler_plate
54 name: docker_verify_boiler_plate
55
56 concurrent: true
57
58 scm:
59 - gerrit-trigger-scm:
60 refspec: '$GERRIT_REFSPEC'
61 choosing-strategy: 'default'
62 submodule-recursive: '{submodule-recursive}'
63
64 triggers:
65 - gerrit-trigger-patch-submitted:
66 status-context: '{project}-Docker-Verify'
67 server: '{server-name}'
68 project: '{project}'
69 branch: '{branch}'
Jessica Wagantall86d80f72018-04-03 13:34:08 -070070 files: '{files}'
Jessica Wagantalld9c235c2018-03-21 13:03:59 -070071
72- docker_merge_boiler_plate: &docker_merge_boiler_plate
73 name: docker_merge_boiler_plate
74
75 scm:
76 - gerrit-trigger-scm:
77 refspec: '$GERRIT_REFSPEC'
78 choosing-strategy: 'default'
79 submodule-recursive: '{submodule-recursive}'
80
81 triggers:
82 - gerrit-trigger-patch-merged:
83 server: '{server-name}'
84 project: '{project}'
85 branch: '{branch}'
Jessica Wagantall86d80f72018-04-03 13:34:08 -070086 files: '{files}'
Jessica Wagantalld9c235c2018-03-21 13:03:59 -070087 - pollscm:
88 cron: ''
89
90#################
91# JOB TEMPLATES #
92#################
93- job-template:
94 name: '{project-name}-{stream}-merge-docker'
95 # Job template for Docker merge jobs
96 #
97 # The purpose of this job template is to run a docker build, and potentially
98 # test validation of the docker image
99
100 <<: *docker_job_boiler_plate
101 # yamllint disable-line rule:key-duplicates
102 <<: *docker_merge_boiler_plate
103
104 builders:
Jessica Wagantall05ae7da2018-10-22 17:32:33 -0700105 - lf-infra-pre-build
Jessica Wagantalld9c235c2018-03-21 13:03:59 -0700106 - lf-infra-docker-login:
107 global-settings-file: 'global-settings'
108 settings-file: '{mvn-settings}'
109 - shell: '{pre_build_script}'
110 - inject:
111 # Docker registry is purposely not using an '_' so as to not conflict
112 # with the Jenkins global env var
113 properties-content: |
114 DOCKER_ARGS={docker_build_args}
115 DOCKER_NAME={docker_name}
116 DOCKER_ROOT={docker_root}
117 DOCKER_TAG={docker_tag}
Denes Nemethbb2815b2018-05-15 22:12:54 +0200118 BUILD_MODE=SNAPSHOT
Jessica Wagantalld9c235c2018-03-21 13:03:59 -0700119 DOCKERREGISTRY={docker_registry}
120 # Do the docker build
121 - shell: !include-raw: ../shell/docker-build.sh
122 - inject:
123 # Import the docker image information from the build step
124 properties-file: 'env_inject.txt'
125 # Execute any post build clean-up or testing
126 - shell: '{post_build_script}'
127 # Provided all steps have already passed, push the docker image
128 - shell: !include-raw: ../shell/docker-push.sh
129
130- job-template:
Denes Nemeth88405ef2018-06-19 14:21:59 +0800131 name: '{project-name}-{stream}-merge-docker-cascade-trigger'
132 # Job template for Docker merge jobs
133 #
134 # The purpose of this job template is to run a docker build, and potentially
135 # test validation of the docker image. This job is triggered by the it's corresponding
136 # job that builds the artifacts from which the docker image is built from. Projects
137 # using the {project-name}-{stream}-merge-docker job should move to this job. Because
138 # the {project-name}-{stream}-merge-docker has no garanties that the docker image is built
139 # from merged artifact.
140
141 <<: *docker_job_boiler_plate
142 # yamllint disable-line rule:key-duplicates
143 <<: *docker_merge_boiler_plate
144
145 builders:
Jessica Wagantall05ae7da2018-10-22 17:32:33 -0700146 - lf-infra-pre-build
Denes Nemeth88405ef2018-06-19 14:21:59 +0800147 - lf-infra-docker-login:
148 global-settings-file: 'global-settings'
149 settings-file: '{mvn-settings}'
150 - shell: '{pre_build_script}'
151 - inject:
152 # Docker registry is purposely not using an '_' so as to not conflict
153 # with the Jenkins global env var
154 properties-content: |
155 DOCKER_ARGS={docker_build_args}
156 DOCKER_NAME={docker_name}
157 DOCKER_ROOT={docker_root}
158 DOCKER_TAG={docker_tag}
159 BUILD_MODE=SNAPSHOT
160 DOCKERREGISTRY={docker_registry}
161 # Do the docker build
162 - shell: !include-raw: ../shell/docker-build.sh
163 - inject:
164 # Import the docker image information from the build step
165 properties-file: 'env_inject.txt'
166 # Execute any post build clean-up or testing
167 - shell: '{post_build_script}'
168 # Provided all steps have already passed, push the docker image
169 - shell: !include-raw: ../shell/docker-push.sh
170 triggers:
171 - reverse:
172 jobs:
Denes Nemeth5a504d22018-06-29 08:58:48 +0200173 - '{parent_job}'
Denes Nemeth88405ef2018-06-19 14:21:59 +0800174 result: 'success'
175
176- job-template:
Jessica Wagantalld9c235c2018-03-21 13:03:59 -0700177 name: '{project-name}-{stream}-verify-docker'
178 # Job template for Docker verify jobs
179 #
180 # The purpose of this job template is to run a docker build, and potentially
181 # test validation of the docker image
182
183 ######################
184 # Default parameters #
185 ######################
186
187 <<: *docker_job_boiler_plate
188 # yamllint disable-line rule:key-duplicates
189 <<: *docker_verify_boiler_plate
190
191 builders:
Jessica Wagantall05ae7da2018-10-22 17:32:33 -0700192 - lf-infra-pre-build
Jessica Wagantalld9c235c2018-03-21 13:03:59 -0700193 - lf-infra-docker-login:
194 global-settings-file: 'global-settings'
195 settings-file: '{mvn-settings}'
196 - shell: '{pre_build_script}'
197 - inject:
198 # Docker registry is purposely not using an '_' so as to not conflict
199 # with the Jenkins global env var
200 properties-content: |
201 DOCKER_ARGS={docker_build_args}
202 DOCKER_NAME={docker_name}
203 DOCKER_ROOT={docker_root}
204 DOCKER_TAG={docker_tag}
Denes Nemethbb2815b2018-05-15 22:12:54 +0200205 BUILD_MODE=SNAPSHOT
Jessica Wagantalld9c235c2018-03-21 13:03:59 -0700206 DOCKERREGISTRY={docker_registry}
207 # Do the docker build
208 - shell: !include-raw: ../shell/docker-build.sh
209 - inject:
210 # Import the docker image information from the build step
211 properties-file: 'env_inject.txt'
212 # Execute any post build clean-up or testing
213 - shell: '{post_build_script}'
214
215- job-template:
Denes Nemeth88405ef2018-06-19 14:21:59 +0800216 name: '{project-name}-{stream}-verify-docker-cascade-trigger'
217 # Job template for Docker verify jobs
218 #
219 # The purpose of this job template is to run a docker build, and potentially
220 # test validation of the docker image. This job is triggered by the it's corresponding
221 # job that builds the artifacts from which the docker image is built from. Projects
222 # using the {project-name}-{stream}-verify-docker job should move to this job. Because
223 # the {project-name}-{stream}-verify-docker has no garanties that the docker image is built
224 # from merged artifact.
225
226 ######################
227 # Default parameters #
228 ######################
229
230 <<: *docker_job_boiler_plate
231 # yamllint disable-line rule:key-duplicates
232 <<: *docker_verify_boiler_plate
233
234 builders:
Jessica Wagantall05ae7da2018-10-22 17:32:33 -0700235 - lf-infra-pre-build
Denes Nemeth88405ef2018-06-19 14:21:59 +0800236 - lf-infra-docker-login:
237 global-settings-file: 'global-settings'
238 settings-file: '{mvn-settings}'
239 - shell: '{pre_build_script}'
240 - inject:
241 # Docker registry is purposely not using an '_' so as to not conflict
242 # with the Jenkins global env var
243 properties-content: |
244 DOCKER_ARGS={docker_build_args}
245 DOCKER_NAME={docker_name}
246 DOCKER_ROOT={docker_root}
247 DOCKER_TAG={docker_tag}
248 BUILD_MODE=SNAPSHOT
249 DOCKERREGISTRY={docker_registry}
250 # Do the docker build
251 - shell: !include-raw: ../shell/docker-build.sh
252 - inject:
253 # Import the docker image information from the build step
254 properties-file: 'env_inject.txt'
255 # Execute any post build clean-up or testing
256 - shell: '{post_build_script}'
257 triggers:
258 - reverse:
259 jobs:
Denes Nemeth5a504d22018-06-29 08:58:48 +0200260 - '{parent_job}'
Denes Nemeth88405ef2018-06-19 14:21:59 +0800261 result: 'success'
262
263- job-template:
Jessica Wagantalld9c235c2018-03-21 13:03:59 -0700264 name: '{project-name}-{stream}-release-version-docker-daily-no-sonar'
265 # Job template for Docker daily release jobs
266 #
267 # The purpose of this job template is to run "docker build and docker push"
268 # for projects using this template.
269 #
270 # Required Variables:
271 # branch: git branch (eg. stable/lithium or master)
272 <<: *docker_job_boiler_plate
273
Denes Nemethbb2815b2018-05-15 22:12:54 +0200274 docker_registry: '$DOCKER_REGISTRY:10003'
Jessica Wagantalld9c235c2018-03-21 13:03:59 -0700275
276 scm:
277 - lf-infra-gerrit-scm:
278 jenkins-ssh-credential: '{jenkins-ssh-credential}'
279 git-url: '$GIT_URL/$PROJECT'
280 refspec: '$GERRIT_REFSPEC'
281 branch: '$GERRIT_BRANCH'
282 submodule-recursive: true
Jessica Wagantall7d10bdf2018-10-29 11:17:16 -0700283 submodule-timeout: '{submodule-timeout}'
Jessica Wagantall11a31f02019-05-13 12:28:14 -0700284 submodule-disable: '{submodule-disable}'
Jessica Wagantalld9c235c2018-03-21 13:03:59 -0700285 choosing-strategy: default
286
287 builders:
Jessica Wagantall05ae7da2018-10-22 17:32:33 -0700288 - lf-infra-pre-build
Jessica Wagantalld9c235c2018-03-21 13:03:59 -0700289 - lf-infra-docker-login:
290 global-settings-file: 'global-settings'
291 settings-file: '{mvn-settings}'
292 - shell: '{pre_build_script}'
293 - inject:
294 # Docker registry is purposely not using an '_' so as to not conflict
295 # with the Jenkins global env var
296 properties-content: |
297 DOCKER_ARGS={docker_build_args}
298 DOCKER_NAME={docker_name}
299 DOCKER_ROOT={docker_root}
300 DOCKER_TAG={docker_tag}
301 DOCKERREGISTRY={docker_registry}
Denes Nemethbb2815b2018-05-15 22:12:54 +0200302 BUILD_MODE=STAGING
Jessica Wagantalld9c235c2018-03-21 13:03:59 -0700303
304 # Do the docker build
305 - shell: !include-raw: ../shell/snapshot-strip.sh
306 - shell: !include-raw: ../shell/docker-build.sh
307 - inject:
308 # Import the docker image information from the build step
309 properties-file: 'env_inject.txt'
310 # Execute any post build clean-up or testing
311 - shell: '{post_build_script}'
312 # Provided all steps have already passed, push the docker image
313 - shell: !include-raw: ../shell/docker-push.sh
314
315 triggers:
316 # 11 AM UTC
Gary Wu5f4277f2018-09-28 10:36:23 -0700317 - timed: '@daily'
Jessica Wagantalld9c235c2018-03-21 13:03:59 -0700318 - gerrit-trigger-release-manually:
319 server: '{server-name}'
320 project: '{project}'
321 branch: '{branch}'
322
323- job-template:
Denes Nemeth88405ef2018-06-19 14:21:59 +0800324 name: '{project-name}-{stream}-release-version-docker-daily-no-sonar-cascade-trigger'
325 # Job template for Docker daily release job.
326 #
327 # The purpose of this job template is to run "docker build and docker push"
328 # for projects using this template. This job is triggered by the daily build
329 # that builds the artifacts required for building the Docker image.
330 #
331 # Required Variables:
332 # branch: git branch (eg. stable/lithium or master)
333 <<: *docker_job_boiler_plate
334
335 docker_registry: '$DOCKER_REGISTRY:10003'
336
337 scm:
338 - lf-infra-gerrit-scm:
339 jenkins-ssh-credential: '{jenkins-ssh-credential}'
340 git-url: '$GIT_URL/$PROJECT'
341 refspec: '$GERRIT_REFSPEC'
342 branch: '$GERRIT_BRANCH'
343 submodule-recursive: true
Jessica Wagantall7d10bdf2018-10-29 11:17:16 -0700344 submodule-timeout: '{submodule-timeout}'
Jessica Wagantall11a31f02019-05-13 12:28:14 -0700345 submodule-disable: '{submodule-disable}'
Denes Nemeth88405ef2018-06-19 14:21:59 +0800346 choosing-strategy: default
347
348 builders:
Jessica Wagantall05ae7da2018-10-22 17:32:33 -0700349 - lf-infra-pre-build
Denes Nemeth88405ef2018-06-19 14:21:59 +0800350 - lf-infra-docker-login:
351 global-settings-file: 'global-settings'
352 settings-file: '{mvn-settings}'
353 - shell: '{pre_build_script}'
354 - inject:
355 # Docker registry is purposely not using an '_' so as to not conflict
356 # with the Jenkins global env var
357 properties-content: |
358 DOCKER_ARGS={docker_build_args}
359 DOCKER_NAME={docker_name}
360 DOCKER_ROOT={docker_root}
361 DOCKER_TAG={docker_tag}
362 DOCKERREGISTRY={docker_registry}
363 BUILD_MODE=STAGING
364
365 # Do the docker build
366 - shell: !include-raw: ../shell/snapshot-strip.sh
367 - shell: !include-raw: ../shell/docker-build.sh
368 - inject:
369 # Import the docker image information from the build step
370 properties-file: 'env_inject.txt'
371 # Execute any post build clean-up or testing
372 - shell: '{post_build_script}'
373 # Provided all steps have already passed, push the docker image
374 - shell: !include-raw: ../shell/docker-push.sh
375
376 triggers:
377 - reverse:
378 jobs:
Denes Nemeth5a504d22018-06-29 08:58:48 +0200379 - '{parent_job}'
Denes Nemeth88405ef2018-06-19 14:21:59 +0800380 result: 'success'
381
382- job-template:
Jessica Wagantalld9c235c2018-03-21 13:03:59 -0700383 name: '{project-name}-{subproject}-{stream}-merge-docker'
384 # Job template for Docker merge jobs
385 #
386 # The purpose of this job template is to run a docker build, and potentially
387 # test validation of the docker image
388
389 <<: *docker_job_boiler_plate
390 # yamllint disable-line rule:key-duplicates
391 <<: *docker_merge_boiler_plate
392
393 builders:
Jessica Wagantall05ae7da2018-10-22 17:32:33 -0700394 - lf-infra-pre-build
Jessica Wagantalld9c235c2018-03-21 13:03:59 -0700395 - lf-infra-docker-login:
396 global-settings-file: 'global-settings'
397 settings-file: '{mvn-settings}'
398 - shell: '{pre_build_script}'
399 - inject:
400 # Docker registry is purposely not using an '_' so as to not conflict
401 # with the Jenkins global env var
402 properties-content: |
403 DOCKER_ARGS={docker_build_args}
404 DOCKER_NAME={docker_name}
405 DOCKER_ROOT={docker_root}
406 DOCKER_TAG={docker_tag}
407 DOCKERREGISTRY={docker_registry}
Denes Nemethbb2815b2018-05-15 22:12:54 +0200408 BUILD_MODE=SNAPSHOT
Jessica Wagantalld9c235c2018-03-21 13:03:59 -0700409 # Do the docker build
410 - shell: !include-raw: ../shell/docker-build.sh
411 - inject:
412 # Import the docker image information from the build step
413 properties-file: 'env_inject.txt'
414 # Execute any post build clean-up or testing
415 - shell: '{post_build_script}'
416 # Provided all steps have already passed, push the docker image
417 - shell: !include-raw: ../shell/docker-push.sh
418
419- job-template:
Denes Nemeth88405ef2018-06-19 14:21:59 +0800420 name: '{project-name}-{subproject}-{stream}-merge-docker-cascade-trigger'
421 # Job template for Docker merge jobs
422 #
423 # The purpose of this job template is to run a docker build, and potentially
424 # test validation of the docker image. This job is triggered by the merge job
425 # that builds the artifacts required for building the Docker image.
426
427 <<: *docker_job_boiler_plate
428 # yamllint disable-line rule:key-duplicates
429 <<: *docker_merge_boiler_plate
430
431 builders:
Jessica Wagantall05ae7da2018-10-22 17:32:33 -0700432 - lf-infra-pre-build
Denes Nemeth88405ef2018-06-19 14:21:59 +0800433 - lf-infra-docker-login:
434 global-settings-file: 'global-settings'
435 settings-file: '{mvn-settings}'
436 - shell: '{pre_build_script}'
437 - inject:
438 # Docker registry is purposely not using an '_' so as to not conflict
439 # with the Jenkins global env var
440 properties-content: |
441 DOCKER_ARGS={docker_build_args}
442 DOCKER_NAME={docker_name}
443 DOCKER_ROOT={docker_root}
444 DOCKER_TAG={docker_tag}
445 DOCKERREGISTRY={docker_registry}
446 BUILD_MODE=SNAPSHOT
447 # Do the docker build
448 - shell: !include-raw: ../shell/docker-build.sh
449 - inject:
450 # Import the docker image information from the build step
451 properties-file: 'env_inject.txt'
452 # Execute any post build clean-up or testing
453 - shell: '{post_build_script}'
454 # Provided all steps have already passed, push the docker image
455 - shell: !include-raw: ../shell/docker-push.sh
456 triggers:
457 - reverse:
458 jobs:
Denes Nemeth5a504d22018-06-29 08:58:48 +0200459 - '{parent_job}'
Denes Nemeth88405ef2018-06-19 14:21:59 +0800460 result: 'success'
461
462- job-template:
Jessica Wagantalld9c235c2018-03-21 13:03:59 -0700463 name: '{project-name}-{subproject}-{stream}-verify-docker'
464 # Job template for Docker verify jobs
465 #
466 # The purpose of this job template is to run a docker build, and potentially
467 # test validation of the docker image
468
469 ######################
470 # Default parameters #
471 ######################
472
473 <<: *docker_job_boiler_plate
474 # yamllint disable-line rule:key-duplicates
475 <<: *docker_verify_boiler_plate
476
477 builders:
Jessica Wagantall05ae7da2018-10-22 17:32:33 -0700478 - lf-infra-pre-build
Jessica Wagantalld9c235c2018-03-21 13:03:59 -0700479 - lf-infra-docker-login:
480 global-settings-file: 'global-settings'
481 settings-file: '{mvn-settings}'
482 - shell: '{pre_build_script}'
483 - inject:
484 # Docker registry is purposely not using an '_' so as to not conflict
485 # with the Jenkins global env var
486 properties-content: |
487 DOCKER_ARGS={docker_build_args}
488 DOCKER_NAME={docker_name}
489 DOCKER_ROOT={docker_root}
490 DOCKER_TAG={docker_tag}
491 DOCKERREGISTRY={docker_registry}
Denes Nemethbb2815b2018-05-15 22:12:54 +0200492 BUILD_MODE=SNAPSHOT
Jessica Wagantalld9c235c2018-03-21 13:03:59 -0700493 # Do the docker build
494 - shell: !include-raw: ../shell/docker-build.sh
495 - inject:
496 # Import the docker image information from the build step
497 properties-file: 'env_inject.txt'
498 # Execute any post build clean-up or testing
499 - shell: '{post_build_script}'
500
501- job-template:
Denes Nemeth88405ef2018-06-19 14:21:59 +0800502 name: '{project-name}-{subproject}-{stream}-verify-docker-cascade-trigger'
503 # Job template for Docker verify jobs
504 #
505 # The purpose of this job template is to run a docker build, and potentially
506 # test validation of the docker image
507
508 ######################
509 # Default parameters #
510 ######################
511
512 <<: *docker_job_boiler_plate
513 # yamllint disable-line rule:key-duplicates
514 <<: *docker_verify_boiler_plate
515
516 builders:
Jessica Wagantall05ae7da2018-10-22 17:32:33 -0700517 - lf-infra-pre-build
Denes Nemeth88405ef2018-06-19 14:21:59 +0800518 - lf-infra-docker-login:
519 global-settings-file: 'global-settings'
520 settings-file: '{mvn-settings}'
521 - shell: '{pre_build_script}'
522 - inject:
523 # Docker registry is purposely not using an '_' so as to not conflict
524 # with the Jenkins global env var
525 properties-content: |
526 DOCKER_ARGS={docker_build_args}
527 DOCKER_NAME={docker_name}
528 DOCKER_ROOT={docker_root}
529 DOCKER_TAG={docker_tag}
530 DOCKERREGISTRY={docker_registry}
531 BUILD_MODE=SNAPSHOT
532 # Do the docker build
533 - shell: !include-raw: ../shell/docker-build.sh
534 - inject:
535 # Import the docker image information from the build step
536 properties-file: 'env_inject.txt'
537 # Execute any post build clean-up or testing
538 - shell: '{post_build_script}'
539 triggers:
540 - reverse:
541 jobs:
Denes Nemeth5a504d22018-06-29 08:58:48 +0200542 - '{parent_job}'
Denes Nemeth88405ef2018-06-19 14:21:59 +0800543 result: 'success'
544
545- job-template:
Jessica Wagantalld9c235c2018-03-21 13:03:59 -0700546 name: '{project-name}-{subproject}-{stream}-release-version-docker-daily-no-sonar'
547 # Job template for Docker daily release jobs
548 #
549 # The purpose of this job template is to run "docker build and docker push"
550 # for projects using this template.
551 #
552 # Required Variables:
553 # branch: git branch (eg. stable/lithium or master)
554 <<: *docker_job_boiler_plate
555
Denes Nemethbb2815b2018-05-15 22:12:54 +0200556 docker_registry: '$DOCKER_REGISTRY:10003'
Jessica Wagantalld9c235c2018-03-21 13:03:59 -0700557
558 scm:
559 - lf-infra-gerrit-scm:
560 jenkins-ssh-credential: '{jenkins-ssh-credential}'
561 git-url: '$GIT_URL/$PROJECT'
562 refspec: '$GERRIT_REFSPEC'
563 branch: '$GERRIT_BRANCH'
564 submodule-recursive: true
Jessica Wagantall7d10bdf2018-10-29 11:17:16 -0700565 submodule-timeout: '{submodule-timeout}'
Jessica Wagantall11a31f02019-05-13 12:28:14 -0700566 submodule-disable: '{submodule-disable}'
Jessica Wagantalld9c235c2018-03-21 13:03:59 -0700567 choosing-strategy: default
568
569 builders:
Jessica Wagantall05ae7da2018-10-22 17:32:33 -0700570 - lf-infra-pre-build
Jessica Wagantalld9c235c2018-03-21 13:03:59 -0700571 - lf-infra-docker-login:
572 global-settings-file: 'global-settings'
573 settings-file: '{mvn-settings}'
574 - shell: '{pre_build_script}'
575 - inject:
576 # Docker registry is purposely not using an '_' so as to not conflict
577 # with the Jenkins global env var
578 properties-content: |
579 DOCKER_ARGS={docker_build_args}
580 DOCKER_NAME={docker_name}
581 DOCKER_ROOT={docker_root}
582 DOCKER_TAG={docker_tag}
583 DOCKERREGISTRY={docker_registry}
Denes Nemethbb2815b2018-05-15 22:12:54 +0200584 BUILD_MODE=STAGING
Jessica Wagantalld9c235c2018-03-21 13:03:59 -0700585
586 # Do the docker build
587 - shell: !include-raw: ../shell/snapshot-strip.sh
588 - shell: !include-raw: ../shell/docker-build.sh
589 - inject:
590 # Import the docker image information from the build step
591 properties-file: 'env_inject.txt'
592 # Execute any post build clean-up or testing
593 - shell: '{post_build_script}'
594 # Provided all steps have already passed, push the docker image
595 - shell: !include-raw: ../shell/docker-push.sh
596
597 triggers:
598 # 11 AM UTC
Gary Wu5f4277f2018-09-28 10:36:23 -0700599 - timed: '@daily'
Jessica Wagantalld9c235c2018-03-21 13:03:59 -0700600 - gerrit-trigger-release-manually:
601 server: '{server-name}'
602 project: '{project}'
603 branch: '{branch}'
Denes Nemeth3380a0f2018-06-08 15:10:19 +0200604
605- job-template:
Denes Nemeth88405ef2018-06-19 14:21:59 +0800606 name: '{project-name}-{subproject}-{stream}-release-version-docker-daily-no-sonar-cascade-trigger'
607 # Job template for Docker daily release jobs
608 #
609 # The purpose of this job template is to run "docker build and docker push"
610 # for projects using this template. This job is triggered by the daily job
611 # that builds the artifacts required for building the Docker image.
612 #
613 # Required Variables:
614 # branch: git branch (eg. stable/lithium or master)
615 <<: *docker_job_boiler_plate
616
617 docker_registry: '$DOCKER_REGISTRY:10003'
618
619 scm:
620 - lf-infra-gerrit-scm:
621 jenkins-ssh-credential: '{jenkins-ssh-credential}'
622 git-url: '$GIT_URL/$PROJECT'
623 refspec: '$GERRIT_REFSPEC'
624 branch: '$GERRIT_BRANCH'
625 submodule-recursive: true
Jessica Wagantall7d10bdf2018-10-29 11:17:16 -0700626 submodule-timeout: '{submodule-timeout}'
Jessica Wagantall11a31f02019-05-13 12:28:14 -0700627 submodule-disable: '{submodule-disable}'
Denes Nemeth88405ef2018-06-19 14:21:59 +0800628 choosing-strategy: default
629
630 builders:
Jessica Wagantall05ae7da2018-10-22 17:32:33 -0700631 - lf-infra-pre-build
Denes Nemeth88405ef2018-06-19 14:21:59 +0800632 - lf-infra-docker-login:
633 global-settings-file: 'global-settings'
634 settings-file: '{mvn-settings}'
635 - shell: '{pre_build_script}'
636 - inject:
637 # Docker registry is purposely not using an '_' so as to not conflict
638 # with the Jenkins global env var
639 properties-content: |
640 DOCKER_ARGS={docker_build_args}
641 DOCKER_NAME={docker_name}
642 DOCKER_ROOT={docker_root}
643 DOCKER_TAG={docker_tag}
644 DOCKERREGISTRY={docker_registry}
645 BUILD_MODE=STAGING
646
647 # Do the docker build
648 - shell: !include-raw: ../shell/snapshot-strip.sh
649 - shell: !include-raw: ../shell/docker-build.sh
650 - inject:
651 # Import the docker image information from the build step
652 properties-file: 'env_inject.txt'
653 # Execute any post build clean-up or testing
654 - shell: '{post_build_script}'
655 # Provided all steps have already passed, push the docker image
656 - shell: !include-raw: ../shell/docker-push.sh
657
658 triggers:
659 - reverse:
660 jobs:
Denes Nemeth5a504d22018-06-29 08:58:48 +0200661 - '{parent_job}'
Denes Nemeth88405ef2018-06-19 14:21:59 +0800662 result: 'success'
663
664- job-template:
Denes Nemeth3380a0f2018-06-08 15:10:19 +0200665 name: '{project-name}-{subproject}-{stream}-release-version-docker-no-sonar'
666 # Job template for Docker final release job
667 #
668 # The purpose of this job template is to run "docker build and docker push"
669 # for projects using this template.
670 #
671 # Required Variables:
672 # branch: git branch (eg. stable/lithium or master)
673 <<: *docker_job_boiler_plate
674
675 docker_registry: '$DOCKER_REGISTRY:10003'
676
677 scm:
678 - lf-infra-gerrit-scm:
679 jenkins-ssh-credential: '{jenkins-ssh-credential}'
680 git-url: '$GIT_URL/$PROJECT'
681 refspec: '$GERRIT_REFSPEC'
682 branch: '$GERRIT_BRANCH'
683 submodule-recursive: true
Jessica Wagantall7d10bdf2018-10-29 11:17:16 -0700684 submodule-timeout: '{submodule-timeout}'
Jessica Wagantall11a31f02019-05-13 12:28:14 -0700685 submodule-disable: '{submodule-disable}'
Denes Nemeth3380a0f2018-06-08 15:10:19 +0200686 choosing-strategy: default
687
688 builders:
Jessica Wagantall05ae7da2018-10-22 17:32:33 -0700689 - lf-infra-pre-build
Denes Nemeth3380a0f2018-06-08 15:10:19 +0200690 - lf-infra-docker-login:
691 global-settings-file: 'global-settings'
692 settings-file: '{mvn-settings}'
693 - shell: '{pre_build_script}'
694 - inject:
695 # Docker registry is purposely not using an '_' so as to not conflict
696 # with the Jenkins global env var
697 properties-content: |
698 DOCKER_ARGS={docker_build_args}
699 DOCKER_NAME={docker_name}
700 DOCKER_ROOT={docker_root}
701 DOCKER_TAG={docker_tag}
702 DOCKERREGISTRY={docker_registry}
703 BUILD_MODE=STAGING
704
705 # Do the docker build
706 - shell: !include-raw: ../shell/snapshot-strip.sh
707 - shell: !include-raw: ../shell/docker-build.sh
708 - inject:
709 # Import the docker image information from the build step
710 properties-file: 'env_inject.txt'
711 # Execute any post build clean-up or testing
712 - shell: '{post_build_script}'
713 # Provided all steps have already passed, push the docker image
714 - shell: !include-raw: ../shell/docker-push.sh
715
Denes Nemeth88405ef2018-06-19 14:21:59 +0800716- job-template:
717 name: '{project-name}-{subproject}-{stream}-release-version-docker-cascade-trigger-no-sonar'
718 # Job template for Docker final release job
719 #
720 # The purpose of this job template is to run "docker build and docker push"
721 # for projects using this template. This job has no cascading counterpart, because the
722 # final release is moved manually to the release repo.
723 #
724 # Required Variables:
725 # branch: git branch (eg. stable/lithium or master)
726 <<: *docker_job_boiler_plate
727
728 docker_registry: '$DOCKER_REGISTRY:10003'
729
730 scm:
731 - lf-infra-gerrit-scm:
732 jenkins-ssh-credential: '{jenkins-ssh-credential}'
733 git-url: '$GIT_URL/$PROJECT'
734 refspec: '$GERRIT_REFSPEC'
735 branch: '$GERRIT_BRANCH'
736 submodule-recursive: true
Jessica Wagantall7d10bdf2018-10-29 11:17:16 -0700737 submodule-timeout: '{submodule-timeout}'
Jessica Wagantall11a31f02019-05-13 12:28:14 -0700738 submodule-disable: '{submodule-disable}'
Denes Nemeth88405ef2018-06-19 14:21:59 +0800739 choosing-strategy: default
740
741 builders:
Jessica Wagantall05ae7da2018-10-22 17:32:33 -0700742 - lf-infra-pre-build
Denes Nemeth88405ef2018-06-19 14:21:59 +0800743 - lf-infra-docker-login:
744 global-settings-file: 'global-settings'
745 settings-file: '{mvn-settings}'
746 - shell: '{pre_build_script}'
747 - inject:
748 # Docker registry is purposely not using an '_' so as to not conflict
749 # with the Jenkins global env var
750 properties-content: |
751 DOCKER_ARGS={docker_build_args}
752 DOCKER_NAME={docker_name}
753 DOCKER_ROOT={docker_root}
754 DOCKER_TAG={docker_tag}
755 DOCKERREGISTRY={docker_registry}
756 BUILD_MODE=STAGING
757
758 # Do the docker build
759 - shell: !include-raw: ../shell/snapshot-strip.sh
760 - shell: !include-raw: ../shell/docker-build.sh
761 - inject:
762 # Import the docker image information from the build step
763 properties-file: 'env_inject.txt'
764 # Execute any post build clean-up or testing
765 - shell: '{post_build_script}'
766 # Provided all steps have already passed, push the docker image
767 - shell: !include-raw: ../shell/docker-push.sh
768 triggers:
769 - reverse:
770 jobs:
Denes Nemeth5a504d22018-06-29 08:58:48 +0200771 - '{parent_job}'
Denes Nemeth88405ef2018-06-19 14:21:59 +0800772 result: 'success'
773
Bengt Thuree1515daa2019-09-10 13:39:04 +0200774- job-template:
775 # Job template for creating a docker manifest list
776 #
777 # The purpose of this job template is to run:
778 # 1. docker_push_manifest.sh script (which needs to exist in the
779 # project implementation repo)
Denes Nemeth88405ef2018-06-19 14:21:59 +0800780
Bengt Thuree1515daa2019-09-10 13:39:04 +0200781 name: '{project-name}-docker-manifest-{stream}'
782 <<: *docker_job_boiler_plate
783 node: '{build-node}'
784 build-timeout: 15
785
786 parameters:
787 - lf-infra-parameters:
788 project: '{project}'
789 stream: '{stream}'
790 branch: '{branch}'
791 - string:
792 name: PARENT_JOB_NAME
793 default: 'none'
794
795 disabled: '{obj:disabled}'
796
797 scm:
798 - lf-infra-gerrit-scm:
799 jenkins-ssh-credential: '{jenkins-ssh-credential}'
800 git-url: '$GIT_URL/$PROJECT'
801 refspec: '$GERRIT_REFSPEC'
802 branch: '$GERRIT_BRANCH'
803 submodule-recursive: true
804 submodule-disable: '{submodule-disable}'
805 submodule-timeout: '{submodule-timeout}'
806 choosing-strategy: default
807
808
809 builders:
810 - lf-infra-docker-login:
811 global-settings-file: 'global-settings'
812 settings-file: '{mvn-settings}'
813 - shell: |
814 #!/bin/bash -ex
815 export PARENT_JOB_NAME
816 ./docker_push_manifest.sh
817
818- job-template:
819 # Job template for staging jobs on multiple architectures
820 #
821 # The purpose of this job template is to:
822 # 1. Run parallel maven-docker-stage jobs for each supported architecure
823 # 2. Build and push a docker manifest list for the images created by
824 # the previous jobs
825
826 name: '{project-name}-multiarch-docker-stage-{stream}'
827 node: '{build-node}'
828 project-type: multijob
829 disabled: '{obj:disabled}'
830 build-timeout: 15
831 pattern: '**'
832
833 parameters:
834 - lf-infra-parameters:
835 project: '{project}'
836 stream: '{stream}'
837 branch: '{branch}'
838 - string:
839 name: DOCKER_REGISTRY
840 default: 'none'
841 - string:
842 name: DOCKERHUB_REGISTRY
843 default: 'registry-1.docker.io'
844
845 disabled: '{obj:disabled}'
846
847 properties:
848 - throttle:
849 max-per-node: 1
850 option: 'project'
851 - build-blocker:
852 use-build-blocker: true
853 blocking-jobs:
854 - '{project-name}-.*-docker-.*'
855 blocking-level: 'NODE'
856
857 scm:
858 - lf-infra-gerrit-scm:
859 jenkins-ssh-credential: '{jenkins-ssh-credential}'
860 git-url: '$GIT_URL/$PROJECT'
861 refspec: '$GERRIT_REFSPEC'
862 branch: '$GERRIT_BRANCH'
863 submodule-recursive: true
864 submodule-timeout: 10
865 submodule-disable: false
866 choosing-strategy: default
867
868 triggers:
869 - timed: '@daily'
870 - gerrit:
871 server-name: '{gerrit-server-name}'
872 trigger-on:
873 - comment-added-contains-event:
874 comment-contains-value: '^Patch Set\s+\d+:\s+stage-(docker-)?release\s*$'
875
876 projects:
877 - project-compare-type: ANT
878 project-pattern: '{project}'
879 branches:
880 - branch-compare-type: ANT
881 branch-pattern: '**/{branch}'
882 file-paths:
883 - compare-type: ANT
884 pattern: "**"
885
886 builders:
887 - multijob:
888 name: 'build docker images'
889 condition: ALWAYS
890 execution-type: PARALLEL
891 projects:
892 - name: '{project-name}-amd64-maven-docker-stage-{stream}'
893 kill-phase-on: FAILURE
894 current-parameters: true
895 - name: '{project-name}-arm64-maven-docker-stage-{stream}'
896 kill-phase-on: NEVER
897 current-parameters: true
898 - multijob:
899 name: 'publish docker manifest'
900 condition: SUCCESSFUL
901 execution-type: PARALLEL
902 projects:
903 - name: '{project-name}-docker-manifest-{stream}'
904 current-parameters: true
905 predefined-parameters: |
906 PARENT_JOB_NAME=$JOB_NAME
907 DOCKERHUB_REGISTRY=docker.io