Merge "Remove odlparent carbon 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: mvn35
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: 'mvn35'
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: 'mvn35'
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: 'mvn35'
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       # Critical component of the OpenDaylight community
204       - postbuildscript:
205           builders:
206             - role: BOTH
207               build-on:
208                 - SUCCESS
209               build-steps:
210                 - shell: echo '#topic cookies'
211           mark-unstable-if-failed: false
212       - lf-infra-publish
213
214 - job-template:
215     name: autorelease-update-validate-jobs-{stream}
216
217     ######################
218     # Default parameters #
219     ######################
220
221     cron: '@weekly'
222
223     #####################
224     # Job configuration #
225     #####################
226
227     project-type: freestyle
228     node: centos7-builder-2c-1g
229
230     properties:
231       - lf-infra-properties:
232           build-days-to-keep: 7
233
234     parameters:
235       - lf-infra-parameters:
236           project: releng/builder
237           branch: '{branch}'
238           stream: '{stream}'
239           lftools-version: '{lftools-version}'
240
241     scm:
242       - lf-infra-gerrit-scm:
243           git-url: '$GIT_URL/releng/builder'
244           branch: master
245           refspec: 'refs/heads/master'
246           jenkins-ssh-credential: opendaylight-jenkins-ssh
247           submodule-recursive: true
248           choosing-strategy: default
249
250     triggers:
251       - timed: '{cron}'
252       - gerrit:
253           server-name: '{gerrit-server-name}'
254           trigger-on:
255             - change-merged-event
256             - comment-added-contains-event:
257                 comment-contains-value: remerge$
258           projects:
259             - project-compare-type: ANT
260               project-pattern: '{project}'
261               branches:
262                 - branch-compare-type: ANT
263                   branch-pattern: '**/{branch}'
264               file-paths:
265                 - compare-type: ANT
266                   pattern: pom.xml
267
268     wrappers:
269       - lf-infra-wrappers:
270           build-timeout: 10
271           jenkins-ssh-credential: opendaylight-jenkins-ssh
272
273     builders:
274       - autorelease-update-project-views
275       - autorelease-update-validate-projects
276       - opendaylight-infra-push-gerrit-patch:
277           project: 'releng/builder'
278           gerrit-topic: 'autorelease-update-validate-jobs-{stream}'
279           gerrit-commit-message: |
280               Update validate autorelease projects for {stream}
281
282     publishers:
283       - lf-infra-publish
284
285 - job-template:
286     name: autorelease-version-bump-{stream}
287     project-type: freestyle
288     node: '{build-node}'
289
290     properties:
291       - opendaylight-infra-properties:
292           build-days-to-keep: 7
293
294     parameters:
295       - lf-infra-parameters:
296           project: releng/autorelease
297           branch: '{branch}'
298           stream: '{stream}'
299           refspec: 'refs/heads/{branch}'
300           lftools-version: '{lftools-version}'
301       - string:
302           name: RELEASE_TAG
303           default: '{next-release-tag}'
304           description: |
305               Release that is being version bumped.
306               Eg. Lithium, Beryllium, Boron, Carbon, Carbon-SR1, Carbon-SR2...
307       - bool:
308           name: BRANCH_CUT
309           default: false
310           description: |
311               If BRANCH_CUT is enabled, perform version bump for branch cutting
312               workflow, else perform version bump for simultaneous release
313               workflow (detault).
314       - bool:
315           name: DRY_RUN
316           default: true
317           description: |
318               If DRY_RUN is enabled modifications are not published to Gerrit
319               and artifacts are not pushed to Nexus. Instead the build will be
320               performed using the goals "clean install".
321       - maven-exec:
322           maven-version: mvn35
323
324     scm:
325       - lf-infra-gerrit-scm:
326           git-url: '$GIT_URL/$GERRIT_PROJECT'
327           branch: '{branch}'
328           refspec: 'refs/heads/{branch}'
329           jenkins-ssh-credential: opendaylight-jenkins-ssh
330           submodule-recursive: true
331           choosing-strategy: default
332
333     wrappers:
334       - lf-infra-wrappers:
335           build-timeout: 480
336           jenkins-ssh-credential: opendaylight-jenkins-ssh
337
338     builders:
339       # force jenkins install of maven version before any shell scripts use it
340       - maven-target:
341           maven-version: mvn35
342           goals: '-version'
343           settings: autorelease-settings
344           settings-type: cfp
345           global-settings: global-settings
346           global-settings-type: cfp
347       - autorelease-cfp
348       - shell: !include-raw-escape:
349           - ../global-jjb/shell/lftools-install.sh
350           - version-bump.sh
351
352     publishers:
353       - lf-infra-publish
354
355 - job-template:
356     name: 'autorelease-generate-release-notes-{stream}'
357
358     ######################
359     # Default parameters #
360     ######################
361
362     gerrit_merge_triggers:
363       - comment-added-contains-event:
364           comment-contains-value: generate-release-notes .+$
365
366     #####################
367     # Job Configuration #
368     #####################
369
370     project-type: freestyle
371     node: centos7-builder-2c-8g
372
373     properties:
374       - lf-infra-properties:
375           build-days-to-keep: 7
376
377     parameters:
378       - lf-infra-parameters:
379           project: '{project}'
380           branch: '{branch}'
381           stream: '{stream}'
382           lftools-version: '{lftools-version}'
383       - string:
384           name: RELEASE
385           description: Release to generate release notes for.
386
387     scm:
388       - lf-infra-gerrit-scm:
389           git-url: '$GIT_URL/$GERRIT_PROJECT'
390           branch: '$GERRIT_BRANCH'
391           refspec: '$GERRIT_REFSPEC'
392           jenkins-ssh-credential: opendaylight-jenkins-ssh
393           submodule-recursive: true
394           choosing-strategy: default
395
396     wrappers:
397       - lf-infra-wrappers:
398           build-timeout: 10
399           jenkins-ssh-credential: opendaylight-jenkins-ssh
400
401     triggers:
402       - gerrit:
403           server-name: '{gerrit-server-name}'
404           trigger-on: '{obj:gerrit_merge_triggers}'
405           projects:
406             - project-compare-type: ANT
407               project-pattern: '{project}'
408               branches:
409                 - branch-compare-type: ANT
410                   branch-pattern: '**/{branch}'
411
412     builders:
413       - autorelease-generate-release-notes
414
415     publishers:
416       - lf-infra-publish
417
418 - job-template:
419     name: '{project-name}-validate-autorelease-{stream}'
420
421     ############
422     # Defaults #
423     ############
424
425     java-version: openjdk8
426
427     #####################
428     # Job Configuration #
429     #####################
430
431     disabled: false
432     project-type: freestyle
433     # Note: This NEEDS to be hardcoded as projects should NOT be allowed to
434     #       override the build node.
435     node: centos7-builder-2c-8g
436     concurrent: true
437     jdk: '{java-version}'
438
439     properties:
440       - lf-infra-properties:
441           build-days-to-keep: 7
442
443     parameters:
444       - lf-infra-parameters:
445           project: '{project}'
446           stream: '{stream}'
447           branch: '{branch}'
448           lftools-version: '{lftools-version}'
449       - autorelease-release-tag:
450           release-tag: validate
451       - string:
452           name: CLONE_URL
453           default: '{git-url}/releng/autorelease'
454           description: "Autorelease clone URL"
455
456     scm:
457       - git:
458           url: '$CLONE_URL'
459           credentials-id: 'opendaylight-jenkins-ssh'
460           refspec: ''
461           branches:
462             - 'origin/{branch}'
463           skip-tag: true
464           submodule:
465             recursive: true
466             timeout: 60
467
468     wrappers:
469       - opendaylight-infra-wrappers:
470           build-timeout: '{build-timeout}'
471
472     triggers:
473       - gerrit-trigger-patch-submitted:
474           gerrit-server-name: '{gerrit-server-name}'
475           project: '{project}'
476           branch: '{branch}'
477           files: '**/*.xml'
478
479     builders:
480       - autorelease-checkout-gerrit-patch
481       - autorelease-compare-projects
482       - jacoco-nojava-workaround
483       - shell: "./scripts/list-project-dependencies.sh"
484       - autorelease-determine-merge-order
485       - autorelease-generate-release-patches
486       # In a perfect world projects should be releasing separately and we consume them
487       # via a project that pulls the release bits from each project from Nexus.
488       # Keep the patches compatible with that ideal, but apply an edit
489       # to enable building in a single maven reactor afterwards.
490       - autorelease-fix-relative-paths
491       - maven-target:
492           maven-version: mvn35
493           pom: validate-pom.xml
494           goals: |
495               clean install dependency:tree
496               -T1.5C
497               -Pq
498               {opendaylight-infra-mvn-opts}
499           java-opts:
500             - '-Xmx8g'
501           settings: autorelease-settings
502           settings-type: cfp
503           global-settings: global-settings
504           global-settings-type: cfp
505       # Hack to workaround the duplicate-finder plugin in odlparent breaking validate-autorelease
506       - shell: sed -i 's/validate/none/' /tmp/r/org/opendaylight/odlparent/odlparent/3.0.2/odlparent-3.0.2.pom || true
507       - maven-target:
508           maven-version: mvn35
509           pom: pom.xml
510           goals: |
511               clean validate
512               -Pq
513               {opendaylight-infra-mvn-opts}
514           java-opts:
515             - '-Xmx8g -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
516           settings: autorelease-settings
517           settings-type: cfp
518           global-settings: global-settings
519           global-settings-type: cfp
520       - shell: |
521           mkdir -p archives/
522           cp *.log $_
523
524     publishers:
525       - email-notification:
526           email-recipients: '{email-recipients}'
527           email-prefix: '[autorelease] [{project-name}]'
528       - lf-infra-publish