Consolidate mvn-settings configuration in AR
[releng/builder.git] / jjb / autorelease / autorelease-templates.yaml
1 ---
2 # Autorelease build jobs
3 - job-template:
4     name: autorelease-branch-cut
5
6     #####################
7     # Job Configuration #
8     #####################
9
10     project-type: freestyle
11     node: centos7-builder-2c-2g
12
13     properties:
14       - opendaylight-infra-properties:
15           build-days-to-keep: 7
16
17     parameters:
18       - lf-infra-parameters:
19           project: releng/autorelease
20           branch: master
21           stream: master
22           lftools-version: '{lftools-version}'
23       - string:
24           name: RELEASE
25           description: |
26               Release name to branch cut.
27               Eg. Lithium, Beryllium, Boron, Carbon...
28       - bool:
29           name: DRY_RUN
30           default: true
31           description: |
32               If DRY_RUN is enabled modifications are not published to Gerrit.
33
34     scm:
35       - lf-infra-gerrit-scm:
36           git-url: '$GIT_URL/$GERRIT_PROJECT'
37           branch: master
38           refspec: 'refs/heads/master'
39           jenkins-ssh-credential: opendaylight-jenkins-ssh
40           submodule-recursive: true
41           submodule-timeout: 10
42           choosing-strategy: default
43
44     wrappers:
45       - lf-infra-wrappers:
46           build-timeout: 10
47           jenkins-ssh-credential: opendaylight-jenkins-ssh
48
49     builders:
50       - shell: !include-raw-escape: branch-cut.sh
51
52     publishers:
53       - lf-infra-publish
54
55 - job-template:
56     name: 'autorelease-release-{stream}'
57
58     ######################
59     # Default parameters #
60     ######################
61
62     build-node: '{build-node}'
63     cron: 'H 0 * * *'
64     java-version: openjdk8
65     mvn-global-settings: global-settings
66     mvn-settings: autorelease-settings
67     mvn-version: mvn35
68     extra-mvn-opts: ''
69
70     #####################
71     # Job Configuration #
72     #####################
73
74     project-type: freestyle
75     node: '{build-node}'
76     jdk: '{java-version}'
77
78     properties:
79       - lf-infra-properties:
80           build-days-to-keep: 30
81
82     parameters:
83       - maven-exec:
84           maven-version: '{mvn-version}'
85       - lf-infra-parameters:
86           project: '{project}'
87           stream: '{stream}'
88           branch: '{branch}'
89           lftools-version: '{lftools-version}'
90       - distribution-karaf-version:
91           karaf-version: '{karaf-version}'
92       - autorelease-release-tag:
93           release-tag: '{stream}'
94       - string:
95           name: EXTRA_MVN_OPTS
96           default: '{extra-mvn-opts}'
97           description: |
98               Additional optional Maven Options to pass to the Maven Goals
99               parameter.
100
101               Examples:
102               -Dskip.karaf.featureTest=true  # To disable karaf SingleFeatureTests
103               --fail-never   # NEVER fail the build, regardless of project result
104               --fail-at-end  # Only fail the build afterwards; allow all non-impacted builds to continue
105       - string:
106           name: ARCHIVE_ARTIFACTS
107           default: '{archive-artifacts}'
108           description: Artifacts to archive to the logs server.
109       - string:
110           name: STAGING_PROFILE_ID
111           default: '{staging-profile-id}'
112           description: Nexus staging profile ID.
113
114     scm:
115       - git:
116           credentials-id: 'opendaylight-jenkins-ssh'
117           url: '$GIT_BASE'
118           refspec: '$GERRIT_REFSPEC'
119           branches:
120             - '$GERRIT_BRANCH'
121           choosing-strategy: default
122           skip-tag: true
123           submodule:
124             recursive: true
125             timeout: 60
126
127     wrappers:
128       - opendaylight-infra-wrappers:
129           build-timeout: '900'
130
131     triggers:
132       - timed: '{cron}'
133
134     builders:
135       - lf-infra-pre-build
136       # force jenkins install of maven version before any shell scripts use it
137       - lf-maven-install:
138           mvn-version: '{mvn-version}'
139       - wipe-local-maven-repo
140       - lf-jacoco-nojava-workaround
141       - shell: "./scripts/list-project-dependencies.sh"
142       - autorelease-determine-merge-order
143       - lf-provide-maven-settings:
144           global-settings-file: '{mvn-global-settings}'
145           settings-file: '{mvn-settings}'
146       - lf-infra-create-netrc:
147           server-id: '{mvn-staging-id}'
148       - autorelease-generate-release-patches
149       - autorelease-generate-artifact-versions
150       - autorelease-distribute-taglist
151       - distribute-build-url:
152           path: 'integration/distribution/$KARAF_ARTIFACT/src/main/assembly'
153       # In a perfect world projects should be releasing separately and we consume them
154       # via a project that pulls the release bits from each project from Nexus.
155       # Keep the patches compatible with that ideal, but apply an edit
156       # to enable building in a single maven reactor afterwards.
157       - autorelease-fix-relative-paths
158       - maven-target:
159           maven-version: '{mvn-version}'
160           pom: 'pom.xml'
161           goals: |
162               clean deploy
163               $EXTRA_MVN_OPTS
164               -Pintegrationtests,repoBuild
165               -Dcheckstyle.skip=true
166               -DaltDeploymentRepository=staging::default::file:"$WORKSPACE"/m2repo
167               {opendaylight-infra-mvn-opts}
168           java-opts:
169             - '-Xmx8g -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
170           settings: '{mvn-settings}'
171           settings-type: cfp
172           global-settings: '{mvn-global-settings}'
173           global-settings-type: cfp
174       - lf-maven-stage
175       - autorelease-get-integration-test-variables
176       - autorelease-maven-sources:
177           opendaylight-infra-mvn-opts: '{opendaylight-infra-mvn-opts}'
178           maven-version: '{mvn-version}'
179           settings: '{mvn-settings}'
180           global-settings: '{mvn-global-settings}'
181       - shell: |
182           mkdir -p archives/
183           cp *.log *.prop $_
184
185     publishers:
186       - opendaylight-infra-notify-status
187       - trigger-parameterized-builds:
188           - project: 'integration-distribution-test-{integration-test}'
189             condition: UNSTABLE_OR_BETTER
190             property-file: variables.jenkins-trigger
191             fail-on-missing: true
192           - project: 'integration-distribution-test-{integration-test}'
193             condition: FAILED
194             trigger-with-no-params: true
195           - project: 'packaging-build-rpm-{stream}'
196             condition: UNSTABLE_OR_BETTER
197             predefined-parameters: DOWNLOAD_URL=$BUNDLE_URL
198             property-file: variables.jenkins-trigger
199             fail-on-missing: true
200           - project: 'packaging-build-deb-{stream}'
201             condition: UNSTABLE_OR_BETTER
202             predefined-parameters: DOWNLOAD_URL=$BUNDLE_URL
203             property-file: variables.jenkins-trigger
204             fail-on-missing: true
205       # Critical component of the OpenDaylight community
206       - postbuildscript:
207           builders:
208             - role: BOTH
209               build-on:
210                 - SUCCESS
211               build-steps:
212                 - shell: echo '#topic cookies'
213           mark-unstable-if-failed: false
214       - lf-infra-publish
215
216 - job-template:
217     name: 'autorelease-update-submodules-{stream}'
218
219     ######################
220     # Default parameters #
221     ######################
222
223     cron: 'H 0 * * *'
224
225     #####################
226     # Job configuration #
227     #####################
228
229     project-type: freestyle
230     node: centos7-builder-2c-2g
231
232     properties:
233       - lf-infra-properties:
234           build-days-to-keep: 7
235
236     parameters:
237       - lf-infra-parameters:
238           project: releng/autorelease
239           branch: '{branch}'
240           stream: '{stream}'
241           refspec: 'refs/heads/{branch}'
242           lftools-version: '{lftools-version}'
243
244     scm:
245       - lf-infra-gerrit-scm:
246           git-url: '$GIT_URL/$GERRIT_PROJECT'
247           branch: '{branch}'
248           refspec: 'refs/heads/{branch}'
249           jenkins-ssh-credential: opendaylight-jenkins-ssh
250           submodule-recursive: true
251           submodule-timeout: 10
252           choosing-strategy: default
253
254     wrappers:
255       - lf-infra-wrappers:
256           build-timeout: 10
257           jenkins-ssh-credential: opendaylight-jenkins-ssh
258
259     triggers:
260       - timed: '{obj:cron}'
261
262     builders:
263       - lf-infra-pre-build
264       # Fetch latest head of branch
265       - shell: |
266           git checkout $GERRIT_BRANCH
267           git submodule update --remote
268           git add .
269       - lf-infra-push-gerrit-patch:
270           project: '{project}'
271           gerrit-user: 'jenkins-$SILO'
272           gerrit-host: 'git.opendaylight.org'
273           gerrit-topic: 'autorelease-update-submodules'
274           gerrit-commit-message: 'Update submodules to latest HEAD of branch'
275           reviewers-email: ''
276
277     publishers:
278       - lf-infra-publish
279
280 - job-template:
281     name: autorelease-update-validate-jobs-{stream}
282
283     ######################
284     # Default parameters #
285     ######################
286
287     cron: '@weekly'
288
289     #####################
290     # Job configuration #
291     #####################
292
293     project-type: freestyle
294     node: centos7-builder-2c-1g
295
296     properties:
297       - lf-infra-properties:
298           build-days-to-keep: 7
299
300     parameters:
301       - lf-infra-parameters:
302           project: releng/builder
303           branch: '{branch}'
304           stream: '{stream}'
305           lftools-version: '{lftools-version}'
306
307     scm:
308       - lf-infra-gerrit-scm:
309           git-url: '$GIT_URL/releng/builder'
310           branch: master
311           refspec: 'refs/heads/master'
312           jenkins-ssh-credential: opendaylight-jenkins-ssh
313           submodule-recursive: true
314           submodule-timeout: 10
315           choosing-strategy: default
316
317     triggers:
318       - timed: '{cron}'
319       - gerrit:
320           server-name: '{gerrit-server-name}'
321           trigger-on:
322             - change-merged-event
323             - comment-added-contains-event:
324                 comment-contains-value: remerge$
325           projects:
326             - project-compare-type: ANT
327               project-pattern: '{project}'
328               branches:
329                 - branch-compare-type: ANT
330                   branch-pattern: '**/{branch}'
331               file-paths:
332                 - compare-type: ANT
333                   pattern: pom.xml
334
335     wrappers:
336       - lf-infra-wrappers:
337           build-timeout: 10
338           jenkins-ssh-credential: opendaylight-jenkins-ssh
339
340     builders:
341       - lf-infra-pre-build
342       - autorelease-update-project-views
343       - autorelease-update-validate-projects
344       - lf-infra-push-gerrit-patch:
345           project: '{project}'
346           gerrit-user: 'jenkins-$SILO'
347           gerrit-host: 'git.opendaylight.org'
348           gerrit-topic: 'autorelease-update-validate-jobs-{stream}'
349           gerrit-commit-message: |
350               'Update validate autorelease projects for {stream}'
351           reviewers-email: 'jenkins-releng@opendaylight.org'
352
353     publishers:
354       - lf-infra-publish
355
356 - job-template:
357     name: autorelease-version-bump-{stream}
358
359     #####################
360     # Default variables #
361     #####################
362
363     mvn-global-settings: global-settings
364     mvn-settings: autorelease-settings
365
366     #####################
367     # Job configuration #
368     #####################
369
370     project-type: freestyle
371     node: '{build-node}'
372
373     properties:
374       - opendaylight-infra-properties:
375           build-days-to-keep: 7
376
377     parameters:
378       - lf-infra-parameters:
379           project: releng/autorelease
380           branch: '{branch}'
381           stream: '{stream}'
382           refspec: 'refs/heads/{branch}'
383           lftools-version: '{lftools-version}'
384       - string:
385           name: RELEASE_TAG
386           default: '{stream}'
387           description: |
388               Release that is being version bumped.
389               Eg. Lithium, Beryllium, Boron, Carbon, Carbon-SR1, Carbon-SR2...
390       - bool:
391           name: BRANCH_CUT
392           default: false
393           description: |
394               If BRANCH_CUT is enabled, perform version bump for branch cutting
395               workflow, else perform version bump for simultaneous release
396               workflow (detault).
397       - bool:
398           name: DRY_RUN
399           default: true
400           description: |
401               If DRY_RUN is enabled modifications are not published to Gerrit
402               and artifacts are not pushed to Nexus. Instead the build will be
403               performed using the goals "clean install".
404       - maven-exec:
405           maven-version: mvn35
406
407     scm:
408       - lf-infra-gerrit-scm:
409           git-url: '$GIT_URL/$GERRIT_PROJECT'
410           branch: '{branch}'
411           refspec: 'refs/heads/{branch}'
412           jenkins-ssh-credential: opendaylight-jenkins-ssh
413           submodule-recursive: true
414           submodule-timeout: 10
415           choosing-strategy: default
416
417     wrappers:
418       - lf-infra-wrappers:
419           build-timeout: 480
420           jenkins-ssh-credential: opendaylight-jenkins-ssh
421
422     builders:
423       - lf-infra-pre-build
424       # force jenkins install of maven version before any shell scripts use it
425       - maven-target:
426           maven-version: mvn35
427           goals: '-version'
428           settings: '{mvn-settings}'
429           settings-type: cfp
430           global-settings: '{mvn-global-settings}'
431           global-settings-type: cfp
432       - lf-provide-maven-settings:
433           global-settings-file: '{mvn-global-settings}'
434           settings-file: '{mvn-settings}'
435       - shell: !include-raw-escape:
436           - version-bump.sh
437
438     publishers:
439       - lf-infra-publish
440
441 - job-template:
442     name: 'autorelease-generate-release-notes-{stream}'
443
444     ######################
445     # Default parameters #
446     ######################
447
448     gerrit_merge_triggers:
449       - comment-added-contains-event:
450           comment-contains-value: generate-release-notes .+$
451
452     #####################
453     # Job Configuration #
454     #####################
455
456     project-type: freestyle
457     node: centos7-builder-2c-8g
458
459     properties:
460       - lf-infra-properties:
461           build-days-to-keep: 7
462
463     parameters:
464       - lf-infra-parameters:
465           project: '{project}'
466           branch: '{branch}'
467           stream: '{stream}'
468           lftools-version: '{lftools-version}'
469       - string:
470           name: RELEASE
471           description: Release to generate release notes for.
472
473     scm:
474       - lf-infra-gerrit-scm:
475           git-url: '$GIT_URL/$GERRIT_PROJECT'
476           branch: '$GERRIT_BRANCH'
477           refspec: '$GERRIT_REFSPEC'
478           jenkins-ssh-credential: opendaylight-jenkins-ssh
479           submodule-recursive: true
480           submodule-timeout: 10
481           choosing-strategy: default
482
483     wrappers:
484       - lf-infra-wrappers:
485           build-timeout: 10
486           jenkins-ssh-credential: opendaylight-jenkins-ssh
487
488     triggers:
489       - gerrit:
490           server-name: '{gerrit-server-name}'
491           trigger-on: '{obj:gerrit_merge_triggers}'
492           projects:
493             - project-compare-type: ANT
494               project-pattern: '{project}'
495               branches:
496                 - branch-compare-type: ANT
497                   branch-pattern: '**/{branch}'
498
499     builders:
500       - lf-infra-pre-build
501       - autorelease-generate-release-notes
502
503     publishers:
504       - lf-infra-publish
505
506 - job-template:
507     name: '{project-name}-validate-autorelease-{stream}'
508
509     ############
510     # Defaults #
511     ############
512
513     java-version: openjdk8
514     mvn-global-settings: global-settings
515     mvn-settings: autorelease-settings
516
517     #####################
518     # Job Configuration #
519     #####################
520
521     disabled: false
522     project-type: freestyle
523     # Note: This NEEDS to be hardcoded as projects should NOT be allowed to
524     #       override the build node.
525     node: centos7-builder-2c-8g
526     concurrent: true
527     jdk: '{java-version}'
528
529     properties:
530       - lf-infra-properties:
531           build-days-to-keep: 7
532
533     parameters:
534       - lf-infra-parameters:
535           project: '{project}'
536           stream: '{stream}'
537           branch: '{branch}'
538           lftools-version: '{lftools-version}'
539       - autorelease-release-tag:
540           release-tag: validate
541       - string:
542           name: CLONE_URL
543           default: '{git-url}/releng/autorelease'
544           description: "Autorelease clone URL"
545
546     scm:
547       - git:
548           url: '$CLONE_URL'
549           credentials-id: 'opendaylight-jenkins-ssh'
550           refspec: ''
551           branches:
552             - 'origin/{branch}'
553           skip-tag: true
554           submodule:
555             recursive: true
556             timeout: 60
557
558     wrappers:
559       - opendaylight-infra-wrappers:
560           build-timeout: '{build-timeout}'
561
562     triggers:
563       - gerrit-trigger-patch-submitted:
564           gerrit-server-name: '{gerrit-server-name}'
565           project: '{project}'
566           branch: '{branch}'
567           files: '**/*.xml'
568           forbidden-files: ''
569
570     builders:
571       - lf-infra-pre-build
572       - autorelease-checkout-gerrit-patch
573       - autorelease-compare-projects
574       - lf-jacoco-nojava-workaround
575       - shell: "./scripts/list-project-dependencies.sh"
576       - autorelease-determine-merge-order
577       - autorelease-generate-release-patches
578       # In a perfect world projects should be releasing separately and we consume them
579       # via a project that pulls the release bits from each project from Nexus.
580       # Keep the patches compatible with that ideal, but apply an edit
581       # to enable building in a single maven reactor afterwards.
582       - autorelease-fix-relative-paths
583       - maven-target:
584           maven-version: mvn35
585           pom: validate-pom.xml
586           goals: |
587               clean install dependency:tree
588               -T1.5C
589               -Pq
590               {opendaylight-infra-mvn-opts}
591           java-opts:
592             - '-Xmx8g'
593           settings: '{mvn-settings}'
594           settings-type: cfp
595           global-settings: '{mvn-global-settings}'
596           global-settings-type: cfp
597       - maven-target:
598           maven-version: mvn35
599           pom: pom.xml
600           goals: |
601               clean validate
602               -Pq
603               {opendaylight-infra-mvn-opts}
604           java-opts:
605             - '-Xmx8g -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
606           settings: '{mvn-settings}'
607           settings-type: cfp
608           global-settings: '{mvn-global-settings}'
609           global-settings-type: cfp
610       - shell: |
611           mkdir -p archives/
612           cp *.log $_
613
614     publishers:
615       - email-notification:
616           email-recipients: '{email-recipients}'
617           email-prefix: '[autorelease] [{project-name}]'
618       - lf-infra-publish