766d13fa1860b03fa68a3387c75251457b6f4050
[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             - '-Xmx10g -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: 240
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       - trigger-parameterized-builds:
264           - project: 'autorelease-generate-release-notes-{stream}'
265             condition: UNSTABLE_OR_BETTER
266             trigger-with-no-params: true
267       - lf-infra-publish
268
269 - job-template:
270     name: 'autorelease-generate-release-notes-{stream}'
271
272     project-type: freestyle
273     node: centos7-java-builder-2c-4g
274
275     properties:
276       - lf-infra-properties:
277           build-days-to-keep: 7
278
279     parameters:
280       - lf-infra-parameters:
281           project: '{project}'
282           branch: '{branch}'
283           stream: '{stream}'
284           lftools-version: '{lftools-version}'
285
286     scm:
287       - lf-infra-gerrit-scm:
288           git-url: '$GIT_URL/$GERRIT_PROJECT'
289           branch: '{branch}'
290           refspec: 'refs/heads/{branch}'
291           jenkins-ssh-credential: opendaylight-jenkins-ssh
292           submodule-recursive: true
293           choosing-strategy: default
294
295     wrappers:
296       - lf-infra-wrappers:
297           build-timeout: 10
298           jenkins-ssh-credential: opendaylight-jenkins-ssh
299
300     triggers:
301       - timed: '0 0 * * 0'
302
303     builders:
304       - lf-maven-install:
305           mvn-version: mvn33
306       - maven-target:
307           maven-version: mvn33
308           pom: '$WORKSPACE/scripts/release_notes_management/pom.xml'
309           goals: |
310               clean package
311               {opendaylight-infra-mvn-opts}
312           settings: autorelease-settings
313           settings-type: cfp
314           global-settings: global-settings
315           global-settings-type: cfp
316       - autorelease-generate-release-notes
317
318     publishers:
319       - lf-infra-publish
320
321 - job-template:
322     name: '{project-name}-validate-autorelease-{stream}'
323     disabled: false
324
325     project-type: freestyle
326     node: '{build-node}'
327     concurrent: true
328     jdk: openjdk8
329
330     properties:
331       - lf-infra-properties:
332           build-days-to-keep: 7
333
334     parameters:
335       - lf-infra-parameters:
336           project: '{project}'
337           stream: '{stream}'
338           branch: '{branch}'
339           lftools-version: '{lftools-version}'
340       - autorelease-release-tag:
341           release-tag: validate
342       - string:
343           name: CLONE_URL
344           default: '{git-url}/releng/autorelease'
345           description: "Autorelease clone URL"
346
347     scm:
348       - git:
349           url: '$CLONE_URL'
350           credentials-id: 'opendaylight-jenkins-ssh'
351           refspec: ''
352           branches:
353             - 'origin/{branch}'
354           skip-tag: true
355           submodule:
356             recursive: true
357             timeout: 60
358
359     wrappers:
360       - opendaylight-infra-wrappers:
361           build-timeout: '{build-timeout}'
362
363     triggers:
364       - gerrit-trigger-patch-submitted:
365           server: '{server-name}'
366           project: '{project}'
367           branch: '{branch}'
368           files: '**/*.xml'
369
370     builders:
371       - jacoco-nojava-workaround
372       - autorelease-checkout-gerrit-patch
373       - autorelease-generate-release-patches
374       # In a perfect world projects should be releasing separately and we consume them
375       # via a project that pulls the release bits from each project from Nexus.
376       # Keep the patches compatible with that ideal, but apply an edit
377       # to enable building in a single maven reactor afterwards.
378       - autorelease-fix-relative-paths
379       - maven-target:
380           maven-version: mvn33
381           pom: validate-pom.xml
382           goals: |
383               clean install dependency:tree
384               -T1.5C
385               -Pq
386               {opendaylight-infra-mvn-opts}
387           java-opts:
388             - '-Xmx8g'
389           settings: autorelease-settings
390           settings-type: cfp
391           global-settings: global-settings
392           global-settings-type: cfp
393       - maven-target:
394           maven-version: mvn33
395           pom: pom.xml
396           goals: |
397               clean validate
398               -Pq
399               {opendaylight-infra-mvn-opts}
400           java-opts:
401             - '-Xmx8g -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
402           settings: autorelease-settings
403           settings-type: cfp
404           global-settings: global-settings
405           global-settings-type: cfp
406
407     publishers:
408       - email-notification:
409           email-recipients: '{email-recipients}'
410           email-prefix: '[autorelease] [{project-name}]'
411       - lf-infra-publish