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