Merge redundant build jobs into a single template
[releng/builder.git] / jjb / releng-jobs.yaml
1 ---
2 - project:
3     name: builder-jobs
4     jobs:
5       - '{project-name}-ci-jobs'
6       - '{project-name}-verify-tox-{stream}'
7       - 'builder-check-poms'
8       - 'builder-verify-packer'
9       - 'builder-merge-packer-{platforms}-{templates}'
10       # OpenStack Related
11       - 'builder-cleanup-old-images'
12       - 'builder-delete-stale-stacks'
13       # Automation for docs and jobs
14       - 'builder-update-csit-tests'
15       - 'builder-update-image-list'
16
17     platforms:
18       - centos
19       - ubuntu-14.04
20       - ubuntu-16.04
21
22     templates:
23       - devstack
24       - devstack-pre-pip-newton
25       - docker
26       - gbp
27       - java-builder
28       - mininet
29       - mininet-ovs-2.5
30       - robot
31
32     exclude:
33       - platforms: centos
34         templates: gbp
35       - platforms: centos
36         templates: mininet
37       - platforms: centos
38         templates: mininet-ovs-2.5
39       - platforms: ubuntu-14.04
40         templates: java-builder
41       - platforms: ubuntu-14.04
42         templates: robot
43       - platforms: ubuntu-14.04
44         templates: devstack-pre-pip-newton
45       - platforms: ubuntu-14.04
46         templates: devstack
47       - platforms: ubuntu-14.04
48         templates: docker
49       - platforms: ubuntu-14.04
50         templates: mininet-ovs-2.5
51       - platforms: ubuntu-16.04
52         templates: java-builder
53       - platforms: ubuntu-16.04
54         templates: robot
55       - platforms: ubuntu-16.04
56         templates: devstack-pre-pip-newton
57       - platforms: ubuntu-16.04
58         templates: devstack
59       - platforms: ubuntu-16.04
60         templates: docker
61       - platforms: ubuntu-16.04
62         templates: mininet
63       - platforms: ubuntu-16.04
64         templates: gbp
65
66
67     project-type: freestyle
68     archive-artifacts: '**/*.log'
69     build-timeout: '60'
70
71     # The following values are only specified here
72     # so that code blocks look similar to other projects.
73     project: 'releng/builder'
74     project-name: builder
75     stream: master
76     branch: master
77     build-node: centos7-java-builder-2c-4g
78
79 - job-template:
80     name: builder-check-poms
81     node: centos7-java-builder-2c-4g
82
83     project-type: freestyle
84
85     properties:
86       - opendaylight-infra-properties:
87           build-days-to-keep: 14
88
89     parameters:
90       - opendaylight-infra-parameters:
91           os-cloud: '{os-cloud}'
92           project: '{project}'
93           branch: '{branch}'
94           refspec: 'refs/heads/{branch}'
95           artifacts: '{archive-artifacts}'
96
97     wrappers:
98       - opendaylight-infra-wrappers:
99           build-timeout: '{build-timeout}'
100
101     triggers:
102       - timed: 'H H * * 1'
103
104     builders:
105       - shell: !include-raw-escape: include-raw-check-poms.sh
106
107     publishers:
108       - email-notification:
109           email-recipients: '{email-recipients}'
110           email-prefix: '[releng]'
111       - opendaylight-infra-shiplogs:
112           maven-version: 'mvn33'
113
114 - job-template:
115     name: 'builder-delete-stale-stacks'
116     project-type: freestyle
117     node: centos7-java-builder-2c-4g
118
119     properties:
120       - opendaylight-infra-properties:
121           build-days-to-keep: 7
122
123     wrappers:
124       - opendaylight-infra-wrappers:
125           build-timeout: '{build-timeout}'
126
127     triggers:
128       # Attempt to clear up stacks every 30 mins in case we have orphaned stacks
129       - timed: '0,30 * * * *'
130
131     builders:
132       - shell: !include-raw-escape: opendaylight-infra-cleanup-stale-stacks.sh
133
134     publishers:
135       - email-notification:
136           email-recipients: '{email-recipients}'
137           email-prefix: '[releng]'
138       - opendaylight-infra-shiplogs:
139           maven-version: 'mvn33'
140
141 - job-template:
142     name: 'builder-cleanup-old-images'
143     project-type: freestyle
144     node: centos7-java-builder-2c-4g
145
146     properties:
147       - opendaylight-infra-properties:
148           build-days-to-keep: 7
149
150     parameters:
151       - opendaylight-infra-parameters:
152           os-cloud: '{os-cloud}'
153           project: '{project}'
154           branch: '{branch}'
155           refspec: 'refs/heads/{branch}'
156           artifacts: '{archive-artifacts}'
157
158     scm:
159       - git-scm:
160           branch: '{branch}'
161
162     wrappers:
163       - opendaylight-infra-wrappers:
164           build-timeout: '{build-timeout}'
165       # Listed after to override openstack-infra-wrappers clouds.yaml definition
166       - config-file-provider:
167           files:
168             - file-id: opendaylight-private-clouds-yaml
169               target: '$HOME/.config/openstack/clouds.yaml'
170
171     triggers:
172       # Cleanup images on a weekly schedule
173       - timed: '@weekly'
174
175     builders:
176       - shell: !include-raw-escape: opendaylight-infra-cleanup-old-images.sh
177
178     publishers:
179       - email-notification:
180           email-recipients: '{email-recipients}'
181           email-prefix: '[releng]'
182       - opendaylight-infra-shiplogs:
183           maven-version: 'mvn33'
184
185 - job-template:
186     name: 'builder-update-image-list'
187     project-type: freestyle
188     node: centos7-java-builder-2c-4g
189
190     properties:
191       - opendaylight-infra-properties:
192           build-days-to-keep: 7
193
194     parameters:
195       - opendaylight-infra-parameters:
196           os-cloud: odlpriv
197           project: '{project}'
198           branch: '{branch}'
199           refspec: 'refs/heads/{branch}'
200           artifacts: '{archive-artifacts}'
201
202     scm:
203       - git-scm:
204           branch: '{branch}'
205
206     wrappers:
207       - opendaylight-infra-wrappers:
208           build-timeout: '{build-timeout}'
209       # Listed after to override openstack-infra-wrappers clouds.yaml definition
210       - config-file-provider:
211           files:
212             - file-id: opendaylight-private-clouds-yaml
213               target: '$HOME/.config/openstack/clouds.yaml'
214
215     triggers:
216       # Update image list every Monday to Friday at 11:00 UTC
217       - timed: '0 11 * * 1-5'
218
219     builders:
220       - shell: !include-raw-escape: opendaylight-infra-update-image-list.sh
221       - opendaylight-infra-push-gerrit-patch:
222           project: '{project}'
223           gerrit-topic: 'releng-update-cloud-image-list'
224           gerrit-commit-message: 'Update cloud image list docs'
225
226     publishers:
227       - email-notification:
228           email-recipients: '{email-recipients}'
229           email-prefix: '[releng]'
230       - opendaylight-infra-shiplogs:
231           maven-version: 'mvn33'
232
233 - job-template:
234     name: 'builder-verify-packer'
235     project-type: freestyle
236     node: centos7-java-builder-2c-4g
237     concurrent: true
238
239     properties:
240       - opendaylight-infra-properties:
241           build-days-to-keep: 14
242
243     parameters:
244       - opendaylight-infra-parameters:
245           os-cloud: '{os-cloud}'
246           project: '{project}'
247           branch: '{branch}'
248           refspec: 'refs/heads/{branch}'
249           artifacts: '{archive-artifacts}'
250
251     scm:
252       - gerrit-trigger-scm:
253           refspec: '$GERRIT_REFSPEC'
254           choosing-strategy: 'gerrit'
255
256     wrappers:
257       - opendaylight-infra-wrappers:
258           build-timeout: '{build-timeout}'
259
260     triggers:
261       - gerrit-trigger-patch-submitted:
262           server: '{server-name}'
263           project: '{project}'
264           branch: '{branch}'
265           files: 'packer/**'
266
267     builders:
268       - packer-validate:
269
270     publishers:
271       - email-notification:
272           email-recipients: '{email-recipients}'
273           email-prefix: '[{project}]'
274       - opendaylight-infra-shiplogs:
275           maven-version: 'mvn33'
276
277 - job-template:
278     name: 'builder-merge-packer-{platforms}-{templates}'
279     project-type: freestyle
280     node: centos7-java-builder-2c-4g
281
282     properties:
283       - opendaylight-infra-properties:
284           build-days-to-keep: 14
285
286     parameters:
287       - opendaylight-infra-parameters:
288           os-cloud: '{os-cloud}'
289           project: '{project}'
290           branch: '{branch}'
291           refspec: 'refs/heads/{branch}'
292           artifacts: '{archive-artifacts}'
293
294     scm:
295       - gerrit-trigger-scm:
296           refspec: '$GERRIT_REFSPEC'
297           branches:
298             - '$GERRIT_BRANCH'
299           choosing-strategy: 'default'
300
301     wrappers:
302       - opendaylight-infra-wrappers:
303           build-timeout: '{build-timeout}'
304
305     triggers:
306       - timed: '00 10 1 * *'
307       - gerrit:
308           server-name: '{server-name}'
309           trigger-on:
310             - change-merged-event
311             - comment-added-contains-event:
312                 comment-contains-value: 'remerge'
313           projects:
314             - project-compare-type: 'ANT'
315               project-pattern: 'releng/builder'
316               branches:
317                 - branch-compare-type: 'ANT'
318                   branch-pattern: '**/{branch}'
319               file-paths:
320                 - compare-type: ANT
321                   pattern: 'packer/vars/{platforms}.json'
322                 - compare-type: ANT
323                   pattern: 'packer/templates/{templates}.json'
324                 - compare-type: ANT
325                   pattern: 'packer/provision/{templates}.sh'
326                 - compare-type: ANT
327                   pattern: 'packer/provision/system_reseal.sh'
328                 - compare-type: ANT
329                   pattern: 'packer/provision/rh-user_data.sh'
330                 - compare-type: ANT
331                   pattern: 'packer/provision/devstack-pre-pip.sh'
332                 - compare-type: ANT
333                   pattern: 'packer/provision/baseline.sh'
334
335     builders:
336       - packer-validate:
337       - packer-build:
338           platform: '{platforms}'
339           template: '{templates}'
340
341     publishers:
342       - email-notification:
343           email-recipients: '{email-recipients}'
344           email-prefix: '[{project}]'
345       - opendaylight-infra-shiplogs:
346           maven-version: 'mvn33'
347
348 - job-template:
349     name: 'builder-update-csit-tests'
350     node: centos7-java-builder-2c-8g
351
352     # builder-update-csit-tests job
353     #
354     # This job's purpose is to update csit
355     # tests to run in integration-distribution-test-{stream}
356     # by updating releng-defaults variables: csit-list-carbon,
357     # csit-list-boron, csit-list-beryllium
358
359     project-type: freestyle
360
361     properties:
362       - opendaylight-infra-properties:
363           build-days-to-keep: 14
364
365     parameters:
366       - opendaylight-infra-parameters:
367           os-cloud: '{os-cloud}'
368           project: '{project}'
369           branch: '{branch}'
370           refspec: 'refs/heads/{branch}'
371           artifacts: '{archive-artifacts}'
372
373     scm:
374       - gerrit-trigger-scm:
375           refspec: ''
376           choosing-strategy: 'default'
377
378     wrappers:
379       - opendaylight-infra-wrappers:
380           build-timeout: '{build-timeout}'
381
382     triggers:
383       - reverse:
384           jobs: 'builder-jjb-merge'
385
386     builders:
387       - shell: |
388           git checkout -b auto-update-csit-jobs
389       - integration-list-jobs:
390           blacklist: '{csit-list-blacklist}'
391           search_string: "csit"
392           stream: "nitrogen"
393           jobs-filename: "csit_jobs_nitrogen.lst"
394       - integration-list-jobs:
395           blacklist: '{csit-list-blacklist}'
396           search_string: "csit"
397           stream: "carbon"
398           jobs-filename: "csit_jobs_carbon.lst"
399       - integration-list-jobs:
400           blacklist: '{csit-list-blacklist}'
401           search_string: "csit"
402           stream: "boron"
403           jobs-filename: "csit_jobs_boron.lst"
404       - integration-list-jobs:
405           blacklist: '{csit-list-blacklist}'
406           search_string: "csit"
407           stream: "beryllium"
408           jobs-filename: "csit_jobs_beryllium.lst"
409       - integration-replace-block-text:
410           starting-regex: "'csit-list-nitrogen: >'"
411           ending-regex: "'csit-list-carbon: >'"
412           file-with-changes-to-insert: "'csit_jobs_nitrogen.lst'"
413           file-to-change: "'jjb/releng-defaults.yaml'"
414       - integration-replace-block-text:
415           starting-regex: "'csit-list-carbon: >'"
416           ending-regex: "'csit-list-boron: >'"
417           file-with-changes-to-insert: "'csit_jobs_carbon.lst'"
418           file-to-change: "'jjb/releng-defaults.yaml'"
419       - integration-replace-block-text:
420           starting-regex: "'csit-list-boron: >'"
421           ending-regex: "'csit-list-beryllium: >'"
422           file-with-changes-to-insert: "'csit_jobs_boron.lst'"
423           file-to-change: "'jjb/releng-defaults.yaml'"
424       - integration-replace-block-text:
425           starting-regex: "'csit-list-beryllium: >'"
426           ending-regex: "'# CSIT TESTS END SED MARKER'"
427           file-with-changes-to-insert: "'csit_jobs_beryllium.lst'"
428           file-to-change: "'jjb/releng-defaults.yaml'"
429       - shell: |
430           git status
431           git add jjb/releng-defaults.yaml
432       - opendaylight-infra-push-gerrit-patch:
433           project: "releng/builder"
434           gerrit-topic: "auto-update-csit-jobs"
435           gerrit-commit-message: "Auto Update CSIT Jobs to run"
436
437     publishers:
438       - email-notification:
439           email-recipients: '{email-recipients}'
440           email-prefix: '[releng]'
441       - opendaylight-infra-shiplogs:
442           maven-version: 'mvn33'