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