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