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