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