Migrate gerrit push change to generic builder
[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           choosing-strategy: default
42
43     wrappers:
44       - lf-infra-wrappers:
45           build-timeout: 10
46           jenkins-ssh-credential: opendaylight-jenkins-ssh
47
48     builders:
49       - shell: !include-raw-escape: branch-cut.sh
50
51     publishers:
52       - lf-infra-publish
53
54 - job-template:
55     name: 'autorelease-release-{stream}'
56
57     ######################
58     # Default parameters #
59     ######################
60
61     build-node: '{build-node}'
62     cron: 'H 0 * * *'
63     java-version: openjdk8
64     mvn-version: mvn35
65     extra-mvn-opts: ''
66
67     #####################
68     # Job Configuration #
69     #####################
70
71     project-type: freestyle
72     node: '{build-node}'
73     jdk: '{java-version}'
74
75     properties:
76       - lf-infra-properties:
77           build-days-to-keep: 30
78
79     parameters:
80       - maven-exec:
81           maven-version: 'mvn35'
82       - lf-infra-parameters:
83           project: '{project}'
84           stream: '{stream}'
85           branch: '{branch}'
86           lftools-version: '{lftools-version}'
87       - distribution-karaf-version:
88           karaf-version: '{karaf-version}'
89       - autorelease-release-tag:
90           release-tag: '{stream}'
91       - string:
92           name: EXTRA_MVN_OPTS
93           default: '{extra-mvn-opts}'
94           description: |
95               Additional optional Maven Options to pass to the Maven Goals
96               parameter.
97
98               Examples:
99               -Dskip.karaf.featureTest=true  # To disable karaf SingleFeatureTests
100               --fail-never   # NEVER fail the build, regardless of project result
101               --fail-at-end  # Only fail the build afterwards; allow all non-impacted builds to continue
102       - string:
103           name: ARCHIVE_ARTIFACTS
104           default: '{archive-artifacts}'
105           description: Artifacts to archive to the logs server.
106
107     scm:
108       - git:
109           credentials-id: 'opendaylight-jenkins-ssh'
110           url: '$GIT_BASE'
111           refspec: '$GERRIT_REFSPEC'
112           branches:
113             - '$GERRIT_BRANCH'
114           choosing-strategy: default
115           skip-tag: true
116           submodule:
117             recursive: true
118             timeout: 60
119
120     wrappers:
121       - opendaylight-infra-wrappers:
122           build-timeout: '900'
123
124     triggers:
125       - timed: '{cron}'
126
127     builders:
128       # force jenkins install of maven version before any shell scripts use it
129       - lf-maven-install:
130           mvn-version: '{mvn-version}'
131       - wipe-local-maven-repo
132       - jacoco-nojava-workaround
133       - shell: "./scripts/list-project-dependencies.sh"
134       - autorelease-determine-merge-order
135       - autorelease-cfp:
136           autorelease-settings: 'autorelease-settings'
137           global-settings: 'odl-global-settings'
138       - autorelease-generate-release-patches
139       - autorelease-generate-artifact-versions
140       - autorelease-distribute-taglist
141       - distribute-build-url:
142           path: 'integration/distribution/$KARAF_ARTIFACT/src/main/assembly'
143       # In a perfect world projects should be releasing separately and we consume them
144       # via a project that pulls the release bits from each project from Nexus.
145       # Keep the patches compatible with that ideal, but apply an edit
146       # to enable building in a single maven reactor afterwards.
147       - autorelease-fix-relative-paths
148       - maven-target:
149           maven-version: 'mvn35'
150           pom: 'pom.xml'
151           goals: |
152               clean deploy
153               $EXTRA_MVN_OPTS
154               -Pintegrationtests,docs,repoBuild
155               -Dcheckstyle.skip=true
156               -DaltDeploymentRepository=staging::default::file:hide/from/pom/files/stage
157               {opendaylight-infra-mvn-opts}
158           java-opts:
159             - '-Xmx8g -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
160           settings: 'autorelease-settings'
161           settings-type: cfp
162           global-settings: 'global-settings'
163           global-settings-type: cfp
164       - autorelease-maven-deploy
165       - autorelease-get-integration-test-variables
166       - autorelease-maven-sources:
167           opendaylight-infra-mvn-opts: '{opendaylight-infra-mvn-opts}'
168           maven-version: 'mvn35'
169           settings: 'autorelease-settings'
170           global-settings: 'global-settings'
171       - autorelease-maven-sources-post-process
172       - shell: |
173           mkdir -p archives/
174           cp *.log *.prop $_
175
176     publishers:
177       - opendaylight-infra-notify-status
178       - trigger-parameterized-builds:
179           - project: 'integration-distribution-test-{integration-test}'
180             condition: UNSTABLE_OR_BETTER
181             property-file: variables.jenkins-trigger
182             fail-on-missing: true
183           - project: 'integration-distribution-test-{integration-test}'
184             condition: FAILED
185             trigger-with-no-params: true
186           - project: 'integration-sanity-test-{integration-test}'
187             condition: UNSTABLE_OR_BETTER
188             property-file: variables.jenkins-trigger
189             fail-on-missing: true
190           - project: 'integration-sanity-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-validate-jobs-{stream}
216
217     ######################
218     # Default parameters #
219     ######################
220
221     cron: '@weekly'
222
223     #####################
224     # Job configuration #
225     #####################
226
227     project-type: freestyle
228     node: centos7-builder-2c-1g
229
230     properties:
231       - lf-infra-properties:
232           build-days-to-keep: 7
233
234     parameters:
235       - lf-infra-parameters:
236           project: releng/builder
237           branch: '{branch}'
238           stream: '{stream}'
239           lftools-version: '{lftools-version}'
240
241     scm:
242       - lf-infra-gerrit-scm:
243           git-url: '$GIT_URL/releng/builder'
244           branch: master
245           refspec: 'refs/heads/master'
246           jenkins-ssh-credential: opendaylight-jenkins-ssh
247           submodule-recursive: true
248           choosing-strategy: default
249
250     triggers:
251       - timed: '{cron}'
252       - gerrit:
253           server-name: '{gerrit-server-name}'
254           trigger-on:
255             - change-merged-event
256             - comment-added-contains-event:
257                 comment-contains-value: remerge$
258           projects:
259             - project-compare-type: ANT
260               project-pattern: '{project}'
261               branches:
262                 - branch-compare-type: ANT
263                   branch-pattern: '**/{branch}'
264               file-paths:
265                 - compare-type: ANT
266                   pattern: pom.xml
267
268     wrappers:
269       - lf-infra-wrappers:
270           build-timeout: 10
271           jenkins-ssh-credential: opendaylight-jenkins-ssh
272
273     builders:
274       - autorelease-update-project-views
275       - autorelease-update-validate-projects
276       - lf-infra-push-gerrit-patch:
277           project: '{project}'
278           gerrit-user: 'jenkins-$SILO'
279           gerrit-host: 'git.opendaylight.org'
280           gerrit-topic: 'autorelease-update-validate-jobs-{stream}'
281           gerrit-commit-message: |
282               'Update validate autorelease projects for {stream}'
283           reviewers-email: 'release@lists.opendaylight.org'
284
285     publishers:
286       - lf-infra-publish
287
288 - job-template:
289     name: autorelease-version-bump-{stream}
290     project-type: freestyle
291     node: '{build-node}'
292
293     properties:
294       - opendaylight-infra-properties:
295           build-days-to-keep: 7
296
297     parameters:
298       - lf-infra-parameters:
299           project: releng/autorelease
300           branch: '{branch}'
301           stream: '{stream}'
302           refspec: 'refs/heads/{branch}'
303           lftools-version: '{lftools-version}'
304       - string:
305           name: RELEASE_TAG
306           default: '{stream}'
307           description: |
308               Release that is being version bumped.
309               Eg. Lithium, Beryllium, Boron, Carbon, Carbon-SR1, Carbon-SR2...
310       - bool:
311           name: BRANCH_CUT
312           default: false
313           description: |
314               If BRANCH_CUT is enabled, perform version bump for branch cutting
315               workflow, else perform version bump for simultaneous release
316               workflow (detault).
317       - bool:
318           name: DRY_RUN
319           default: true
320           description: |
321               If DRY_RUN is enabled modifications are not published to Gerrit
322               and artifacts are not pushed to Nexus. Instead the build will be
323               performed using the goals "clean install".
324       - maven-exec:
325           maven-version: mvn35
326
327     scm:
328       - lf-infra-gerrit-scm:
329           git-url: '$GIT_URL/$GERRIT_PROJECT'
330           branch: '{branch}'
331           refspec: 'refs/heads/{branch}'
332           jenkins-ssh-credential: opendaylight-jenkins-ssh
333           submodule-recursive: true
334           choosing-strategy: default
335
336     wrappers:
337       - lf-infra-wrappers:
338           build-timeout: 480
339           jenkins-ssh-credential: opendaylight-jenkins-ssh
340
341     builders:
342       # force jenkins install of maven version before any shell scripts use it
343       - maven-target:
344           maven-version: mvn35
345           goals: '-version'
346           settings: autorelease-settings
347           settings-type: cfp
348           global-settings: global-settings
349           global-settings-type: cfp
350       - autorelease-cfp
351       - shell: !include-raw-escape:
352           - ../global-jjb/shell/lftools-install.sh
353           - version-bump.sh
354
355     publishers:
356       - lf-infra-publish
357
358 - job-template:
359     name: 'autorelease-generate-release-notes-{stream}'
360
361     ######################
362     # Default parameters #
363     ######################
364
365     gerrit_merge_triggers:
366       - comment-added-contains-event:
367           comment-contains-value: generate-release-notes .+$
368
369     #####################
370     # Job Configuration #
371     #####################
372
373     project-type: freestyle
374     node: centos7-builder-2c-8g
375
376     properties:
377       - lf-infra-properties:
378           build-days-to-keep: 7
379
380     parameters:
381       - lf-infra-parameters:
382           project: '{project}'
383           branch: '{branch}'
384           stream: '{stream}'
385           lftools-version: '{lftools-version}'
386       - string:
387           name: RELEASE
388           description: Release to generate release notes for.
389
390     scm:
391       - lf-infra-gerrit-scm:
392           git-url: '$GIT_URL/$GERRIT_PROJECT'
393           branch: '$GERRIT_BRANCH'
394           refspec: '$GERRIT_REFSPEC'
395           jenkins-ssh-credential: opendaylight-jenkins-ssh
396           submodule-recursive: true
397           choosing-strategy: default
398
399     wrappers:
400       - lf-infra-wrappers:
401           build-timeout: 10
402           jenkins-ssh-credential: opendaylight-jenkins-ssh
403
404     triggers:
405       - gerrit:
406           server-name: '{gerrit-server-name}'
407           trigger-on: '{obj:gerrit_merge_triggers}'
408           projects:
409             - project-compare-type: ANT
410               project-pattern: '{project}'
411               branches:
412                 - branch-compare-type: ANT
413                   branch-pattern: '**/{branch}'
414
415     builders:
416       - autorelease-generate-release-notes
417
418     publishers:
419       - lf-infra-publish
420
421 - job-template:
422     name: '{project-name}-validate-autorelease-{stream}'
423
424     ############
425     # Defaults #
426     ############
427
428     java-version: openjdk8
429
430     #####################
431     # Job Configuration #
432     #####################
433
434     disabled: false
435     project-type: freestyle
436     # Note: This NEEDS to be hardcoded as projects should NOT be allowed to
437     #       override the build node.
438     node: centos7-builder-2c-8g
439     concurrent: true
440     jdk: '{java-version}'
441
442     properties:
443       - lf-infra-properties:
444           build-days-to-keep: 7
445
446     parameters:
447       - lf-infra-parameters:
448           project: '{project}'
449           stream: '{stream}'
450           branch: '{branch}'
451           lftools-version: '{lftools-version}'
452       - autorelease-release-tag:
453           release-tag: validate
454       - string:
455           name: CLONE_URL
456           default: '{git-url}/releng/autorelease'
457           description: "Autorelease clone URL"
458
459     scm:
460       - git:
461           url: '$CLONE_URL'
462           credentials-id: 'opendaylight-jenkins-ssh'
463           refspec: ''
464           branches:
465             - 'origin/{branch}'
466           skip-tag: true
467           submodule:
468             recursive: true
469             timeout: 60
470
471     wrappers:
472       - opendaylight-infra-wrappers:
473           build-timeout: '{build-timeout}'
474
475     triggers:
476       - gerrit-trigger-patch-submitted:
477           gerrit-server-name: '{gerrit-server-name}'
478           project: '{project}'
479           branch: '{branch}'
480           files: '**/*.xml'
481
482     builders:
483       - autorelease-checkout-gerrit-patch
484       - autorelease-compare-projects
485       - jacoco-nojava-workaround
486       - shell: "./scripts/list-project-dependencies.sh"
487       - autorelease-determine-merge-order
488       - autorelease-generate-release-patches
489       # In a perfect world projects should be releasing separately and we consume them
490       # via a project that pulls the release bits from each project from Nexus.
491       # Keep the patches compatible with that ideal, but apply an edit
492       # to enable building in a single maven reactor afterwards.
493       - autorelease-fix-relative-paths
494       - maven-target:
495           maven-version: mvn35
496           pom: validate-pom.xml
497           goals: |
498               clean install dependency:tree
499               -T1.5C
500               -Pq
501               {opendaylight-infra-mvn-opts}
502           java-opts:
503             - '-Xmx8g'
504           settings: autorelease-settings
505           settings-type: cfp
506           global-settings: global-settings
507           global-settings-type: cfp
508       # Hack to workaround the duplicate-finder plugin in odlparent breaking validate-autorelease
509       - shell: sed -i 's/validate/none/' /tmp/r/org/opendaylight/odlparent/odlparent/3.0.2/odlparent-3.0.2.pom || true
510       - maven-target:
511           maven-version: mvn35
512           pom: pom.xml
513           goals: |
514               clean validate
515               -Pq
516               {opendaylight-infra-mvn-opts}
517           java-opts:
518             - '-Xmx8g -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
519           settings: autorelease-settings
520           settings-type: cfp
521           global-settings: global-settings
522           global-settings-type: cfp
523       - shell: |
524           mkdir -p archives/
525           cp *.log $_
526
527     publishers:
528       - email-notification:
529           email-recipients: '{email-recipients}'
530           email-prefix: '[autorelease] [{project-name}]'
531       - lf-infra-publish