Run update-validate-jobs weekly
[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     # Defaults #
59     ############
60
61     build-node: '{build-node}'
62     java-version: openjdk8
63     mvn-version: mvn33
64     extra-mvn-opts: ''
65
66     #####################
67     # Job Configuration #
68     #####################
69
70     project-type: freestyle
71     node: '{build-node}'
72     jdk: '{java-version}'
73     cron: 'H 0 * * *'
74
75     properties:
76       - lf-infra-properties:
77           build-days-to-keep: 30
78
79     parameters:
80       - maven-exec:
81           maven-version: 'mvn33'
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: '{next-release-tag}'
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: 'mvn33'
150           pom: 'pom.xml'
151           goals: |
152               clean deploy
153               $EXTRA_MVN_OPTS
154               -Pintegrationtests,docs,repoBuild
155               -Dcheckstyle.skip=true
156               -Dkaraf.keep.unpack=true
157               -DaltDeploymentRepository=staging::default::file:hide/from/pom/files/stage
158               {opendaylight-infra-mvn-opts}
159           java-opts:
160             - '-Xmx8g -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
161           settings: 'autorelease-settings'
162           settings-type: cfp
163           global-settings: 'global-settings'
164           global-settings-type: cfp
165       - autorelease-maven-deploy
166       - autorelease-get-integration-test-variables
167       - autorelease-maven-sources:
168           opendaylight-infra-mvn-opts: '{opendaylight-infra-mvn-opts}'
169           maven-version: 'mvn33'
170           settings: 'autorelease-settings'
171           global-settings: 'global-settings'
172       - autorelease-maven-sources-post-process
173       - shell: |
174           mkdir -p archives/
175           cp *.log *.prop $_
176           for file in $(find . -name karaf.log); do
177               module="${{file%%/target/*}}"
178               module="${{module##*/}}"
179               cp "$file" "archives/${{module}}-karaf.log"
180           done
181
182     publishers:
183       - opendaylight-infra-notify-status
184       - trigger-parameterized-builds:
185           - project: 'integration-distribution-test-{integration-test}'
186             condition: UNSTABLE_OR_BETTER
187             property-file: variables.jenkins-trigger
188             fail-on-missing: true
189           - project: 'integration-distribution-test-{integration-test}'
190             condition: FAILED
191             trigger-with-no-params: true
192           - project: 'integration-sanity-test-{integration-test}'
193             condition: UNSTABLE_OR_BETTER
194             property-file: variables.jenkins-trigger
195             fail-on-missing: true
196           - project: 'integration-sanity-test-{integration-test}'
197             condition: FAILED
198             trigger-with-no-params: true
199           - project: 'packaging-build-rpm-{stream}'
200             condition: UNSTABLE_OR_BETTER
201             predefined-parameters: DOWNLOAD_URL=$BUNDLE_URL
202             property-file: variables.jenkins-trigger
203             fail-on-missing: true
204           - project: 'packaging-build-deb-{stream}'
205             condition: UNSTABLE_OR_BETTER
206             predefined-parameters: DOWNLOAD_URL=$BUNDLE_URL
207             property-file: variables.jenkins-trigger
208             fail-on-missing: true
209       - lf-infra-publish
210
211 - job-template:
212     name: autorelease-update-validate-jobs-{stream}
213
214     ######################
215     # Default parameters #
216     ######################
217
218     cron: '@weekly'
219
220     #####################
221     # Job configuration #
222     #####################
223
224     project-type: freestyle
225     node: centos7-builder-2c-1g
226
227     properties:
228       - lf-infra-properties:
229           build-days-to-keep: 7
230
231     parameters:
232       - lf-infra-parameters:
233           project: releng/builder
234           branch: '{branch}'
235           stream: '{stream}'
236           lftools-version: '{lftools-version}'
237
238     scm:
239       - lf-infra-gerrit-scm:
240           git-url: '$GIT_URL/releng/builder'
241           branch: master
242           refspec: 'refs/heads/master'
243           jenkins-ssh-credential: opendaylight-jenkins-ssh
244           submodule-recursive: true
245           choosing-strategy: default
246
247     triggers:
248       - timed: '{cron}'
249       - gerrit:
250           server-name: '{gerrit-server-name}'
251           trigger-on:
252             - change-merged-event
253             - comment-added-contains-event:
254                 comment-contains-value: remerge$
255           projects:
256             - project-compare-type: ANT
257               project-pattern: '{project}'
258               branches:
259                 - branch-compare-type: ANT
260                   branch-pattern: '**/{branch}'
261               file-paths:
262                 - compare-type: ANT
263                   pattern: pom.xml
264
265     wrappers:
266       - lf-infra-wrappers:
267           build-timeout: 10
268           jenkins-ssh-credential: opendaylight-jenkins-ssh
269
270     builders:
271       - autorelease-update-validate-projects
272       - opendaylight-infra-push-gerrit-patch:
273           project: 'releng/builder'
274           gerrit-topic: 'autorelease-update-validate-jobs-{stream}'
275           gerrit-commit-message: |
276               Update validate autorelease projects for {stream}
277
278     publishers:
279       - lf-infra-publish
280
281 - job-template:
282     name: autorelease-version-bump-{stream}
283     project-type: freestyle
284     node: '{build-node}'
285
286     properties:
287       - opendaylight-infra-properties:
288           build-days-to-keep: 7
289
290     parameters:
291       - lf-infra-parameters:
292           project: releng/autorelease
293           branch: '{branch}'
294           stream: '{stream}'
295           refspec: 'refs/heads/{branch}'
296           lftools-version: '{lftools-version}'
297       - string:
298           name: RELEASE_TAG
299           default: '{next-release-tag}'
300           description: |
301               Release that is being version bumped.
302               Eg. Lithium, Beryllium, Boron, Carbon, Carbon-SR1, Carbon-SR2...
303       - bool:
304           name: BRANCH_CUT
305           default: false
306           description: |
307               If BRANCH_CUT is enabled, perform version bump for branch cutting
308               workflow, else perform version bump for simultaneous release
309               workflow (detault).
310       - bool:
311           name: DRY_RUN
312           default: true
313           description: |
314               If DRY_RUN is enabled modifications are not published to Gerrit
315               and artifacts are not pushed to Nexus. Instead the build will be
316               performed using the goals "clean install".
317       - maven-exec:
318           maven-version: mvn33
319
320     scm:
321       - lf-infra-gerrit-scm:
322           git-url: '$GIT_URL/$GERRIT_PROJECT'
323           branch: '{branch}'
324           refspec: 'refs/heads/{branch}'
325           jenkins-ssh-credential: opendaylight-jenkins-ssh
326           submodule-recursive: true
327           choosing-strategy: default
328
329     wrappers:
330       - lf-infra-wrappers:
331           build-timeout: 480
332           jenkins-ssh-credential: opendaylight-jenkins-ssh
333
334     builders:
335       # force jenkins install of maven version before any shell scripts use it
336       - maven-target:
337           maven-version: mvn33
338           goals: '-version'
339           settings: autorelease-settings
340           settings-type: cfp
341           global-settings: global-settings
342           global-settings-type: cfp
343       - autorelease-cfp
344       - shell: !include-raw-escape:
345           - ../global-jjb/shell/lftools-install.sh
346           - version-bump.sh
347
348     publishers:
349       - lf-infra-publish
350
351 - job-template:
352     name: 'autorelease-generate-release-notes-{stream}'
353
354     ######################
355     # Default parameters #
356     ######################
357
358     gerrit_merge_triggers:
359       - comment-added-contains-event:
360           comment-contains-value: generate-release-notes .+$
361
362     #####################
363     # Job Configuration #
364     #####################
365
366     project-type: freestyle
367     node: centos7-builder-2c-8g
368
369     properties:
370       - lf-infra-properties:
371           build-days-to-keep: 7
372
373     parameters:
374       - lf-infra-parameters:
375           project: '{project}'
376           branch: '{branch}'
377           stream: '{stream}'
378           lftools-version: '{lftools-version}'
379       - string:
380           name: RELEASE
381           description: Release to generate release notes for.
382
383     scm:
384       - lf-infra-gerrit-scm:
385           git-url: '$GIT_URL/$GERRIT_PROJECT'
386           branch: '$GERRIT_BRANCH'
387           refspec: '$GERRIT_REFSPEC'
388           jenkins-ssh-credential: opendaylight-jenkins-ssh
389           submodule-recursive: true
390           choosing-strategy: default
391
392     wrappers:
393       - lf-infra-wrappers:
394           build-timeout: 10
395           jenkins-ssh-credential: opendaylight-jenkins-ssh
396
397     triggers:
398       - gerrit:
399           server-name: '{gerrit-server-name}'
400           trigger-on: '{obj:gerrit_merge_triggers}'
401           projects:
402             - project-compare-type: ANT
403               project-pattern: '{project}'
404               branches:
405                 - branch-compare-type: ANT
406                   branch-pattern: '**/{branch}'
407
408     builders:
409       - autorelease-generate-release-notes
410
411     publishers:
412       - lf-infra-publish
413
414 - job-template:
415     name: '{project-name}-validate-autorelease-{stream}'
416
417     ############
418     # Defaults #
419     ############
420
421     java-version: openjdk8
422
423     #####################
424     # Job Configuration #
425     #####################
426
427     disabled: false
428     project-type: freestyle
429     # Note: This NEEDS to be hardcoded as projects should NOT be allowed to
430     #       override the build node.
431     node: centos7-builder-2c-8g
432     concurrent: true
433     jdk: '{java-version}'
434
435     properties:
436       - lf-infra-properties:
437           build-days-to-keep: 7
438
439     parameters:
440       - lf-infra-parameters:
441           project: '{project}'
442           stream: '{stream}'
443           branch: '{branch}'
444           lftools-version: '{lftools-version}'
445       - autorelease-release-tag:
446           release-tag: validate
447       - string:
448           name: CLONE_URL
449           default: '{git-url}/releng/autorelease'
450           description: "Autorelease clone URL"
451
452     scm:
453       - git:
454           url: '$CLONE_URL'
455           credentials-id: 'opendaylight-jenkins-ssh'
456           refspec: ''
457           branches:
458             - 'origin/{branch}'
459           skip-tag: true
460           submodule:
461             recursive: true
462             timeout: 60
463
464     wrappers:
465       - opendaylight-infra-wrappers:
466           build-timeout: '{build-timeout}'
467
468     triggers:
469       - gerrit-trigger-patch-submitted:
470           gerrit-server-name: '{gerrit-server-name}'
471           project: '{project}'
472           branch: '{branch}'
473           files: '**/*.xml'
474
475     builders:
476       - autorelease-checkout-gerrit-patch
477       - autorelease-compare-projects
478       - jacoco-nojava-workaround
479       - shell: "./scripts/list-project-dependencies.sh"
480       - autorelease-determine-merge-order
481       - autorelease-generate-release-patches
482       # In a perfect world projects should be releasing separately and we consume them
483       # via a project that pulls the release bits from each project from Nexus.
484       # Keep the patches compatible with that ideal, but apply an edit
485       # to enable building in a single maven reactor afterwards.
486       - autorelease-fix-relative-paths
487       - maven-target:
488           maven-version: mvn33
489           pom: validate-pom.xml
490           goals: |
491               clean install dependency:tree
492               -T1.5C
493               -Pq
494               {opendaylight-infra-mvn-opts}
495           java-opts:
496             - '-Xmx8g'
497           settings: autorelease-settings
498           settings-type: cfp
499           global-settings: global-settings
500           global-settings-type: cfp
501       # Hack to workaround the duplicate-finder plugin in odlparent breaking validate-autorelease
502       - shell: sed -i 's/validate/none/' /tmp/r/org/opendaylight/odlparent/odlparent/3.0.2/odlparent-3.0.2.pom || true
503       - maven-target:
504           maven-version: mvn33
505           pom: pom.xml
506           goals: |
507               clean validate
508               -Pq
509               -Dkaraf.keep.unpack=true
510               {opendaylight-infra-mvn-opts}
511           java-opts:
512             - '-Xmx8g -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
513           settings: autorelease-settings
514           settings-type: cfp
515           global-settings: global-settings
516           global-settings-type: cfp
517       - shell: |
518           mkdir -p archives/
519           cp *.log $_
520           for file in $(find . -name karaf.log); do
521               module="${{file%%/target/*}}"
522               module="${{module##*/}}"
523               cp "$file" "archives/${{module}}-karaf.log"
524           done
525
526     publishers:
527       - email-notification:
528           email-recipients: '{email-recipients}'
529           email-prefix: '[autorelease] [{project-name}]'
530       - lf-infra-publish