Merge "Add infrautils-ready feature to distro features"
[releng/builder.git] / jjb / autorelease / autorelease-templates.yaml
1 ---
2 # Autorelease build jobs
3 - job-template:
4     name: 'autorelease-release-{stream}'
5
6     project-type: freestyle
7     node: centos7-autorelease-4c-16g
8     jdk: '{jdk}'
9     cron: 'H 0 * * *'
10
11     # Default variable values
12     mvn-version: mvn33
13     extra-mvn-opts: ''
14
15     properties:
16       - lf-infra-properties:
17           build-days-to-keep: 30
18
19     parameters:
20       - maven-exec:
21           maven-version: 'mvn33'
22       - lf-infra-parameters:
23           project: '{project}'
24           stream: '{stream}'
25           branch: '{branch}'
26           lftools-version: '{lftools-version}'
27       - distribution-karaf-version:
28           karaf-version: '{karaf-version}'
29       - autorelease-release-tag:
30           release-tag: '{next-release-tag}'
31       - string:
32           name: EXTRA_MVN_OPTS
33           default: '{extra-mvn-opts}'
34           description: |
35               Additional optional Maven Options to pass to the Maven Goals
36               parameter.
37
38               Examples:
39               -Dskip.karaf.featureTest=true  # To disable karaf SingleFeatureTests
40               --fail-never   # NEVER fail the build, regardless of project result
41               --fail-at-end  # Only fail the build afterwards; allow all non-impacted builds to continue
42       - string:
43           name: ARCHIVE_ARTIFACTS
44           default: '{archive-artifacts}'
45           description: Artifacts to archive to the logs server.
46
47     scm:
48       - git:
49           credentials-id: 'opendaylight-jenkins-ssh'
50           url: '$GIT_BASE'
51           refspec: '$GERRIT_REFSPEC'
52           branches:
53             - '$GERRIT_BRANCH'
54           choosing-strategy: default
55           skip-tag: true
56           submodule:
57             recursive: true
58             timeout: 60
59
60     wrappers:
61       - opendaylight-infra-wrappers:
62           build-timeout: '900'
63
64     triggers:
65       - timed: '{cron}'
66
67     builders:
68       # force jenkins install of maven version before any shell scripts use it
69       - lf-maven-install:
70           mvn-version: '{mvn-version}'
71       - wipe-local-maven-repo
72       - jacoco-nojava-workaround
73       - shell: "./scripts/list-project-dependencies.sh"
74       - autorelease-determine-merge-order
75       - autorelease-cfp:
76           autorelease-settings: 'autorelease-settings'
77           global-settings: 'odl-global-settings'
78       - autorelease-generate-release-patches
79       - autorelease-generate-artifact-versions
80       - autorelease-distribute-taglist
81       - distribute-build-url:
82           path: 'integration/distribution/$KARAF_ARTIFACT/src/main/assembly'
83       # In a perfect world projects should be releasing separately and we consume them
84       # via a project that pulls the release bits from each project from Nexus.
85       # Keep the patches compatible with that ideal, but apply an edit
86       # to enable building in a single maven reactor afterwards.
87       - autorelease-fix-relative-paths
88       - maven-target:
89           maven-version: 'mvn33'
90           pom: 'pom.xml'
91           goals: |
92               clean deploy
93               $EXTRA_MVN_OPTS
94               -Pintegrationtests,docs,repoBuild
95               -Dcheckstyle.skip=true
96               -DaltDeploymentRepository=staging::default::file:hide/from/pom/files/stage
97               {opendaylight-infra-mvn-opts}
98           java-opts:
99             - '-Xmx8g -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
100           settings: 'autorelease-settings'
101           settings-type: cfp
102           global-settings: 'global-settings'
103           global-settings-type: cfp
104       - autorelease-maven-deploy
105       - autorelease-get-integration-test-variables
106       - autorelease-maven-sources:
107           opendaylight-infra-mvn-opts: '{opendaylight-infra-mvn-opts}'
108           maven-version: 'mvn33'
109           settings: 'autorelease-settings'
110           global-settings: 'global-settings'
111       - autorelease-maven-sources-post-process
112       - shell: |
113           mkdir -p archives/
114           cp *.log *.prop $_
115
116     publishers:
117       - opendaylight-infra-notify-status
118       - trigger-parameterized-builds:
119           - project: 'integration-distribution-test-{integration-test}'
120             condition: UNSTABLE_OR_BETTER
121             property-file: variables.jenkins-trigger
122             fail-on-missing: true
123           - project: 'integration-distribution-test-{integration-test}'
124             condition: FAILED
125             trigger-with-no-params: true
126           - project: 'integration-sanity-test-{integration-test}'
127             condition: UNSTABLE_OR_BETTER
128             property-file: variables.jenkins-trigger
129             fail-on-missing: true
130           - project: 'integration-sanity-test-{integration-test}'
131             condition: FAILED
132             trigger-with-no-params: true
133           - project: 'packaging-build-rpm-{stream}'
134             condition: UNSTABLE_OR_BETTER
135             predefined-parameters: DOWNLOAD_URL=$BUNDLE_URL
136             property-file: variables.jenkins-trigger
137             fail-on-missing: true
138           - project: 'packaging-build-deb-{stream}'
139             condition: UNSTABLE_OR_BETTER
140             predefined-parameters: DOWNLOAD_URL=$BUNDLE_URL
141             property-file: variables.jenkins-trigger
142             fail-on-missing: true
143       - lf-infra-publish
144
145 - job-template:
146     name: autorelease-update-validate-jobs-{stream}
147     project-type: freestyle
148     node: centos7-java-builder-2c-4g
149
150     properties:
151       - lf-infra-properties:
152           build-days-to-keep: 7
153
154     parameters:
155       - lf-infra-parameters:
156           project: releng/builder
157           branch: '{branch}'
158           stream: '{stream}'
159           lftools-version: '{lftools-version}'
160
161     scm:
162       - lf-infra-gerrit-scm:
163           git-url: '$GIT_URL/releng/builder'
164           branch: master
165           refspec: 'refs/heads/master'
166           jenkins-ssh-credential: opendaylight-jenkins-ssh
167           submodule-recursive: true
168           choosing-strategy: default
169
170     triggers:
171       - gerrit:
172           server-name: '{gerrit-server-name}'
173           trigger-on:
174             - change-merged-event
175             - comment-added-contains-event:
176                 comment-contains-value: remerge$
177           projects:
178             - project-compare-type: ANT
179               project-pattern: '{project}'
180               branches:
181                 - branch-compare-type: ANT
182                   branch-pattern: '**/{branch}'
183               file-paths:
184                 - compare-type: ANT
185                   pattern: pom.xml
186
187     wrappers:
188       - lf-infra-wrappers:
189           build-timeout: 10
190           jenkins-ssh-credential: opendaylight-jenkins-ssh
191
192     builders:
193       - shell: !include-raw-escape:
194           - update-validate-autorelease-projects.sh
195       - opendaylight-infra-push-gerrit-patch:
196           project: 'releng/builder'
197           gerrit-topic: 'autorelease-update-validate-jobs-{stream}'
198           gerrit-commit-message: |
199               Update validate autorelease projects for {stream}
200
201     publishers:
202       - lf-infra-publish
203
204 - job-template:
205     name: autorelease-version-bump-{stream}
206     project-type: freestyle
207     node: centos7-autorelease-4c-16g
208
209     properties:
210       - opendaylight-infra-properties:
211           build-days-to-keep: 7
212
213     parameters:
214       - lf-infra-parameters:
215           project: releng/autorelease
216           branch: '{branch}'
217           stream: '{stream}'
218           refspec: 'refs/heads/{branch}'
219           lftools-version: '{lftools-version}'
220       - string:
221           name: RELEASE_TAG
222           default: '{next-release-tag}'
223           description: |
224               Release that is being version bumped.
225               Eg. Lithium, Beryllium, Boron, Carbon, Carbon-SR1, Carbon-SR2...
226       - bool:
227           name: DRY_RUN
228           default: true
229           description: |
230               If DRY_RUN is enabled modifications are not published to Gerrit.
231       - maven-exec:
232           maven-version: mvn33
233
234     scm:
235       - lf-infra-gerrit-scm:
236           git-url: '$GIT_URL/$GERRIT_PROJECT'
237           branch: '{branch}'
238           refspec: 'refs/heads/{branch}'
239           jenkins-ssh-credential: opendaylight-jenkins-ssh
240           submodule-recursive: true
241           choosing-strategy: default
242
243     wrappers:
244       - lf-infra-wrappers:
245           build-timeout: 480
246           jenkins-ssh-credential: opendaylight-jenkins-ssh
247
248     builders:
249       # force jenkins install of maven version before any shell scripts use it
250       - maven-target:
251           maven-version: mvn33
252           goals: '-version'
253           settings: autorelease-settings
254           settings-type: cfp
255           global-settings: global-settings
256           global-settings-type: cfp
257       - autorelease-cfp
258       - shell: !include-raw-escape:
259           - ../global-jjb/shell/lftools-install.sh
260           - version-bump.sh
261
262     publishers:
263       - lf-infra-publish
264
265 - job-template:
266     name: 'autorelease-generate-release-notes-{stream}'
267
268     ######################
269     # Default parameters #
270     ######################
271
272     gerrit_merge_triggers:
273       - comment-added-contains-event:
274           comment-contains-value: generate-release-notes .+$
275
276     #####################
277     # Job Configuration #
278     #####################
279
280     project-type: freestyle
281     node: centos7-java-builder-2c-4g
282
283     properties:
284       - lf-infra-properties:
285           build-days-to-keep: 7
286
287     parameters:
288       - lf-infra-parameters:
289           project: '{project}'
290           branch: '{branch}'
291           stream: '{stream}'
292           lftools-version: '{lftools-version}'
293       - string:
294           name: RELEASE
295           description: Release to generate release notes for.
296
297     scm:
298       - lf-infra-gerrit-scm:
299           git-url: '$GIT_URL/$GERRIT_PROJECT'
300           branch: '$GERRIT_BRANCH'
301           refspec: '$GERRIT_REFSPEC'
302           jenkins-ssh-credential: opendaylight-jenkins-ssh
303           submodule-recursive: true
304           choosing-strategy: default
305
306     wrappers:
307       - lf-infra-wrappers:
308           build-timeout: 10
309           jenkins-ssh-credential: opendaylight-jenkins-ssh
310
311     triggers:
312       - gerrit:
313           server-name: '{gerrit-server-name}'
314           trigger-on: '{obj:gerrit_merge_triggers}'
315           projects:
316             - project-compare-type: ANT
317               project-pattern: '{project}'
318               branches:
319                 - branch-compare-type: ANT
320                   branch-pattern: '**/{branch}'
321
322     builders:
323       - autorelease-generate-release-notes
324
325     publishers:
326       - lf-infra-publish
327
328 - job-template:
329     name: '{project-name}-validate-autorelease-{stream}'
330     disabled: false
331
332     project-type: freestyle
333     node: '{build-node}'
334     concurrent: true
335     jdk: openjdk8
336
337     properties:
338       - lf-infra-properties:
339           build-days-to-keep: 7
340
341     parameters:
342       - lf-infra-parameters:
343           project: '{project}'
344           stream: '{stream}'
345           branch: '{branch}'
346           lftools-version: '{lftools-version}'
347       - autorelease-release-tag:
348           release-tag: validate
349       - string:
350           name: CLONE_URL
351           default: '{git-url}/releng/autorelease'
352           description: "Autorelease clone URL"
353
354     scm:
355       - git:
356           url: '$CLONE_URL'
357           credentials-id: 'opendaylight-jenkins-ssh'
358           refspec: ''
359           branches:
360             - 'origin/{branch}'
361           skip-tag: true
362           submodule:
363             recursive: true
364             timeout: 60
365
366     wrappers:
367       - opendaylight-infra-wrappers:
368           build-timeout: '{build-timeout}'
369
370     triggers:
371       - gerrit-trigger-patch-submitted:
372           server: '{server-name}'
373           project: '{project}'
374           branch: '{branch}'
375           files: '**/*.xml'
376
377     builders:
378       - autorelease-checkout-gerrit-patch
379       - jacoco-nojava-workaround
380       - shell: "./scripts/list-project-dependencies.sh"
381       - autorelease-determine-merge-order
382       - autorelease-generate-release-patches
383       # In a perfect world projects should be releasing separately and we consume them
384       # via a project that pulls the release bits from each project from Nexus.
385       # Keep the patches compatible with that ideal, but apply an edit
386       # to enable building in a single maven reactor afterwards.
387       - autorelease-fix-relative-paths
388       - maven-target:
389           maven-version: mvn33
390           pom: validate-pom.xml
391           goals: |
392               clean install dependency:tree
393               -T1.5C
394               -Pq
395               {opendaylight-infra-mvn-opts}
396           java-opts:
397             - '-Xmx8g'
398           settings: autorelease-settings
399           settings-type: cfp
400           global-settings: global-settings
401           global-settings-type: cfp
402       - maven-target:
403           maven-version: mvn33
404           pom: pom.xml
405           goals: |
406               clean validate
407               -Pq
408               {opendaylight-infra-mvn-opts}
409           java-opts:
410             - '-Xmx8g -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
411           settings: autorelease-settings
412           settings-type: cfp
413           global-settings: global-settings
414           global-settings-type: cfp
415       - shell: |
416           mkdir -p archives/
417           cp *.log $_
418
419     publishers:
420       - email-notification:
421           email-recipients: '{email-recipients}'
422           email-prefix: '[autorelease] [{project-name}]'
423       - lf-infra-publish