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