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