Use lf-infra-pre-build for pulling in lftools
[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     # Default parameters #
59     ######################
60
61     build-node: '{build-node}'
62     cron: 'H 0 * * *'
63     java-version: openjdk8
64     mvn-version: mvn35
65     extra-mvn-opts: ''
66
67     #####################
68     # Job Configuration #
69     #####################
70
71     project-type: freestyle
72     node: '{build-node}'
73     jdk: '{java-version}'
74
75     properties:
76       - lf-infra-properties:
77           build-days-to-keep: 30
78
79     parameters:
80       - maven-exec:
81           maven-version: 'mvn35'
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: '{stream}'
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: 'mvn35'
150           pom: 'pom.xml'
151           goals: |
152               clean deploy
153               $EXTRA_MVN_OPTS
154               -Pintegrationtests,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: 'mvn35'
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: 'packaging-build-rpm-{stream}'
187             condition: UNSTABLE_OR_BETTER
188             predefined-parameters: DOWNLOAD_URL=$BUNDLE_URL
189             property-file: variables.jenkins-trigger
190             fail-on-missing: true
191           - project: 'packaging-build-deb-{stream}'
192             condition: UNSTABLE_OR_BETTER
193             predefined-parameters: DOWNLOAD_URL=$BUNDLE_URL
194             property-file: variables.jenkins-trigger
195             fail-on-missing: true
196       # Critical component of the OpenDaylight community
197       - postbuildscript:
198           builders:
199             - role: BOTH
200               build-on:
201                 - SUCCESS
202               build-steps:
203                 - shell: echo '#topic cookies'
204           mark-unstable-if-failed: false
205       - lf-infra-publish
206
207 - job-template:
208     name: 'autorelease-update-submodules-{stream}'
209
210     ######################
211     # Default parameters #
212     ######################
213
214     cron: 'H 0 * * *'
215
216     #####################
217     # Job configuration #
218     #####################
219
220     project-type: freestyle
221     node: centos7-builder-2c-2g
222
223     properties:
224       - lf-infra-properties:
225           build-days-to-keep: 7
226
227     parameters:
228       - lf-infra-parameters:
229           project: releng/autorelease
230           branch: '{branch}'
231           stream: '{stream}'
232           refspec: 'refs/heads/{branch}'
233           lftools-version: '{lftools-version}'
234
235     scm:
236       - lf-infra-gerrit-scm:
237           git-url: '$GIT_URL/$GERRIT_PROJECT'
238           branch: '{branch}'
239           refspec: 'refs/heads/{branch}'
240           jenkins-ssh-credential: opendaylight-jenkins-ssh
241           submodule-recursive: true
242           choosing-strategy: default
243
244     wrappers:
245       - lf-infra-wrappers:
246           build-timeout: 10
247           jenkins-ssh-credential: opendaylight-jenkins-ssh
248
249     triggers:
250       - timed: '{obj:cron}'
251
252     builders:
253       # Fetch latest head of branch
254       - shell: |
255           git checkout $GERRIT_BRANCH
256           git submodule update --remote
257           git add .
258       - lf-infra-push-gerrit-patch:
259           project: '{project}'
260           gerrit-user: 'jenkins-$SILO'
261           gerrit-host: 'git.opendaylight.org'
262           gerrit-topic: 'autorelease-update-submodules'
263           gerrit-commit-message: 'Update submodules to latest HEAD of branch'
264           reviewers-email: ''
265
266     publishers:
267       - lf-infra-publish
268
269 - job-template:
270     name: autorelease-update-validate-jobs-{stream}
271
272     ######################
273     # Default parameters #
274     ######################
275
276     cron: '@weekly'
277
278     #####################
279     # Job configuration #
280     #####################
281
282     project-type: freestyle
283     node: centos7-builder-2c-1g
284
285     properties:
286       - lf-infra-properties:
287           build-days-to-keep: 7
288
289     parameters:
290       - lf-infra-parameters:
291           project: releng/builder
292           branch: '{branch}'
293           stream: '{stream}'
294           lftools-version: '{lftools-version}'
295
296     scm:
297       - lf-infra-gerrit-scm:
298           git-url: '$GIT_URL/releng/builder'
299           branch: master
300           refspec: 'refs/heads/master'
301           jenkins-ssh-credential: opendaylight-jenkins-ssh
302           submodule-recursive: true
303           choosing-strategy: default
304
305     triggers:
306       - timed: '{cron}'
307       - gerrit:
308           server-name: '{gerrit-server-name}'
309           trigger-on:
310             - change-merged-event
311             - comment-added-contains-event:
312                 comment-contains-value: remerge$
313           projects:
314             - project-compare-type: ANT
315               project-pattern: '{project}'
316               branches:
317                 - branch-compare-type: ANT
318                   branch-pattern: '**/{branch}'
319               file-paths:
320                 - compare-type: ANT
321                   pattern: pom.xml
322
323     wrappers:
324       - lf-infra-wrappers:
325           build-timeout: 10
326           jenkins-ssh-credential: opendaylight-jenkins-ssh
327
328     builders:
329       - autorelease-update-project-views
330       - autorelease-update-validate-projects
331       - lf-infra-push-gerrit-patch:
332           project: '{project}'
333           gerrit-user: 'jenkins-$SILO'
334           gerrit-host: 'git.opendaylight.org'
335           gerrit-topic: 'autorelease-update-validate-jobs-{stream}'
336           gerrit-commit-message: |
337               'Update validate autorelease projects for {stream}'
338           reviewers-email: 'jenkins-releng@opendaylight.org'
339
340     publishers:
341       - lf-infra-publish
342
343 - job-template:
344     name: autorelease-version-bump-{stream}
345     project-type: freestyle
346     node: '{build-node}'
347
348     properties:
349       - opendaylight-infra-properties:
350           build-days-to-keep: 7
351
352     parameters:
353       - lf-infra-parameters:
354           project: releng/autorelease
355           branch: '{branch}'
356           stream: '{stream}'
357           refspec: 'refs/heads/{branch}'
358           lftools-version: '{lftools-version}'
359       - string:
360           name: RELEASE_TAG
361           default: '{stream}'
362           description: |
363               Release that is being version bumped.
364               Eg. Lithium, Beryllium, Boron, Carbon, Carbon-SR1, Carbon-SR2...
365       - bool:
366           name: BRANCH_CUT
367           default: false
368           description: |
369               If BRANCH_CUT is enabled, perform version bump for branch cutting
370               workflow, else perform version bump for simultaneous release
371               workflow (detault).
372       - bool:
373           name: DRY_RUN
374           default: true
375           description: |
376               If DRY_RUN is enabled modifications are not published to Gerrit
377               and artifacts are not pushed to Nexus. Instead the build will be
378               performed using the goals "clean install".
379       - maven-exec:
380           maven-version: mvn35
381
382     scm:
383       - lf-infra-gerrit-scm:
384           git-url: '$GIT_URL/$GERRIT_PROJECT'
385           branch: '{branch}'
386           refspec: 'refs/heads/{branch}'
387           jenkins-ssh-credential: opendaylight-jenkins-ssh
388           submodule-recursive: true
389           choosing-strategy: default
390
391     wrappers:
392       - lf-infra-wrappers:
393           build-timeout: 480
394           jenkins-ssh-credential: opendaylight-jenkins-ssh
395
396     builders:
397       # force jenkins install of maven version before any shell scripts use it
398       - maven-target:
399           maven-version: mvn35
400           goals: '-version'
401           settings: autorelease-settings
402           settings-type: cfp
403           global-settings: global-settings
404           global-settings-type: cfp
405       - autorelease-cfp
406       - shell: !include-raw-escape:
407           - ../global-jjb/shell/lftools-install.sh
408           - version-bump.sh
409
410     publishers:
411       - lf-infra-publish
412
413 - job-template:
414     name: 'autorelease-generate-release-notes-{stream}'
415
416     ######################
417     # Default parameters #
418     ######################
419
420     gerrit_merge_triggers:
421       - comment-added-contains-event:
422           comment-contains-value: generate-release-notes .+$
423
424     #####################
425     # Job Configuration #
426     #####################
427
428     project-type: freestyle
429     node: centos7-builder-2c-8g
430
431     properties:
432       - lf-infra-properties:
433           build-days-to-keep: 7
434
435     parameters:
436       - lf-infra-parameters:
437           project: '{project}'
438           branch: '{branch}'
439           stream: '{stream}'
440           lftools-version: '{lftools-version}'
441       - string:
442           name: RELEASE
443           description: Release to generate release notes for.
444
445     scm:
446       - lf-infra-gerrit-scm:
447           git-url: '$GIT_URL/$GERRIT_PROJECT'
448           branch: '$GERRIT_BRANCH'
449           refspec: '$GERRIT_REFSPEC'
450           jenkins-ssh-credential: opendaylight-jenkins-ssh
451           submodule-recursive: true
452           choosing-strategy: default
453
454     wrappers:
455       - lf-infra-wrappers:
456           build-timeout: 10
457           jenkins-ssh-credential: opendaylight-jenkins-ssh
458
459     triggers:
460       - gerrit:
461           server-name: '{gerrit-server-name}'
462           trigger-on: '{obj:gerrit_merge_triggers}'
463           projects:
464             - project-compare-type: ANT
465               project-pattern: '{project}'
466               branches:
467                 - branch-compare-type: ANT
468                   branch-pattern: '**/{branch}'
469
470     builders:
471       - autorelease-generate-release-notes
472
473     publishers:
474       - lf-infra-publish
475
476 - job-template:
477     name: '{project-name}-validate-autorelease-{stream}'
478
479     ############
480     # Defaults #
481     ############
482
483     java-version: openjdk8
484
485     #####################
486     # Job Configuration #
487     #####################
488
489     disabled: false
490     project-type: freestyle
491     # Note: This NEEDS to be hardcoded as projects should NOT be allowed to
492     #       override the build node.
493     node: centos7-builder-2c-8g
494     concurrent: true
495     jdk: '{java-version}'
496
497     properties:
498       - lf-infra-properties:
499           build-days-to-keep: 7
500
501     parameters:
502       - lf-infra-parameters:
503           project: '{project}'
504           stream: '{stream}'
505           branch: '{branch}'
506           lftools-version: '{lftools-version}'
507       - autorelease-release-tag:
508           release-tag: validate
509       - string:
510           name: CLONE_URL
511           default: '{git-url}/releng/autorelease'
512           description: "Autorelease clone URL"
513
514     scm:
515       - git:
516           url: '$CLONE_URL'
517           credentials-id: 'opendaylight-jenkins-ssh'
518           refspec: ''
519           branches:
520             - 'origin/{branch}'
521           skip-tag: true
522           submodule:
523             recursive: true
524             timeout: 60
525
526     wrappers:
527       - opendaylight-infra-wrappers:
528           build-timeout: '{build-timeout}'
529
530     triggers:
531       - gerrit-trigger-patch-submitted:
532           gerrit-server-name: '{gerrit-server-name}'
533           project: '{project}'
534           branch: '{branch}'
535           files: '**/*.xml'
536           forbidden-files: ''
537
538     builders:
539       - lf-infra-pre-build
540       - autorelease-checkout-gerrit-patch
541       - autorelease-compare-projects
542       - jacoco-nojava-workaround
543       - shell: "./scripts/list-project-dependencies.sh"
544       - autorelease-determine-merge-order
545       - autorelease-generate-release-patches
546       # In a perfect world projects should be releasing separately and we consume them
547       # via a project that pulls the release bits from each project from Nexus.
548       # Keep the patches compatible with that ideal, but apply an edit
549       # to enable building in a single maven reactor afterwards.
550       - autorelease-fix-relative-paths
551       - maven-target:
552           maven-version: mvn35
553           pom: validate-pom.xml
554           goals: |
555               clean install dependency:tree
556               -T1.5C
557               -Pq
558               {opendaylight-infra-mvn-opts}
559           java-opts:
560             - '-Xmx8g'
561           settings: autorelease-settings
562           settings-type: cfp
563           global-settings: global-settings
564           global-settings-type: cfp
565       - maven-target:
566           maven-version: mvn35
567           pom: pom.xml
568           goals: |
569               clean validate
570               -Pq
571               {opendaylight-infra-mvn-opts}
572           java-opts:
573             - '-Xmx8g -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
574           settings: autorelease-settings
575           settings-type: cfp
576           global-settings: global-settings
577           global-settings-type: cfp
578       - shell: |
579           mkdir -p archives/
580           cp *.log $_
581
582     publishers:
583       - email-notification:
584           email-recipients: '{email-recipients}'
585           email-prefix: '[autorelease] [{project-name}]'
586       - lf-infra-publish