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