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