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