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