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