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