Cleanup staging repo credentials from .netrc
[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}'
57
58     ######################
59     # Default parameters #
60     ######################
61
62     build-node: '{build-node}'
63     cron: 'H 0 * * *'
64     java-version: openjdk8
65     mvn-global-settings: global-settings
66     mvn-settings: autorelease-settings
67     mvn-version: mvn35
68     extra-mvn-opts: ''
69
70     #####################
71     # Job Configuration #
72     #####################
73
74     project-type: freestyle
75     node: '{build-node}'
76     jdk: '{java-version}'
77
78     properties:
79       - lf-infra-properties:
80           build-days-to-keep: 30
81
82     parameters:
83       - maven-exec:
84           maven-version: '{mvn-version}'
85       - lf-infra-parameters:
86           project: '{project}'
87           stream: '{stream}'
88           branch: '{branch}'
89           lftools-version: '{lftools-version}'
90       - distribution-karaf-version:
91           karaf-version: '{karaf-version}'
92       - autorelease-release-tag:
93           release-tag: '{stream}'
94       - string:
95           name: EXTRA_MVN_OPTS
96           default: '{extra-mvn-opts}'
97           description: |
98               Additional optional Maven Options to pass to the Maven Goals
99               parameter.
100
101               Examples:
102               -Dskip.karaf.featureTest=true  # To disable karaf SingleFeatureTests
103               --fail-never   # NEVER fail the build, regardless of project result
104               --fail-at-end  # Only fail the build afterwards; allow all non-impacted builds to continue
105       - string:
106           name: ARCHIVE_ARTIFACTS
107           default: '{archive-artifacts}'
108           description: Artifacts to archive to the logs server.
109       - string:
110           name: STAGING_PROFILE_ID
111           default: '{staging-profile-id}'
112           description: Nexus staging profile ID.
113
114     scm:
115       - git:
116           credentials-id: 'opendaylight-jenkins-ssh'
117           url: '$GIT_BASE'
118           refspec: '$GERRIT_REFSPEC'
119           branches:
120             - '$GERRIT_BRANCH'
121           choosing-strategy: default
122           skip-tag: true
123           submodule:
124             recursive: true
125             timeout: 60
126
127     wrappers:
128       - opendaylight-infra-wrappers:
129           build-timeout: '900'
130
131     triggers:
132       - timed: '{cron}'
133
134     builders:
135       - lf-infra-pre-build
136       # force jenkins install of maven version before any shell scripts use it
137       - lf-maven-install:
138           mvn-version: '{mvn-version}'
139       - wipe-local-maven-repo
140       - lf-jacoco-nojava-workaround
141       - shell: "./scripts/list-project-dependencies.sh"
142       - autorelease-determine-merge-order
143       - lf-provide-maven-settings:
144           global-settings-file: '{mvn-global-settings}'
145           settings-file: '{mvn-settings}'
146       - lf-infra-create-netrc:
147           server-id: '{mvn-staging-id}'
148       - autorelease-generate-release-patches
149       - autorelease-generate-artifact-versions
150       - autorelease-distribute-taglist
151       - distribute-build-url:
152           path: 'integration/distribution/$KARAF_ARTIFACT/src/main/assembly'
153       # In a perfect world projects should be releasing separately and we consume them
154       # via a project that pulls the release bits from each project from Nexus.
155       # Keep the patches compatible with that ideal, but apply an edit
156       # to enable building in a single maven reactor afterwards.
157       - autorelease-fix-relative-paths
158       - maven-target:
159           maven-version: '{mvn-version}'
160           pom: 'pom.xml'
161           goals: |
162               clean deploy
163               $EXTRA_MVN_OPTS
164               -Pintegrationtests,repoBuild
165               -Dcheckstyle.skip=true
166               -DaltDeploymentRepository=staging::default::file:"$WORKSPACE"/m2repo
167               {opendaylight-infra-mvn-opts}
168           java-opts:
169             - '-Xmx8g -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
170           settings: '{mvn-settings}'
171           settings-type: cfp
172           global-settings: '{mvn-global-settings}'
173           global-settings-type: cfp
174       - lf-maven-stage
175       - autorelease-get-integration-test-variables
176       - autorelease-maven-sources:
177           opendaylight-infra-mvn-opts: '{opendaylight-infra-mvn-opts}'
178           maven-version: '{mvn-version}'
179           settings: '{mvn-settings}'
180           global-settings: '{mvn-global-settings}'
181       - shell: |
182           mkdir -p archives/
183           cp *.log *.prop $_
184       - lf-provide-maven-settings-cleanup
185
186     publishers:
187       - opendaylight-infra-notify-status
188       - trigger-parameterized-builds:
189           - project: 'integration-distribution-test-{integration-test}'
190             condition: UNSTABLE_OR_BETTER
191             property-file: variables.jenkins-trigger
192             fail-on-missing: true
193           - project: 'integration-distribution-test-{integration-test}'
194             condition: FAILED
195             trigger-with-no-params: true
196           - project: 'packaging-build-rpm-{stream}'
197             condition: UNSTABLE_OR_BETTER
198             predefined-parameters: DOWNLOAD_URL=$BUNDLE_URL
199             property-file: variables.jenkins-trigger
200             fail-on-missing: true
201           - project: 'packaging-build-deb-{stream}'
202             condition: UNSTABLE_OR_BETTER
203             predefined-parameters: DOWNLOAD_URL=$BUNDLE_URL
204             property-file: variables.jenkins-trigger
205             fail-on-missing: true
206       # Critical component of the OpenDaylight community
207       - postbuildscript:
208           builders:
209             - role: BOTH
210               build-on:
211                 - SUCCESS
212               build-steps:
213                 - shell: echo '#topic cookies'
214           mark-unstable-if-failed: false
215       - lf-infra-publish
216
217 - job-template:
218     name: 'autorelease-update-submodules-{stream}'
219
220     ######################
221     # Default parameters #
222     ######################
223
224     cron: 'H 0 * * *'
225
226     #####################
227     # Job configuration #
228     #####################
229
230     project-type: freestyle
231     node: centos7-builder-2c-2g
232
233     properties:
234       - lf-infra-properties:
235           build-days-to-keep: 7
236
237     parameters:
238       - lf-infra-parameters:
239           project: releng/autorelease
240           branch: '{branch}'
241           stream: '{stream}'
242           refspec: 'refs/heads/{branch}'
243           lftools-version: '{lftools-version}'
244
245     scm:
246       - lf-infra-gerrit-scm:
247           git-url: '$GIT_URL/$GERRIT_PROJECT'
248           branch: '{branch}'
249           refspec: 'refs/heads/{branch}'
250           jenkins-ssh-credential: opendaylight-jenkins-ssh
251           submodule-recursive: true
252           submodule-timeout: 10
253           choosing-strategy: default
254
255     wrappers:
256       - lf-infra-wrappers:
257           build-timeout: 10
258           jenkins-ssh-credential: opendaylight-jenkins-ssh
259
260     triggers:
261       - timed: '{obj:cron}'
262
263     builders:
264       - lf-infra-pre-build
265       # Fetch latest head of branch
266       - shell: |
267           git checkout $GERRIT_BRANCH
268           git submodule update --remote
269           git add .
270       - lf-infra-push-gerrit-patch:
271           project: '{project}'
272           gerrit-user: 'jenkins-$SILO'
273           gerrit-host: 'git.opendaylight.org'
274           gerrit-topic: 'autorelease-update-submodules'
275           gerrit-commit-message: 'Update submodules to latest HEAD of branch'
276           reviewers-email: ''
277
278     publishers:
279       - lf-infra-publish
280
281 - job-template:
282     name: autorelease-update-validate-jobs-{stream}
283
284     ######################
285     # Default parameters #
286     ######################
287
288     cron: '@weekly'
289
290     #####################
291     # Job configuration #
292     #####################
293
294     project-type: freestyle
295     node: centos7-builder-2c-1g
296
297     properties:
298       - lf-infra-properties:
299           build-days-to-keep: 7
300
301     parameters:
302       - lf-infra-parameters:
303           project: releng/builder
304           branch: '{branch}'
305           stream: '{stream}'
306           lftools-version: '{lftools-version}'
307
308     scm:
309       - lf-infra-gerrit-scm:
310           git-url: '$GIT_URL/releng/builder'
311           branch: master
312           refspec: 'refs/heads/master'
313           jenkins-ssh-credential: opendaylight-jenkins-ssh
314           submodule-recursive: true
315           submodule-timeout: 10
316           choosing-strategy: default
317
318     triggers:
319       - timed: '{cron}'
320       - gerrit:
321           server-name: '{gerrit-server-name}'
322           trigger-on:
323             - change-merged-event
324             - comment-added-contains-event:
325                 comment-contains-value: remerge$
326           projects:
327             - project-compare-type: ANT
328               project-pattern: '{project}'
329               branches:
330                 - branch-compare-type: ANT
331                   branch-pattern: '**/{branch}'
332               file-paths:
333                 - compare-type: ANT
334                   pattern: pom.xml
335
336     wrappers:
337       - lf-infra-wrappers:
338           build-timeout: 10
339           jenkins-ssh-credential: opendaylight-jenkins-ssh
340
341     builders:
342       - lf-infra-pre-build
343       - autorelease-update-project-views
344       - autorelease-update-validate-projects
345       - lf-infra-push-gerrit-patch:
346           project: '{project}'
347           gerrit-user: 'jenkins-$SILO'
348           gerrit-host: 'git.opendaylight.org'
349           gerrit-topic: 'autorelease-update-validate-jobs-{stream}'
350           gerrit-commit-message: |
351               'Update validate autorelease projects for {stream}'
352           reviewers-email: 'jenkins-releng@opendaylight.org'
353
354     publishers:
355       - lf-infra-publish
356
357 - job-template:
358     name: autorelease-version-bump-{stream}
359
360     #####################
361     # Default variables #
362     #####################
363
364     mvn-global-settings: global-settings
365     mvn-settings: autorelease-settings
366     mvn-version: mvn35
367
368     #####################
369     # Job configuration #
370     #####################
371
372     project-type: freestyle
373     node: '{build-node}'
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
445     gerrit_merge_triggers:
446       - comment-added-contains-event:
447           comment-contains-value: generate-release-notes .+$
448
449     #####################
450     # Job Configuration #
451     #####################
452
453     project-type: freestyle
454     node: centos7-builder-2c-8g
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: Release to generate release notes for.
469
470     scm:
471       - lf-infra-gerrit-scm:
472           git-url: '$GIT_URL/$GERRIT_PROJECT'
473           branch: '$GERRIT_BRANCH'
474           refspec: '$GERRIT_REFSPEC'
475           jenkins-ssh-credential: opendaylight-jenkins-ssh
476           submodule-recursive: true
477           submodule-timeout: 10
478           choosing-strategy: default
479
480     wrappers:
481       - lf-infra-wrappers:
482           build-timeout: 10
483           jenkins-ssh-credential: opendaylight-jenkins-ssh
484
485     triggers:
486       - gerrit:
487           server-name: '{gerrit-server-name}'
488           trigger-on: '{obj:gerrit_merge_triggers}'
489           projects:
490             - project-compare-type: ANT
491               project-pattern: '{project}'
492               branches:
493                 - branch-compare-type: ANT
494                   branch-pattern: '**/{branch}'
495
496     builders:
497       - lf-infra-pre-build
498       - autorelease-generate-release-notes
499
500     publishers:
501       - lf-infra-publish
502
503 - job-template:
504     name: '{project-name}-validate-autorelease-{stream}'
505
506     #####################
507     # Default variables #
508     #####################
509
510     java-version: openjdk8
511     mvn-global-settings: global-settings
512     mvn-settings: autorelease-settings
513     mvn-version: mvn35
514
515     #####################
516     # Job Configuration #
517     #####################
518
519     disabled: false
520     project-type: freestyle
521     # Note: This NEEDS to be hardcoded as projects should NOT be allowed to
522     #       override the build node.
523     node: centos7-builder-2c-8g
524     concurrent: true
525     jdk: '{java-version}'
526
527     properties:
528       - lf-infra-properties:
529           build-days-to-keep: 7
530
531     parameters:
532       - lf-infra-parameters:
533           project: '{project}'
534           stream: '{stream}'
535           branch: '{branch}'
536           lftools-version: '{lftools-version}'
537       - autorelease-release-tag:
538           release-tag: validate
539       - string:
540           name: CLONE_URL
541           default: '{git-url}/releng/autorelease'
542           description: "Autorelease clone URL"
543
544     scm:
545       - git:
546           url: '$CLONE_URL'
547           credentials-id: 'opendaylight-jenkins-ssh'
548           refspec: ''
549           branches:
550             - 'origin/{branch}'
551           skip-tag: true
552           submodule:
553             recursive: true
554             timeout: 60
555
556     wrappers:
557       - opendaylight-infra-wrappers:
558           build-timeout: '{build-timeout}'
559
560     triggers:
561       - gerrit-trigger-patch-submitted:
562           gerrit-server-name: '{gerrit-server-name}'
563           project: '{project}'
564           branch: '{branch}'
565           files: '**/*.xml'
566           forbidden-files: ''
567
568     builders:
569       - lf-infra-pre-build
570       - autorelease-checkout-gerrit-patch
571       - autorelease-compare-projects
572       - lf-jacoco-nojava-workaround
573       - shell: "./scripts/list-project-dependencies.sh"
574       - autorelease-determine-merge-order
575       - autorelease-generate-release-patches
576       # In a perfect world projects should be releasing separately and we consume them
577       # via a project that pulls the release bits from each project from Nexus.
578       # Keep the patches compatible with that ideal, but apply an edit
579       # to enable building in a single maven reactor afterwards.
580       - autorelease-fix-relative-paths
581       - maven-target:
582           maven-version: '{mvn-version}'
583           pom: validate-pom.xml
584           goals: |
585               clean install dependency:tree
586               -T1.5C
587               -Pq
588               {opendaylight-infra-mvn-opts}
589           java-opts:
590             - '-Xmx8g'
591           settings: '{mvn-settings}'
592           settings-type: cfp
593           global-settings: '{mvn-global-settings}'
594           global-settings-type: cfp
595       - maven-target:
596           maven-version: '{mvn-version}'
597           pom: pom.xml
598           goals: |
599               clean validate
600               -Pq
601               {opendaylight-infra-mvn-opts}
602           java-opts:
603             - '-Xmx8g -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
604           settings: '{mvn-settings}'
605           settings-type: cfp
606           global-settings: '{mvn-global-settings}'
607           global-settings-type: cfp
608       - shell: |
609           mkdir -p archives/
610           cp *.log $_
611
612     publishers:
613       - email-notification:
614           email-recipients: '{email-recipients}'
615           email-prefix: '[autorelease] [{project-name}]'
616       - lf-infra-publish