66caa8b625aa30a392cc2fa76bed98f9c86e7e0d
[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: "Update validate-ar jobs for {stream}"
345           reviewers-email: "jenkins-releng@opendaylight.org"
346
347     publishers:
348       - lf-infra-publish
349
350 - job-template:
351     name: autorelease-version-bump-{stream}-{mvn-version}-{java-version}
352
353     #####################
354     # Default variables #
355     #####################
356
357     mvn-global-settings: global-settings
358     mvn-settings: autorelease-settings
359     mvn-version: mvn35
360     disable-job: "false"
361
362     #####################
363     # Job configuration #
364     #####################
365
366     project-type: freestyle
367     node: "{build-node}"
368     disabled: "{disable-job}"
369
370     properties:
371       - opendaylight-infra-properties:
372           build-days-to-keep: 7
373
374     parameters:
375       - lf-infra-parameters:
376           project: releng/autorelease
377           branch: "{branch}"
378           stream: "{stream}"
379           refspec: "refs/heads/{branch}"
380           lftools-version: "{lftools-version}"
381       - string:
382           name: RELEASE_TAG
383           default: "{stream}"
384           description: |
385             Release that is being version bumped.
386             Eg. Lithium, Beryllium, Boron, Carbon, Carbon-SR1, Carbon-SR2...
387       - bool:
388           name: BRANCH_CUT
389           default: false
390           description: |
391             If BRANCH_CUT is enabled, perform version bump for branch cutting
392             workflow, else perform version bump for simultaneous release
393             workflow (detault).
394       - bool:
395           name: DRY_RUN
396           default: true
397           description: |
398             If DRY_RUN is enabled modifications are not published to Gerrit
399             and artifacts are not pushed to Nexus. Instead the build will be
400             performed using the goals "clean install".
401       - maven-exec:
402           maven-version: "{mvn-version}"
403
404     scm:
405       - lf-infra-gerrit-scm:
406           git-url: "$GIT_URL/$GERRIT_PROJECT"
407           branch: "{branch}"
408           refspec: "refs/heads/{branch}"
409           jenkins-ssh-credential: opendaylight-jenkins-ssh
410           submodule-disable: false
411           submodule-recursive: true
412           submodule-timeout: 10
413           choosing-strategy: default
414
415     wrappers:
416       - lf-infra-wrappers:
417           build-timeout: 480
418           jenkins-ssh-credential: opendaylight-jenkins-ssh
419
420     builders:
421       - lf-infra-pre-build
422       # force jenkins install of maven version before any shell scripts use it
423       - lf-update-java-alternatives:
424           java-version: "{java-version}"
425       - lf-maven-install:
426           mvn-version: "{mvn-version}"
427       - lf-provide-maven-settings:
428           global-settings-file: "{mvn-global-settings}"
429           settings-file: "{mvn-settings}"
430       - shell: !include-raw-escape:
431           - version-bump.sh
432
433     publishers:
434       - lf-infra-publish
435
436 - job-template:
437     name: "autorelease-generate-release-notes-{stream}"
438
439     ######################
440     # Default parameters #
441     ######################
442     disable-job: "false"
443
444     gerrit_merge_triggers:
445       - comment-added-contains-event:
446           comment-contains-value: generate-release-notes .+$
447
448     #####################
449     # Job Configuration #
450     #####################
451
452     project-type: freestyle
453     node: centos7-builder-2c-8g
454     disabled: "{disable-job}"
455
456     properties:
457       - lf-infra-properties:
458           build-days-to-keep: 7
459
460     parameters:
461       - lf-infra-parameters:
462           project: "{project}"
463           branch: "{branch}"
464           stream: "{stream}"
465           lftools-version: "{lftools-version}"
466       - string:
467           name: RELEASE
468           description: |
469             Release to generate release notes for.
470             Eg. Sodium-SR1, Magnesium-SR2...
471     scm:
472       - lf-infra-gerrit-scm:
473           git-url: "$GIT_URL/$GERRIT_PROJECT"
474           branch: "$GERRIT_BRANCH"
475           refspec: "$GERRIT_REFSPEC"
476           jenkins-ssh-credential: opendaylight-jenkins-ssh
477           submodule-disable: false
478           submodule-recursive: true
479           submodule-timeout: 10
480           choosing-strategy: default
481
482     wrappers:
483       - lf-infra-wrappers:
484           build-timeout: 10
485           jenkins-ssh-credential: opendaylight-jenkins-ssh
486
487     triggers:
488       - gerrit:
489           server-name: "{gerrit-server-name}"
490           trigger-on: "{obj:gerrit_merge_triggers}"
491           projects:
492             - project-compare-type: ANT
493               project-pattern: "{project}"
494               branches:
495                 - branch-compare-type: ANT
496                   branch-pattern: "**/{branch}"
497
498     builders:
499       - lf-infra-pre-build
500       - autorelease-generate-release-notes
501
502     publishers:
503       - lf-infra-publish
504
505 - job-template:
506     name: "{project-name}-validate-autorelease-{stream}"
507
508     #####################
509     # Default variables #
510     #####################
511
512     java-version: openjdk8
513     mvn-global-settings: global-settings
514     mvn-settings: autorelease-settings
515     mvn-version: mvn35
516     disable-job: "false"
517
518     #####################
519     # Job Configuration #
520     #####################
521
522     project-type: freestyle
523     # Note: This NEEDS to be hardcoded as projects should NOT be allowed to
524     #       override the build node.
525     node: centos7-builder-2c-8g
526     concurrent: true
527     jdk: "{java-version}"
528     disabled: "{disable-job}"
529
530     properties:
531       - lf-infra-properties:
532           build-days-to-keep: 7
533
534     parameters:
535       - lf-infra-parameters:
536           project: "{project}"
537           stream: "{stream}"
538           branch: "{branch}"
539           lftools-version: "{lftools-version}"
540       - autorelease-release-tag:
541           release-tag: validate
542       - string:
543           name: CLONE_URL
544           default: "{git-url}/releng/autorelease"
545           description: "Autorelease clone URL"
546
547     scm:
548       - git:
549           url: "$CLONE_URL"
550           credentials-id: "opendaylight-jenkins-ssh"
551           refspec: ""
552           branches:
553             - "origin/{branch}"
554           skip-tag: true
555           submodule:
556             recursive: true
557             timeout: 60
558
559     wrappers:
560       - opendaylight-infra-wrappers:
561           build-timeout: "{build-timeout}"
562
563     triggers:
564       - gerrit-trigger-patch-submitted:
565           gerrit-server-name: "{gerrit-server-name}"
566           project: "{project}"
567           branch: "{branch}"
568           files: "**/*.xml"
569           forbidden-files: ""
570
571     builders:
572       - lf-infra-pre-build
573       - lf-update-java-alternatives:
574           java-version: "{java-version}"
575       - autorelease-checkout-gerrit-patch
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