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