Use OS_CLOUD variable for openstackclient
[releng/builder.git] / jjb / releng-jobs.yaml
1 ---
2 - project:
3     name: builder-jobs
4     jobs:
5       - 'builder-verify-jjb'
6       - '{project-name}-verify-tox-{stream}'
7       - 'builder-merge'
8       - 'builder-weekly'
9       - 'builder-check-poms'
10       - 'builder-verify-packer'
11       - 'builder-merge-packer-{platforms}-{templates}'
12       # OpenStack Related
13       - 'builder-cleanup-old-images'
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-mitaka
27       - devstack-pre-pip-newton
28       - docker
29       - gbp
30       - java-builder
31       - mininet
32       - mininet-ovs-2.3
33       - mininet-ovs-2.5
34       - robot
35
36     exclude:
37       - platforms: centos
38         templates: gbp
39       - platforms: centos
40         templates: mininet
41       - platforms: centos
42         templates: mininet-ovs-2.3
43       - platforms: centos
44         templates: mininet-ovs-2.5
45       - platforms: ubuntu-14.04
46         templates: java-builder
47       - platforms: ubuntu-14.04
48         templates: robot
49       - platforms: ubuntu-14.04
50         templates: devstack-pre-pip-mitaka
51       - platforms: ubuntu-14.04
52         templates: devstack-pre-pip-newton
53       - platforms: ubuntu-14.04
54         templates: devstack
55       - platforms: ubuntu-14.04
56         templates: docker
57       - platforms: ubuntu-16.04
58         templates: java-builder
59       - platforms: ubuntu-16.04
60         templates: robot
61       - platforms: ubuntu-16.04
62         templates: devstack-pre-pip-mitaka
63       - platforms: ubuntu-16.04
64         templates: devstack-pre-pip-newton
65       - platforms: ubuntu-16.04
66         templates: devstack
67       - platforms: ubuntu-16.04
68         templates: docker
69       - platforms: ubuntu-16.04
70         templates: mininet
71       - platforms: ubuntu-16.04
72         templates: mininet-ovs-2.3
73       - platforms: ubuntu-14.04
74         templates: mininet-ovs-2.5
75
76
77     project-type: freestyle
78     archive-artifacts: '**/*.log'
79     build-timeout: '60'
80
81     # The following values are only specified here
82     # so that code blocks look similar to other projects.
83     project: 'releng/builder'
84     project-name: builder
85     stream: master
86     branch: master
87
88 - job-template:
89     name: builder-verify-jjb
90     node: centos7-java-builder-2c-4g
91     concurrent: true
92
93     project-type: freestyle
94
95     properties:
96       - opendaylight-infra-properties:
97           build-days-to-keep: 14
98
99     parameters:
100       - opendaylight-infra-parameters:
101           os-cloud: '{os-cloud}'
102           project: '{project}'
103           branch: '{branch}'
104           refspec: 'refs/heads/{branch}'
105           artifacts: '{archive-artifacts}'
106
107     scm:
108       - gerrit-trigger-scm:
109           refspec: '$GERRIT_REFSPEC'
110           choosing-strategy: 'gerrit'
111
112     wrappers:
113       - opendaylight-infra-wrappers:
114           build-timeout: '{build-timeout}'
115
116     triggers:
117       - gerrit-trigger-patch-submitted:
118           server: '{server-name}'
119           project: '{project}'
120           branch: '{branch}'
121           files: 'jjb/**'
122
123     builders:
124       - opendaylight-infra-jjbini
125       - shell: |
126           virtualenv $WORKSPACE/venv
127           source $WORKSPACE/venv/bin/activate
128           pip install --upgrade pip
129           pip freeze
130           pip install jenkins-job-builder
131           jenkins-jobs -l DEBUG test --recursive -o archives/job_output jjb/
132           gzip archives/job_output/*
133       - releng-check-unicode
134       - verify-gpg-signature
135
136     publishers:
137       - email-notification:
138           email-recipients: '{email-recipients}'
139           email-prefix: '[releng]'
140       - opendaylight-infra-shiplogs:
141           maven-version: 'mvn33'
142
143 - job-template:
144     name: 'builder-merge'
145     node: centos7-java-builder-2c-4g
146
147     # builder-merge job to run JJB update
148     #
149     # This job's purpose is to update all the JJB
150
151     project-type: freestyle
152
153     properties:
154       - opendaylight-infra-properties:
155           build-days-to-keep: 14
156
157     parameters:
158       - opendaylight-infra-parameters:
159           os-cloud: '{os-cloud}'
160           project: '{project}'
161           branch: '{branch}'
162           refspec: 'refs/heads/{branch}'
163           artifacts: '{archive-artifacts}'
164
165     scm:
166       - gerrit-trigger-scm:
167           refspec: ''
168           choosing-strategy: 'default'
169
170     wrappers:
171       - opendaylight-infra-wrappers:
172           build-timeout: '{build-timeout}'
173
174     triggers:
175       - gerrit:
176           server-name: '{server-name}'
177           trigger-on:
178             - change-merged-event
179             - comment-added-contains-event:
180                 comment-contains-value: 'remerge'
181           projects:
182             - project-compare-type: 'ANT'
183               project-pattern: 'releng/builder'
184               branches:
185                 - branch-compare-type: 'ANT'
186                   branch-pattern: '**/{branch}'
187               file-paths:
188                 - compare-type: ANT
189                   pattern: jjb/**
190
191     builders:
192       - opendaylight-infra-jjbini
193       - shell: |
194           virtualenv $WORKSPACE/venv
195           source $WORKSPACE/venv/bin/activate
196           pip install --upgrade pip
197           pip freeze
198           pip install jenkins-job-builder
199           jenkins-jobs --version
200           jenkins-jobs update --recursive --delete-old --workers 4 jjb/
201
202     publishers:
203       - email-notification:
204           email-recipients: '{email-recipients}'
205           email-prefix: '[releng]'
206       - opendaylight-infra-shiplogs:
207           maven-version: 'mvn33'
208
209 - job-template:
210     name: 'builder-weekly'
211     disabled: false
212     node: centos7-java-builder-2c-4g
213
214     # builder-weekly job to run JJB update weekly
215     #
216     # This job's purpose is to update all the JJB on a weekly (Sunday)
217     # basis with --flush-cache enabled to ensure jobs are okay
218
219     project-type: freestyle
220
221     properties:
222       - opendaylight-infra-properties:
223           build-days-to-keep: 14
224
225     parameters:
226       - opendaylight-infra-parameters:
227           os-cloud: '{os-cloud}'
228           project: '{project}'
229           branch: '{branch}'
230           refspec: 'refs/heads/{branch}'
231           artifacts: '{archive-artifacts}'
232
233     scm:
234       - git-scm:
235           branch: '{branch}'
236
237     wrappers:
238       - opendaylight-infra-wrappers:
239           build-timeout: '{build-timeout}'
240
241     triggers:
242       - timed: 'H H * * 0'
243
244     builders:
245       - opendaylight-infra-jjbini
246       - shell: |
247           virtualenv $WORKSPACE/venv
248           source $WORKSPACE/venv/bin/activate
249           pip install --upgrade pip
250           pip freeze
251           pip install jenkins-job-builder
252           jenkins-jobs --flush-cache update --recursive --workers 4 jjb/
253
254     publishers:
255       - email-notification:
256           email-recipients: '{email-recipients}'
257           email-prefix: '[releng]'
258       - opendaylight-infra-shiplogs:
259           maven-version: 'mvn33'
260
261 - job-template:
262     name: builder-check-poms
263     node: centos7-java-builder-2c-4g
264
265     project-type: freestyle
266
267     properties:
268       - opendaylight-infra-properties:
269           build-days-to-keep: 14
270
271     parameters:
272       - opendaylight-infra-parameters:
273           os-cloud: '{os-cloud}'
274           project: '{project}'
275           branch: '{branch}'
276           refspec: 'refs/heads/{branch}'
277           artifacts: '{archive-artifacts}'
278
279     wrappers:
280       - opendaylight-infra-wrappers:
281           build-timeout: '{build-timeout}'
282
283     triggers:
284       - timed: 'H H * * 1'
285
286     builders:
287       - shell: !include-raw-escape: include-raw-check-poms.sh
288
289     publishers:
290       - email-notification:
291           email-recipients: '{email-recipients}'
292           email-prefix: '[releng]'
293       - opendaylight-infra-shiplogs:
294           maven-version: 'mvn33'
295
296 - job-template:
297     name: 'builder-delete-stale-stacks'
298     project-type: freestyle
299     node: centos7-java-builder-2c-4g
300
301     properties:
302       - opendaylight-infra-properties:
303           build-days-to-keep: 7
304
305     wrappers:
306       - opendaylight-infra-wrappers:
307           build-timeout: '{build-timeout}'
308
309     triggers:
310       # Attempt to clear up stacks every 30 mins in case we have orphaned stacks
311       - timed: '0,30 * * * *'
312
313     builders:
314       - shell: !include-raw-escape: opendaylight-infra-cleanup-stale-stacks.sh
315
316     publishers:
317       - email-notification:
318           email-recipients: '{email-recipients}'
319           email-prefix: '[releng]'
320       - opendaylight-infra-shiplogs:
321           maven-version: 'mvn33'
322
323 - job-template:
324     name: 'builder-cleanup-old-images'
325     project-type: freestyle
326     node: centos7-java-builder-2c-4g
327
328     properties:
329       - opendaylight-infra-properties:
330           build-days-to-keep: 7
331
332     parameters:
333       - opendaylight-infra-parameters:
334           os-cloud: '{os-cloud}'
335           project: '{project}'
336           branch: '{branch}'
337           refspec: 'refs/heads/{branch}'
338           artifacts: '{archive-artifacts}'
339
340     scm:
341       - git-scm:
342           branch: '{branch}'
343
344     wrappers:
345       - opendaylight-infra-wrappers:
346           build-timeout: '{build-timeout}'
347       # Listed after to override openstack-infra-wrappers clouds.yaml definition
348       - config-file-provider:
349           files:
350             - file-id: opendaylight-private-clouds-yaml
351               target: '$HOME/.config/openstack/clouds.yaml'
352
353     triggers:
354       # Cleanup images on a weekly schedule
355       - timed: '@weekly'
356
357     builders:
358       - shell: !include-raw-escape: opendaylight-infra-cleanup-old-images.sh
359
360     publishers:
361       - email-notification:
362           email-recipients: '{email-recipients}'
363           email-prefix: '[releng]'
364       - opendaylight-infra-shiplogs:
365           maven-version: 'mvn33'
366
367 - job-template:
368     name: 'builder-update-image-list'
369     project-type: freestyle
370     node: centos7-java-builder-2c-4g
371
372     properties:
373       - opendaylight-infra-properties:
374           build-days-to-keep: 7
375
376     parameters:
377       - opendaylight-infra-parameters:
378           os-cloud: odlpriv
379           project: '{project}'
380           branch: '{branch}'
381           refspec: 'refs/heads/{branch}'
382           artifacts: '{archive-artifacts}'
383
384     scm:
385       - git-scm:
386           branch: '{branch}'
387
388     wrappers:
389       - opendaylight-infra-wrappers:
390           build-timeout: '{build-timeout}'
391       # Listed after to override openstack-infra-wrappers clouds.yaml definition
392       - config-file-provider:
393           files:
394             - file-id: opendaylight-private-clouds-yaml
395               target: '$HOME/.config/openstack/clouds.yaml'
396
397     triggers:
398       # Update image list every Monday to Friday at 11:00 UTC
399       - timed: '0 11 * * 1-5'
400
401     builders:
402       - shell: !include-raw-escape: opendaylight-infra-update-image-list.sh
403       - opendaylight-infra-push-gerrit-patch:
404           project: '{project}'
405           gerrit-topic: 'releng-update-cloud-image-list'
406           gerrit-commit-message: 'Update cloud image list docs'
407
408     publishers:
409       - email-notification:
410           email-recipients: '{email-recipients}'
411           email-prefix: '[releng]'
412       - opendaylight-infra-shiplogs:
413           maven-version: 'mvn33'
414
415 - job-template:
416     name: 'builder-verify-packer'
417     project-type: freestyle
418     node: centos7-java-builder-2c-4g
419     concurrent: true
420
421     properties:
422       - opendaylight-infra-properties:
423           build-days-to-keep: 14
424
425     parameters:
426       - opendaylight-infra-parameters:
427           os-cloud: '{os-cloud}'
428           project: '{project}'
429           branch: '{branch}'
430           refspec: 'refs/heads/{branch}'
431           artifacts: '{archive-artifacts}'
432
433     scm:
434       - gerrit-trigger-scm:
435           refspec: '$GERRIT_REFSPEC'
436           choosing-strategy: 'gerrit'
437
438     wrappers:
439       - opendaylight-infra-wrappers:
440           build-timeout: '{build-timeout}'
441
442     triggers:
443       - gerrit-trigger-patch-submitted:
444           server: '{server-name}'
445           project: '{project}'
446           branch: '{branch}'
447           files: 'packer/**'
448
449     builders:
450       - packer-validate:
451
452     publishers:
453       - email-notification:
454           email-recipients: '{email-recipients}'
455           email-prefix: '[{project}]'
456       - opendaylight-infra-shiplogs:
457           maven-version: 'mvn33'
458
459 - job-template:
460     name: 'builder-merge-packer-{platforms}-{templates}'
461     project-type: freestyle
462     node: centos7-java-builder-2c-4g
463
464     properties:
465       - opendaylight-infra-properties:
466           build-days-to-keep: 14
467
468     parameters:
469       - opendaylight-infra-parameters:
470           os-cloud: '{os-cloud}'
471           project: '{project}'
472           branch: '{branch}'
473           refspec: 'refs/heads/{branch}'
474           artifacts: '{archive-artifacts}'
475
476     scm:
477       - gerrit-trigger-scm:
478           refspec: '$GERRIT_REFSPEC'
479           branches:
480             - '$GERRIT_BRANCH'
481           choosing-strategy: 'default'
482
483     wrappers:
484       - opendaylight-infra-wrappers:
485           build-timeout: '{build-timeout}'
486
487     triggers:
488       - timed: '00 10 1 * *'
489       - gerrit:
490           server-name: '{server-name}'
491           trigger-on:
492             - change-merged-event
493             - comment-added-contains-event:
494                 comment-contains-value: 'remerge'
495           projects:
496             - project-compare-type: 'ANT'
497               project-pattern: 'releng/builder'
498               branches:
499                 - branch-compare-type: 'ANT'
500                   branch-pattern: '**/{branch}'
501               file-paths:
502                 - compare-type: ANT
503                   pattern: 'packer/vars/{platforms}.json'
504                 - compare-type: ANT
505                   pattern: 'packer/templates/{templates}.json'
506                 - compare-type: ANT
507                   pattern: 'packer/provision/{templates}.sh'
508                 - compare-type: ANT
509                   pattern: 'packer/provision/system_reseal.sh'
510                 - compare-type: ANT
511                   pattern: 'packer/provision/rh-user_data.sh'
512                 - compare-type: ANT
513                   pattern: 'packer/provision/devstack-pre-pip.sh'
514                 - compare-type: ANT
515                   pattern: 'packer/provision/baseline.sh'
516
517     builders:
518       - packer-validate:
519       - packer-build:
520           platform: '{platforms}'
521           template: '{templates}'
522
523     publishers:
524       - email-notification:
525           email-recipients: '{email-recipients}'
526           email-prefix: '[{project}]'
527       - opendaylight-infra-shiplogs:
528           maven-version: 'mvn33'
529
530 - job-template:
531     name: 'builder-update-csit-tests'
532     node: centos7-java-builder-2c-8g
533
534     # builder-update-csit-tests job
535     #
536     # This job's purpose is to update csit
537     # tests to run in integration-distribution-test-{stream}
538     # by updating releng-defaults variables: csit-list-carbon,
539     # csit-list-boron, csit-list-beryllium
540
541     project-type: freestyle
542
543     properties:
544       - opendaylight-infra-properties:
545           build-days-to-keep: 14
546
547     parameters:
548       - opendaylight-infra-parameters:
549           os-cloud: '{os-cloud}'
550           project: '{project}'
551           branch: '{branch}'
552           refspec: 'refs/heads/{branch}'
553           artifacts: '{archive-artifacts}'
554
555     scm:
556       - gerrit-trigger-scm:
557           refspec: ''
558           choosing-strategy: 'default'
559
560     wrappers:
561       - opendaylight-infra-wrappers:
562           build-timeout: '{build-timeout}'
563
564     triggers:
565       - reverse:
566           jobs: 'builder-merge'
567
568     builders:
569       - shell: |
570           git checkout -b auto-update-csit-jobs
571       - integration-list-jobs:
572           blacklist: '{csit-list-blacklist}'
573           search_string: "csit"
574           stream: "carbon"
575           jobs-filename: "csit_jobs_carbon.lst"
576       - integration-list-jobs:
577           blacklist: '{csit-list-blacklist}'
578           search_string: "csit"
579           stream: "boron"
580           jobs-filename: "csit_jobs_boron.lst"
581       - integration-list-jobs:
582           blacklist: '{csit-list-blacklist}'
583           search_string: "csit"
584           stream: "beryllium"
585           jobs-filename: "csit_jobs_beryllium.lst"
586       - integration-replace-block-text:
587           starting-regex: "'csit-list-carbon: >'"
588           ending-regex: "'csit-weekly-list-carbon: >'"
589           file-with-changes-to-insert: "'csit_jobs_carbon.lst'"
590           file-to-change: "'jjb/releng-defaults.yaml'"
591       - integration-replace-block-text:
592           starting-regex: "'csit-list-boron: >'"
593           ending-regex: "'csit-list-beryllium: >'"
594           file-with-changes-to-insert: "'csit_jobs_boron.lst'"
595           file-to-change: "'jjb/releng-defaults.yaml'"
596       - integration-replace-block-text:
597           starting-regex: "'csit-list-beryllium: >'"
598           ending-regex: "'# CSIT TESTS END SED MARKER'"
599           file-with-changes-to-insert: "'csit_jobs_beryllium.lst'"
600           file-to-change: "'jjb/releng-defaults.yaml'"
601       - shell: |
602           git status
603           git add jjb/releng-defaults.yaml
604       - opendaylight-infra-push-gerrit-patch:
605           project: "releng/builder"
606           gerrit-topic: "auto-update-csit-jobs"
607           gerrit-commit-message: "Auto Update CSIT Jobs to run"
608
609     publishers:
610       - email-notification:
611           email-recipients: '{email-recipients}'
612           email-prefix: '[releng]'
613       - opendaylight-infra-shiplogs:
614           maven-version: 'mvn33'