Use lf-maven-install macro to install mvn
[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       - lf-maven-install:
426           mvn-version: mvn35
427       - lf-provide-maven-settings:
428           global-settings-file: '{mvn-global-settings}'
429           settings-file: '{mvn-settings}'
430       - shell: !include-raw-escape:
431           - version-bump.sh
432
433     publishers:
434       - lf-infra-publish
435
436 - job-template:
437     name: 'autorelease-generate-release-notes-{stream}'
438
439     ######################
440     # Default parameters #
441     ######################
442
443     gerrit_merge_triggers:
444       - comment-added-contains-event:
445           comment-contains-value: generate-release-notes .+$
446
447     #####################
448     # Job Configuration #
449     #####################
450
451     project-type: freestyle
452     node: centos7-builder-2c-8g
453
454     properties:
455       - lf-infra-properties:
456           build-days-to-keep: 7
457
458     parameters:
459       - lf-infra-parameters:
460           project: '{project}'
461           branch: '{branch}'
462           stream: '{stream}'
463           lftools-version: '{lftools-version}'
464       - string:
465           name: RELEASE
466           description: Release to generate release notes for.
467
468     scm:
469       - lf-infra-gerrit-scm:
470           git-url: '$GIT_URL/$GERRIT_PROJECT'
471           branch: '$GERRIT_BRANCH'
472           refspec: '$GERRIT_REFSPEC'
473           jenkins-ssh-credential: opendaylight-jenkins-ssh
474           submodule-recursive: true
475           submodule-timeout: 10
476           choosing-strategy: default
477
478     wrappers:
479       - lf-infra-wrappers:
480           build-timeout: 10
481           jenkins-ssh-credential: opendaylight-jenkins-ssh
482
483     triggers:
484       - gerrit:
485           server-name: '{gerrit-server-name}'
486           trigger-on: '{obj:gerrit_merge_triggers}'
487           projects:
488             - project-compare-type: ANT
489               project-pattern: '{project}'
490               branches:
491                 - branch-compare-type: ANT
492                   branch-pattern: '**/{branch}'
493
494     builders:
495       - lf-infra-pre-build
496       - autorelease-generate-release-notes
497
498     publishers:
499       - lf-infra-publish
500
501 - job-template:
502     name: '{project-name}-validate-autorelease-{stream}'
503
504     ############
505     # Defaults #
506     ############
507
508     java-version: openjdk8
509     mvn-global-settings: global-settings
510     mvn-settings: autorelease-settings
511
512     #####################
513     # Job Configuration #
514     #####################
515
516     disabled: false
517     project-type: freestyle
518     # Note: This NEEDS to be hardcoded as projects should NOT be allowed to
519     #       override the build node.
520     node: centos7-builder-2c-8g
521     concurrent: true
522     jdk: '{java-version}'
523
524     properties:
525       - lf-infra-properties:
526           build-days-to-keep: 7
527
528     parameters:
529       - lf-infra-parameters:
530           project: '{project}'
531           stream: '{stream}'
532           branch: '{branch}'
533           lftools-version: '{lftools-version}'
534       - autorelease-release-tag:
535           release-tag: validate
536       - string:
537           name: CLONE_URL
538           default: '{git-url}/releng/autorelease'
539           description: "Autorelease clone URL"
540
541     scm:
542       - git:
543           url: '$CLONE_URL'
544           credentials-id: 'opendaylight-jenkins-ssh'
545           refspec: ''
546           branches:
547             - 'origin/{branch}'
548           skip-tag: true
549           submodule:
550             recursive: true
551             timeout: 60
552
553     wrappers:
554       - opendaylight-infra-wrappers:
555           build-timeout: '{build-timeout}'
556
557     triggers:
558       - gerrit-trigger-patch-submitted:
559           gerrit-server-name: '{gerrit-server-name}'
560           project: '{project}'
561           branch: '{branch}'
562           files: '**/*.xml'
563           forbidden-files: ''
564
565     builders:
566       - lf-infra-pre-build
567       - autorelease-checkout-gerrit-patch
568       - autorelease-compare-projects
569       - lf-jacoco-nojava-workaround
570       - shell: "./scripts/list-project-dependencies.sh"
571       - autorelease-determine-merge-order
572       - autorelease-generate-release-patches
573       # In a perfect world projects should be releasing separately and we consume them
574       # via a project that pulls the release bits from each project from Nexus.
575       # Keep the patches compatible with that ideal, but apply an edit
576       # to enable building in a single maven reactor afterwards.
577       - autorelease-fix-relative-paths
578       - maven-target:
579           maven-version: mvn35
580           pom: validate-pom.xml
581           goals: |
582               clean install dependency:tree
583               -T1.5C
584               -Pq
585               {opendaylight-infra-mvn-opts}
586           java-opts:
587             - '-Xmx8g'
588           settings: '{mvn-settings}'
589           settings-type: cfp
590           global-settings: '{mvn-global-settings}'
591           global-settings-type: cfp
592       - maven-target:
593           maven-version: mvn35
594           pom: pom.xml
595           goals: |
596               clean validate
597               -Pq
598               {opendaylight-infra-mvn-opts}
599           java-opts:
600             - '-Xmx8g -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
601           settings: '{mvn-settings}'
602           settings-type: cfp
603           global-settings: '{mvn-global-settings}'
604           global-settings-type: cfp
605       - shell: |
606           mkdir -p archives/
607           cp *.log $_
608
609     publishers:
610       - email-notification:
611           email-recipients: '{email-recipients}'
612           email-prefix: '[autorelease] [{project-name}]'
613       - lf-infra-publish