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