Merge "Add SUITES to common_env output"
[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     mvn-version: mvn35
366
367     #####################
368     # Job configuration #
369     #####################
370
371     project-type: freestyle
372     node: '{build-node}'
373
374     properties:
375       - opendaylight-infra-properties:
376           build-days-to-keep: 7
377
378     parameters:
379       - lf-infra-parameters:
380           project: releng/autorelease
381           branch: '{branch}'
382           stream: '{stream}'
383           refspec: 'refs/heads/{branch}'
384           lftools-version: '{lftools-version}'
385       - string:
386           name: RELEASE_TAG
387           default: '{stream}'
388           description: |
389               Release that is being version bumped.
390               Eg. Lithium, Beryllium, Boron, Carbon, Carbon-SR1, Carbon-SR2...
391       - bool:
392           name: BRANCH_CUT
393           default: false
394           description: |
395               If BRANCH_CUT is enabled, perform version bump for branch cutting
396               workflow, else perform version bump for simultaneous release
397               workflow (detault).
398       - bool:
399           name: DRY_RUN
400           default: true
401           description: |
402               If DRY_RUN is enabled modifications are not published to Gerrit
403               and artifacts are not pushed to Nexus. Instead the build will be
404               performed using the goals "clean install".
405       - maven-exec:
406           maven-version: '{mvn-version}'
407
408     scm:
409       - lf-infra-gerrit-scm:
410           git-url: '$GIT_URL/$GERRIT_PROJECT'
411           branch: '{branch}'
412           refspec: 'refs/heads/{branch}'
413           jenkins-ssh-credential: opendaylight-jenkins-ssh
414           submodule-recursive: true
415           submodule-timeout: 10
416           choosing-strategy: default
417
418     wrappers:
419       - lf-infra-wrappers:
420           build-timeout: 480
421           jenkins-ssh-credential: opendaylight-jenkins-ssh
422
423     builders:
424       - lf-infra-pre-build
425       # force jenkins install of maven version before any shell scripts use it
426       - lf-maven-install:
427           mvn-version: '{mvn-version}'
428       - lf-provide-maven-settings:
429           global-settings-file: '{mvn-global-settings}'
430           settings-file: '{mvn-settings}'
431       - shell: !include-raw-escape:
432           - version-bump.sh
433
434     publishers:
435       - lf-infra-publish
436
437 - job-template:
438     name: 'autorelease-generate-release-notes-{stream}'
439
440     ######################
441     # Default parameters #
442     ######################
443
444     gerrit_merge_triggers:
445       - comment-added-contains-event:
446           comment-contains-value: generate-release-notes .+$
447
448     #####################
449     # Job Configuration #
450     #####################
451
452     project-type: freestyle
453     node: centos7-builder-2c-8g
454
455     properties:
456       - lf-infra-properties:
457           build-days-to-keep: 7
458
459     parameters:
460       - lf-infra-parameters:
461           project: '{project}'
462           branch: '{branch}'
463           stream: '{stream}'
464           lftools-version: '{lftools-version}'
465       - string:
466           name: RELEASE
467           description: |
468               Release to generate release notes for.
469               Eg. Oxygen-SR1, Fluorine-SR2...
470     scm:
471       - lf-infra-gerrit-scm:
472           git-url: '$GIT_URL/$GERRIT_PROJECT'
473           branch: '$GERRIT_BRANCH'
474           refspec: '$GERRIT_REFSPEC'
475           jenkins-ssh-credential: opendaylight-jenkins-ssh
476           submodule-recursive: true
477           submodule-timeout: 10
478           choosing-strategy: default
479
480     wrappers:
481       - lf-infra-wrappers:
482           build-timeout: 10
483           jenkins-ssh-credential: opendaylight-jenkins-ssh
484
485     triggers:
486       - gerrit:
487           server-name: '{gerrit-server-name}'
488           trigger-on: '{obj:gerrit_merge_triggers}'
489           projects:
490             - project-compare-type: ANT
491               project-pattern: '{project}'
492               branches:
493                 - branch-compare-type: ANT
494                   branch-pattern: '**/{branch}'
495
496     builders:
497       - lf-infra-pre-build
498       - autorelease-generate-release-notes
499
500     publishers:
501       - lf-infra-publish
502
503 - job-template:
504     name: '{project-name}-validate-autorelease-{stream}'
505
506     #####################
507     # Default variables #
508     #####################
509
510     java-version: openjdk8
511     mvn-global-settings: global-settings
512     mvn-settings: autorelease-settings
513     mvn-version: mvn35
514
515     #####################
516     # Job Configuration #
517     #####################
518
519     disabled: false
520     project-type: freestyle
521     # Note: This NEEDS to be hardcoded as projects should NOT be allowed to
522     #       override the build node.
523     node: centos7-builder-2c-8g
524     concurrent: true
525     jdk: '{java-version}'
526
527     properties:
528       - lf-infra-properties:
529           build-days-to-keep: 7
530
531     parameters:
532       - lf-infra-parameters:
533           project: '{project}'
534           stream: '{stream}'
535           branch: '{branch}'
536           lftools-version: '{lftools-version}'
537       - autorelease-release-tag:
538           release-tag: validate
539       - string:
540           name: CLONE_URL
541           default: '{git-url}/releng/autorelease'
542           description: "Autorelease clone URL"
543
544     scm:
545       - git:
546           url: '$CLONE_URL'
547           credentials-id: 'opendaylight-jenkins-ssh'
548           refspec: ''
549           branches:
550             - 'origin/{branch}'
551           skip-tag: true
552           submodule:
553             recursive: true
554             timeout: 60
555
556     wrappers:
557       - opendaylight-infra-wrappers:
558           build-timeout: '{build-timeout}'
559
560     triggers:
561       - gerrit-trigger-patch-submitted:
562           gerrit-server-name: '{gerrit-server-name}'
563           project: '{project}'
564           branch: '{branch}'
565           files: '**/*.xml'
566           forbidden-files: ''
567
568     builders:
569       - lf-infra-pre-build
570       - autorelease-checkout-gerrit-patch
571       - autorelease-compare-projects
572       - lf-jacoco-nojava-workaround
573       - shell: "./scripts/list-project-dependencies.sh"
574       - autorelease-determine-merge-order
575       - autorelease-generate-release-patches
576       # In a perfect world projects should be releasing separately and we consume them
577       # via a project that pulls the release bits from each project from Nexus.
578       # Keep the patches compatible with that ideal, but apply an edit
579       # to enable building in a single maven reactor afterwards.
580       - autorelease-fix-relative-paths
581       - maven-target:
582           maven-version: '{mvn-version}'
583           pom: validate-pom.xml
584           goals: |
585               clean install dependency:tree
586               -T1.5C
587               -Pq
588               {opendaylight-infra-mvn-opts}
589           java-opts:
590             - '-Xmx8g'
591           settings: '{mvn-settings}'
592           settings-type: cfp
593           global-settings: '{mvn-global-settings}'
594           global-settings-type: cfp
595       - maven-target:
596           maven-version: '{mvn-version}'
597           pom: pom.xml
598           goals: |
599               clean validate
600               -Pq
601               {opendaylight-infra-mvn-opts}
602           java-opts:
603             - '-Xmx8g -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
604           settings: '{mvn-settings}'
605           settings-type: cfp
606           global-settings: '{mvn-global-settings}'
607           global-settings-type: cfp
608       - shell: |
609           mkdir -p archives/
610           cp *.log $_
611
612     publishers:
613       - email-notification:
614           email-recipients: '{email-recipients}'
615           email-prefix: '[autorelease] [{project-name}]'
616       - lf-infra-publish