Fix autorelease lf-maven-stage macro usage
[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           submodule-timeout: 10
42           choosing-strategy: default
43
44     wrappers:
45       - lf-infra-wrappers:
46           build-timeout: 10
47           jenkins-ssh-credential: opendaylight-jenkins-ssh
48
49     builders:
50       - shell: !include-raw-escape: branch-cut.sh
51
52     publishers:
53       - lf-infra-publish
54
55 - job-template:
56     name: 'autorelease-release-{stream}-{mvn-version}-{java-version}'
57
58     ######################
59     # Default parameters #
60     ######################
61
62     build-node: '{build-node}'
63     cron: 'H 0 * * *'
64     java-version: '{java-version}'
65     mvn-global-settings: global-settings
66     mvn-goals: clean deploy
67     mvn-opts: '-Xmx8g -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
68     mvn-params: ''
69     mvn-settings: autorelease-settings
70     mvn-version: mvn35
71     sign-artifacts: true
72     mvn-central: true
73     ossrh-profile-id: 6386ebbbf3a563
74     disable-job: 'false'
75
76     #####################
77     # Job Configuration #
78     #####################
79
80     project-type: freestyle
81     node: '{build-node}'
82     disabled: '{disable-job}'
83
84     properties:
85       - lf-infra-properties:
86           build-days-to-keep: 30
87
88     parameters:
89       - lf-infra-parameters:
90           project: '{project}'
91           stream: '{stream}'
92           branch: '{branch}'
93           lftools-version: '{lftools-version}'
94       - lf-infra-maven-parameters:
95           mvn-opts: '{mvn-opts}'
96           mvn-params: '{mvn-params}'
97           mvn-version: '{mvn-version}'
98       - distribution-karaf-version:
99           karaf-version: '{karaf-version}'
100       - autorelease-release-tag:
101           release-tag: '{stream}'
102       - string:
103           name: ARCHIVE_ARTIFACTS
104           default: '{archive-artifacts}'
105           description: Artifacts to archive to the logs server.
106       - string:
107           name: STAGING_PROFILE_ID
108           default: '{staging-profile-id}'
109           description: Nexus staging profile ID.
110
111     scm:
112       - git:
113           credentials-id: 'opendaylight-jenkins-ssh'
114           url: '$GIT_BASE'
115           refspec: '$GERRIT_REFSPEC'
116           branches:
117             - '$GERRIT_BRANCH'
118           choosing-strategy: default
119           skip-tag: true
120           submodule:
121             recursive: true
122             timeout: 60
123
124     wrappers:
125       - opendaylight-infra-wrappers:
126           build-timeout: '900'
127
128     triggers:
129       - timed: '{cron}'
130
131     builders:
132       - lf-infra-pre-build
133       # force jenkins install of maven version before any shell scripts use it
134       - lf-maven-install:
135           mvn-version: '{mvn-version}'
136       - wipe-local-maven-repo
137       - lf-jacoco-nojava-workaround
138       - shell: "./scripts/list-project-dependencies.sh"
139       - autorelease-determine-merge-order
140       - lf-provide-maven-settings:
141           global-settings-file: '{mvn-global-settings}'
142           settings-file: '{mvn-settings}'
143       - autorelease-generate-release-patches
144       - autorelease-generate-artifact-versions
145       - lf-update-java-alternatives:
146           java-version: '{java-version}'
147       - autorelease-distribute-taglist
148       - distribute-build-url:
149           path: 'integration/distribution/$KARAF_ARTIFACT/src/main/assembly'
150       # In a perfect world projects should be releasing separately and we consume them
151       # via a project that pulls the release bits from each project from Nexus.
152       # Keep the patches compatible with that ideal, but apply an edit
153       # to enable building in a single maven reactor afterwards.
154       - autorelease-fix-relative-paths
155       - lf-maven-build:
156           mvn-goals: '{mvn-goals}'
157       - lf-sigul-sign-dir:
158           sign-artifacts: '{sign-artifacts}'
159           sign-dir: '$WORKSPACE/m2repo'
160           sign-mode: serial
161       - lf-maven-stage:
162           mvn-global-settings: '{mvn-global-settings}'
163           mvn-settings: '{mvn-settings}'
164           mvn-staging-id: '{mvn-staging-id}'
165       - lf-maven-central:
166           mvn-central: '{mvn-central}'
167           mvn-global-settings: '{mvn-global-settings}'
168           mvn-settings: '{mvn-settings}'
169           ossrh-profile-id: '{ossrh-profile-id}'
170       - autorelease-get-integration-test-variables
171       - autorelease-maven-sources:
172           opendaylight-infra-mvn-opts: '{opendaylight-infra-mvn-opts}'
173           maven-version: '{mvn-version}'
174           settings: '{mvn-settings}'
175           global-settings: '{mvn-global-settings}'
176       - shell: |
177           mkdir -p archives/
178           cp *.log *.prop $_
179
180     publishers:
181       - opendaylight-infra-notify-status
182       - trigger-parameterized-builds:
183           - project: 'integration-distribution-test-{integration-test}'
184             condition: UNSTABLE_OR_BETTER
185             property-file: variables.jenkins-trigger
186             fail-on-missing: true
187           - project: 'integration-distribution-test-{integration-test}'
188             condition: FAILED
189             trigger-with-no-params: true
190           - project: 'packaging-build-rpm-{stream}'
191             condition: UNSTABLE_OR_BETTER
192             predefined-parameters: DOWNLOAD_URL=$BUNDLE_URL
193             property-file: variables.jenkins-trigger
194             fail-on-missing: true
195           - project: 'packaging-build-deb-{stream}'
196             condition: UNSTABLE_OR_BETTER
197             predefined-parameters: DOWNLOAD_URL=$BUNDLE_URL
198             property-file: variables.jenkins-trigger
199             fail-on-missing: true
200       # Critical component of the OpenDaylight community
201       - postbuildscript:
202           builders:
203             - role: BOTH
204               build-on:
205                 - SUCCESS
206               build-steps:
207                 - shell: echo '#topic cookies'
208           mark-unstable-if-failed: false
209       - lf-infra-publish
210
211 - job-template:
212     name: 'autorelease-update-submodules-{stream}'
213
214     ######################
215     # Default parameters #
216     ######################
217
218     cron: 'H 0 * * *'
219     disable-job: 'false'
220
221     #####################
222     # Job configuration #
223     #####################
224
225     project-type: freestyle
226     node: centos7-builder-2c-2g
227     disabled: '{disable-job}'
228
229     properties:
230       - lf-infra-properties:
231           build-days-to-keep: 7
232
233     parameters:
234       - lf-infra-parameters:
235           project: releng/autorelease
236           branch: '{branch}'
237           stream: '{stream}'
238           refspec: 'refs/heads/{branch}'
239           lftools-version: '{lftools-version}'
240
241     scm:
242       - lf-infra-gerrit-scm:
243           git-url: '$GIT_URL/$GERRIT_PROJECT'
244           branch: '{branch}'
245           refspec: 'refs/heads/{branch}'
246           jenkins-ssh-credential: opendaylight-jenkins-ssh
247           submodule-recursive: true
248           submodule-timeout: 10
249           choosing-strategy: default
250
251     wrappers:
252       - lf-infra-wrappers:
253           build-timeout: 10
254           jenkins-ssh-credential: opendaylight-jenkins-ssh
255
256     triggers:
257       - timed: '{obj:cron}'
258
259     builders:
260       - lf-infra-pre-build
261       # Fetch latest head of branch
262       - shell: |
263           git checkout $GERRIT_BRANCH
264           git submodule update --remote
265           git add .
266       - lf-infra-push-gerrit-patch:
267           project: '{project}'
268           gerrit-user: 'jenkins-$SILO'
269           gerrit-host: 'git.opendaylight.org'
270           gerrit-topic: 'autorelease-update-submodules'
271           gerrit-commit-message: 'Update submodules to latest HEAD of branch'
272           reviewers-email: ''
273
274     publishers:
275       - lf-infra-publish
276
277 - job-template:
278     name: autorelease-update-validate-jobs-{stream}
279
280     ######################
281     # Default parameters #
282     ######################
283
284     cron: '@weekly'
285     disable-job: 'false'
286
287     #####################
288     # Job configuration #
289     #####################
290
291     project-type: freestyle
292     node: centos7-builder-2c-1g
293     disabled: '{disable-job}'
294
295     properties:
296       - lf-infra-properties:
297           build-days-to-keep: 7
298
299     parameters:
300       - lf-infra-parameters:
301           project: releng/builder
302           branch: '{branch}'
303           stream: '{stream}'
304           lftools-version: '{lftools-version}'
305
306     scm:
307       - lf-infra-gerrit-scm:
308           git-url: '$GIT_URL/releng/builder'
309           branch: master
310           refspec: 'refs/heads/master'
311           jenkins-ssh-credential: opendaylight-jenkins-ssh
312           submodule-recursive: true
313           submodule-timeout: 10
314           choosing-strategy: default
315
316     triggers:
317       - timed: '{cron}'
318       - gerrit:
319           server-name: '{gerrit-server-name}'
320           trigger-on:
321             - change-merged-event
322             - comment-added-contains-event:
323                 comment-contains-value: remerge$
324           projects:
325             - project-compare-type: ANT
326               project-pattern: '{project}'
327               branches:
328                 - branch-compare-type: ANT
329                   branch-pattern: '**/{branch}'
330               file-paths:
331                 - compare-type: ANT
332                   pattern: pom.xml
333
334     wrappers:
335       - lf-infra-wrappers:
336           build-timeout: 10
337           jenkins-ssh-credential: opendaylight-jenkins-ssh
338
339     builders:
340       - lf-infra-pre-build
341       - autorelease-update-project-views
342       - autorelease-update-validate-projects
343       - lf-infra-push-gerrit-patch:
344           project: '{project}'
345           gerrit-user: 'jenkins-$SILO'
346           gerrit-host: 'git.opendaylight.org'
347           gerrit-topic: 'autorelease-update-validate-jobs-{stream}'
348           gerrit-commit-message: |
349               'Update validate autorelease projects for {stream}'
350           reviewers-email: 'jenkins-releng@opendaylight.org'
351
352     publishers:
353       - lf-infra-publish
354
355 - job-template:
356     name: autorelease-version-bump-{stream}
357
358     #####################
359     # Default variables #
360     #####################
361
362     mvn-global-settings: global-settings
363     mvn-settings: autorelease-settings
364     mvn-version: mvn35
365     disable-job: 'false'
366
367     #####################
368     # Job configuration #
369     #####################
370
371     project-type: freestyle
372     node: '{build-node}'
373     disabled: '{disable-job}'
374
375     properties:
376       - opendaylight-infra-properties:
377           build-days-to-keep: 7
378
379     parameters:
380       - lf-infra-parameters:
381           project: releng/autorelease
382           branch: '{branch}'
383           stream: '{stream}'
384           refspec: 'refs/heads/{branch}'
385           lftools-version: '{lftools-version}'
386       - string:
387           name: RELEASE_TAG
388           default: '{stream}'
389           description: |
390               Release that is being version bumped.
391               Eg. Lithium, Beryllium, Boron, Carbon, Carbon-SR1, Carbon-SR2...
392       - bool:
393           name: BRANCH_CUT
394           default: false
395           description: |
396               If BRANCH_CUT is enabled, perform version bump for branch cutting
397               workflow, else perform version bump for simultaneous release
398               workflow (detault).
399       - bool:
400           name: DRY_RUN
401           default: true
402           description: |
403               If DRY_RUN is enabled modifications are not published to Gerrit
404               and artifacts are not pushed to Nexus. Instead the build will be
405               performed using the goals "clean install".
406       - maven-exec:
407           maven-version: '{mvn-version}'
408
409     scm:
410       - lf-infra-gerrit-scm:
411           git-url: '$GIT_URL/$GERRIT_PROJECT'
412           branch: '{branch}'
413           refspec: 'refs/heads/{branch}'
414           jenkins-ssh-credential: opendaylight-jenkins-ssh
415           submodule-recursive: true
416           submodule-timeout: 10
417           choosing-strategy: default
418
419     wrappers:
420       - lf-infra-wrappers:
421           build-timeout: 480
422           jenkins-ssh-credential: opendaylight-jenkins-ssh
423
424     builders:
425       - lf-infra-pre-build
426       # force jenkins install of maven version before any shell scripts use it
427       - lf-maven-install:
428           mvn-version: '{mvn-version}'
429       - lf-provide-maven-settings:
430           global-settings-file: '{mvn-global-settings}'
431           settings-file: '{mvn-settings}'
432       - shell: !include-raw-escape:
433           - version-bump.sh
434
435     publishers:
436       - lf-infra-publish
437
438 - job-template:
439     name: 'autorelease-generate-release-notes-{stream}'
440
441     ######################
442     # Default parameters #
443     ######################
444     disable-job: 'false'
445
446     gerrit_merge_triggers:
447       - comment-added-contains-event:
448           comment-contains-value: generate-release-notes .+$
449
450     #####################
451     # Job Configuration #
452     #####################
453
454     project-type: freestyle
455     node: centos7-builder-2c-8g
456     disabled: '{disable-job}'
457
458     properties:
459       - lf-infra-properties:
460           build-days-to-keep: 7
461
462     parameters:
463       - lf-infra-parameters:
464           project: '{project}'
465           branch: '{branch}'
466           stream: '{stream}'
467           lftools-version: '{lftools-version}'
468       - string:
469           name: RELEASE
470           description: |
471               Release to generate release notes for.
472               Eg. Oxygen-SR1, Fluorine-SR2...
473     scm:
474       - lf-infra-gerrit-scm:
475           git-url: '$GIT_URL/$GERRIT_PROJECT'
476           branch: '$GERRIT_BRANCH'
477           refspec: '$GERRIT_REFSPEC'
478           jenkins-ssh-credential: opendaylight-jenkins-ssh
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 -XX:MaxPermSize=1024m -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