Merge "Consolidate CSIT wrappers into inttest-csit-common"
[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: UNSTABLE_OR_BETTER
190             property-file: variables.jenkins-trigger
191             fail-on-missing: true
192           - project: 'integration-distribution-test-{integration-test}'
193             condition: FAILED
194             trigger-with-no-params: true
195           - project: 'packaging-build-rpm-{stream}'
196             condition: UNSTABLE_OR_BETTER
197             predefined-parameters: DOWNLOAD_URL=$BUNDLE_URL
198             property-file: variables.jenkins-trigger
199             fail-on-missing: true
200           - project: 'packaging-build-deb-{stream}'
201             condition: UNSTABLE_OR_BETTER
202             predefined-parameters: DOWNLOAD_URL=$BUNDLE_URL
203             property-file: variables.jenkins-trigger
204             fail-on-missing: true
205       # Critical component of the OpenDaylight community
206       - postbuildscript:
207           builders:
208             - role: BOTH
209               build-on:
210                 - SUCCESS
211               build-steps:
212                 - shell: echo '#topic cookies'
213           mark-unstable-if-failed: false
214       - lf-infra-publish
215
216 - job-template:
217     name: 'autorelease-update-submodules-{stream}'
218
219     ######################
220     # Default parameters #
221     ######################
222
223     cron: 'H 0 * * *'
224
225     #####################
226     # Job configuration #
227     #####################
228
229     project-type: freestyle
230     node: centos7-builder-2c-2g
231
232     properties:
233       - lf-infra-properties:
234           build-days-to-keep: 7
235
236     parameters:
237       - lf-infra-parameters:
238           project: releng/autorelease
239           branch: '{branch}'
240           stream: '{stream}'
241           refspec: 'refs/heads/{branch}'
242           lftools-version: '{lftools-version}'
243
244     scm:
245       - lf-infra-gerrit-scm:
246           git-url: '$GIT_URL/$GERRIT_PROJECT'
247           branch: '{branch}'
248           refspec: 'refs/heads/{branch}'
249           jenkins-ssh-credential: opendaylight-jenkins-ssh
250           submodule-recursive: true
251           submodule-timeout: 10
252           choosing-strategy: default
253
254     wrappers:
255       - lf-infra-wrappers:
256           build-timeout: 10
257           jenkins-ssh-credential: opendaylight-jenkins-ssh
258
259     triggers:
260       - timed: '{obj:cron}'
261
262     builders:
263       - lf-infra-pre-build
264       # Fetch latest head of branch
265       - shell: |
266           git checkout $GERRIT_BRANCH
267           git submodule update --remote
268           git add .
269       - lf-infra-push-gerrit-patch:
270           project: '{project}'
271           gerrit-user: 'jenkins-$SILO'
272           gerrit-host: 'git.opendaylight.org'
273           gerrit-topic: 'autorelease-update-submodules'
274           gerrit-commit-message: 'Update submodules to latest HEAD of branch'
275           reviewers-email: ''
276
277     publishers:
278       - lf-infra-publish
279
280 - job-template:
281     name: autorelease-update-validate-jobs-{stream}
282
283     ######################
284     # Default parameters #
285     ######################
286
287     cron: '@weekly'
288
289     #####################
290     # Job configuration #
291     #####################
292
293     project-type: freestyle
294     node: centos7-builder-2c-1g
295
296     properties:
297       - lf-infra-properties:
298           build-days-to-keep: 7
299
300     parameters:
301       - lf-infra-parameters:
302           project: releng/builder
303           branch: '{branch}'
304           stream: '{stream}'
305           lftools-version: '{lftools-version}'
306
307     scm:
308       - lf-infra-gerrit-scm:
309           git-url: '$GIT_URL/releng/builder'
310           branch: master
311           refspec: 'refs/heads/master'
312           jenkins-ssh-credential: opendaylight-jenkins-ssh
313           submodule-recursive: true
314           submodule-timeout: 10
315           choosing-strategy: default
316
317     triggers:
318       - timed: '{cron}'
319       - gerrit:
320           server-name: '{gerrit-server-name}'
321           trigger-on:
322             - change-merged-event
323             - comment-added-contains-event:
324                 comment-contains-value: remerge$
325           projects:
326             - project-compare-type: ANT
327               project-pattern: '{project}'
328               branches:
329                 - branch-compare-type: ANT
330                   branch-pattern: '**/{branch}'
331               file-paths:
332                 - compare-type: ANT
333                   pattern: pom.xml
334
335     wrappers:
336       - lf-infra-wrappers:
337           build-timeout: 10
338           jenkins-ssh-credential: opendaylight-jenkins-ssh
339
340     builders:
341       - lf-infra-pre-build
342       - autorelease-update-project-views
343       - autorelease-update-validate-projects
344       - lf-infra-push-gerrit-patch:
345           project: '{project}'
346           gerrit-user: 'jenkins-$SILO'
347           gerrit-host: 'git.opendaylight.org'
348           gerrit-topic: 'autorelease-update-validate-jobs-{stream}'
349           gerrit-commit-message: |
350               'Update validate autorelease projects for {stream}'
351           reviewers-email: 'jenkins-releng@opendaylight.org'
352
353     publishers:
354       - lf-infra-publish
355
356 - job-template:
357     name: autorelease-version-bump-{stream}
358
359     #####################
360     # Default variables #
361     #####################
362
363     mvn-global-settings: global-settings
364     mvn-settings: autorelease-settings
365     mvn-version: mvn35
366
367     #####################
368     # Job configuration #
369     #####################
370
371     project-type: freestyle
372     node: '{build-node}'
373
374     properties:
375       - opendaylight-infra-properties:
376           build-days-to-keep: 7
377
378     parameters:
379       - lf-infra-parameters:
380           project: releng/autorelease
381           branch: '{branch}'
382           stream: '{stream}'
383           refspec: 'refs/heads/{branch}'
384           lftools-version: '{lftools-version}'
385       - string:
386           name: RELEASE_TAG
387           default: '{stream}'
388           description: |
389               Release that is being version bumped.
390               Eg. Lithium, Beryllium, Boron, Carbon, Carbon-SR1, Carbon-SR2...
391       - bool:
392           name: BRANCH_CUT
393           default: false
394           description: |
395               If BRANCH_CUT is enabled, perform version bump for branch cutting
396               workflow, else perform version bump for simultaneous release
397               workflow (detault).
398       - bool:
399           name: DRY_RUN
400           default: true
401           description: |
402               If DRY_RUN is enabled modifications are not published to Gerrit
403               and artifacts are not pushed to Nexus. Instead the build will be
404               performed using the goals "clean install".
405       - maven-exec:
406           maven-version: '{mvn-version}'
407
408     scm:
409       - lf-infra-gerrit-scm:
410           git-url: '$GIT_URL/$GERRIT_PROJECT'
411           branch: '{branch}'
412           refspec: 'refs/heads/{branch}'
413           jenkins-ssh-credential: opendaylight-jenkins-ssh
414           submodule-recursive: true
415           submodule-timeout: 10
416           choosing-strategy: default
417
418     wrappers:
419       - lf-infra-wrappers:
420           build-timeout: 480
421           jenkins-ssh-credential: opendaylight-jenkins-ssh
422
423     builders:
424       - lf-infra-pre-build
425       # force jenkins install of maven version before any shell scripts use it
426       - lf-maven-install:
427           mvn-version: '{mvn-version}'
428       - lf-provide-maven-settings:
429           global-settings-file: '{mvn-global-settings}'
430           settings-file: '{mvn-settings}'
431       - shell: !include-raw-escape:
432           - version-bump.sh
433
434     publishers:
435       - lf-infra-publish
436
437 - job-template:
438     name: 'autorelease-generate-release-notes-{stream}'
439
440     ######################
441     # Default parameters #
442     ######################
443
444     gerrit_merge_triggers:
445       - comment-added-contains-event:
446           comment-contains-value: generate-release-notes .+$
447
448     #####################
449     # Job Configuration #
450     #####################
451
452     project-type: freestyle
453     node: centos7-builder-2c-8g
454
455     properties:
456       - lf-infra-properties:
457           build-days-to-keep: 7
458
459     parameters:
460       - lf-infra-parameters:
461           project: '{project}'
462           branch: '{branch}'
463           stream: '{stream}'
464           lftools-version: '{lftools-version}'
465       - string:
466           name: RELEASE
467           description: Release to generate release notes for.
468
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