Precise arch when building xtesting containers
[releng.git] / jjb / functest / xtesting.yaml
1 ---
2 - xtesting-jobs: &xtesting-jobs
3     name: 'xtesting-jobs'
4     current-parameters: true
5
6 - xtesting-params: &xtesting-params
7     name: 'xtesting-params'
8     repo: 'opnfv'
9     port:
10     tag:
11       - latest:
12           branch: master
13           slave: lf-virtual1
14       - kali:
15           branch: stable/kali
16           slave: lf-virtual1
17       - jerma:
18           branch: stable/jerma
19           slave: lf-virtual1
20       - iruya:
21           branch: stable/iruya
22           slave: lf-virtual1
23       - hunter:
24           branch: stable/hunter
25           slave: lf-virtual1
26
27 - parameter:
28     name: xtesting-slave
29     parameters:
30       - label:
31           name: slave
32           default: '{slave}'
33
34 - parameter:
35     name: xtesting-build_tag
36     parameters:
37       - random-string:
38           name: build_tag
39
40 - parameter:
41     name: xtesting-branch
42     parameters:
43       - string:
44           name: branch
45           default: '{branch}'
46
47 - parameter:
48     name: xtesting-DEBUG
49     parameters:
50       - string:
51           name: DEBUG
52           default: 'true'
53
54 - xtesting-containers: &xtesting-containers
55     name: 'xtesting-containers'
56     repo: '{repo}'
57     port: '{port}'
58     container: '{container}'
59     tag: '{tag}'
60
61 - xtesting-run-containers: &xtesting-run-containers
62     name: 'xtesting-run-containers'
63     <<: *xtesting-containers
64     test: '{test}'
65     privileged: '{privileged}'
66     network: '{network}'
67
68 - builder:
69     name: xtesting-pull-containers
70     builders:
71       - shell: |
72           set +x
73           if [ "{repo}" = "_" ]; then
74             image={container}:{tag}
75           elif [ "{port}" = "None" ]; then
76             image={repo}/{container}:{tag}
77           else
78             image={repo}:{port}/{container}:{tag}
79           fi
80           sudo docker pull $image
81
82 - builder:
83     name: xtesting-run-containers
84     builders:
85       - shell: |
86           set +x
87           [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/* || true
88           if [ "{repo}" = "_" ]; then
89             image={container}:{tag}
90           elif [ "{port}" = "None" ]; then
91             image={repo}/{container}:{tag}
92           else
93             image={repo}:{port}/{container}:{tag}
94           fi
95           sudo docker run --rm \
96             --privileged={privileged} \
97             --network={network} \
98             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
99             -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
100             -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
101             -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
102             -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
103             -e NODE_NAME=$slave \
104             -e BUILD_TAG=$BUILD_TAG \
105             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
106             -e DEBUG=$DEBUG \
107             -v /home/opnfv/xtesting/.boto:/root/.boto \
108             $image run_tests -t {test} -p -r
109
110 - builder:
111     name: xtesting-remove-images
112     builders:
113       - shell: |
114           set +x
115           if [ "{repo}" = "_" ]; then
116             image={container}:{tag}
117           elif [ "{port}" = "None" ]; then
118             image={repo}/{container}:{tag}
119           else
120             image={repo}:{port}/{container}:{tag}
121           fi
122           sudo docker rmi $image || true
123
124 - xtesting-build-containers: &xtesting-build-containers
125     name: 'xtesting-build-containers'
126     <<: *xtesting-containers
127     ref_arg: '{ref_arg}'
128     path: '{path}'
129
130 - builder:
131     name: xtesting-build-containers
132     builders:
133       - shell: |
134           set +x
135           if [ "{repo}" = "_" ]; then
136             image={container}:{tag}
137           elif [ "{port}" = "None" ]; then
138             image={repo}/{container}:{tag}
139           else
140             image={repo}:{port}/{container}:{tag}
141           fi
142           if [ "{ref_arg}" = "None" ]; then
143             build_arg=""
144           else
145             build_arg="--build-arg {ref_arg}={ref}"
146           fi
147           cd {path}
148           sudo docker build $build_arg \
149             --pull=false --no-cache --force-rm=true \
150             -t $image .
151
152 - scm:
153     name: xtesting-scm
154     scm:
155       - git:
156           url: https://gerrit.opnfv.org/gerrit/functest-xtesting
157           refspec: '+refs/changes/*:refs/changes/*'
158           branches:
159             - '{ref}'
160
161 - job-template:
162     name: 'xtesting-{repo}-{container}-{tag}-pull'
163     parameters:
164       - xtesting-slave:
165           slave: '{slave}'
166     builders:
167       - xtesting-pull-containers:
168           <<: *xtesting-containers
169
170 - project:
171     name: 'xtesting-opnfv-xtesting-pull'
172     <<: *xtesting-params
173     container: 'xtesting'
174     jobs:
175       - 'xtesting-{repo}-{container}-{tag}-pull'
176
177 - project:
178     name: 'xtesting-opnfv-xtesting-mts-pull'
179     <<: *xtesting-params
180     container: 'xtesting-mts'
181     jobs:
182       - 'xtesting-{repo}-{container}-{tag}-pull'
183
184 - job-template:
185     name: 'xtesting-{repo}-{container}-{tag}-rmi'
186     parameters:
187       - xtesting-slave:
188           slave: '{slave}'
189     builders:
190       - xtesting-remove-images:
191           <<: *xtesting-containers
192
193 - project:
194     name: 'xtesting-opnfv-xtesting-rmi'
195     <<: *xtesting-params
196     container: 'xtesting'
197     jobs:
198       - 'xtesting-{repo}-{container}-{tag}-rmi'
199
200 - project:
201     name: 'xtesting-opnfv-xtesting-mts-rmi'
202     <<: *xtesting-params
203     container: 'xtesting-mts'
204     jobs:
205       - 'xtesting-{repo}-{container}-{tag}-rmi'
206
207 - job-template:
208     name: 'xtesting-{repo}-{container}-{tag}-{test}-run'
209     parameters:
210       - xtesting-slave:
211           slave: '{slave}'
212       - xtesting-build_tag:
213           build_tag: ''
214       - xtesting-DEBUG:
215           DEBUG: 'true'
216     builders:
217       - xtesting-run-containers:
218           <<: *xtesting-run-containers
219
220 - project:
221     name: 'xtesting-opnfv-xtesting'
222     <<: *xtesting-params
223     container: 'xtesting'
224     test:
225       - first
226       - second
227       - third
228       - fourth
229       - fifth
230       - sixth
231     exclude:
232       - tag: hunter
233         test: sixth
234       - tag: iruya
235         test: sixth
236     privileged: 'false'
237     network: bridge
238     jobs:
239       - 'xtesting-{repo}-{container}-{tag}-{test}-run'
240
241 - project:
242     name: 'xtesting-opnfv-xtesting-mts'
243     <<: *xtesting-params
244     container: 'xtesting-mts'
245     test:
246       - seventh
247     exclude:
248       - tag: hunter
249         test: seventh
250       - tag: iruya
251         test: seventh
252       - tag: jerma
253         test: seventh
254       - tag: kali
255         test: seventh
256     privileged: 'false'
257     network: bridge
258     jobs:
259       - 'xtesting-{repo}-{container}-{tag}-{test}-run'
260
261 - builder:
262     name: xtesting-zip
263     builders:
264       - shell: |
265           set +x
266           [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/* || true
267           if [ "{repo}" = "_" ]; then
268             image={container}:{tag}
269           elif [ "{port}" = "None" ]; then
270             image={repo}/{container}:{tag}
271           else
272             image={repo}:{port}/{container}:{tag}
273           fi
274           sudo docker run --rm \
275             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
276             -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
277             -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
278             -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
279             -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
280             -e BUILD_TAG=$BUILD_TAG \
281             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
282             -e DEBUG=$DEBUG \
283             -v /home/opnfv/xtesting/.boto:/root/.boto \
284             $image zip_campaign
285
286 - job-template:
287     name: 'xtesting-{tag}-zip'
288     parameters:
289       - xtesting-slave:
290           slave: '{slave}'
291       - xtesting-build_tag:
292           build_tag: ''
293       - xtesting-DEBUG:
294           DEBUG: 'true'
295     builders:
296       - xtesting-zip:
297           <<: *xtesting-containers
298
299 - project:
300     name: 'xtesting-{tag}-zip'
301     <<: *xtesting-params
302     container: 'xtesting'
303     jobs:
304       - 'xtesting-{tag}-zip'
305
306 - job-template:
307     name: 'xtesting-{tag}-daily'
308     project-type: multijob
309     triggers:
310       - timed: '@daily'
311     parameters:
312       - xtesting-slave:
313           slave: '{slave}'
314       - xtesting-build_tag:
315           build_tag: ''
316       - xtesting-DEBUG:
317           DEBUG: 'true'
318     properties:
319       - build-blocker:
320           use-build-blocker: true
321           blocking-level: 'NODE'
322           blocking-jobs:
323             - '^xtesting-{tag}-(daily|check|gate)$'
324     builders:
325       - multijob:
326           name: remove former images
327           projects:
328             - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
329               <<: *xtesting-jobs
330             - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
331               <<: *xtesting-jobs
332       - multijob:
333           name: pull containers
334           projects:
335             - name: 'xtesting-opnfv-xtesting-{tag}-pull'
336               <<: *xtesting-jobs
337             - name: 'xtesting-opnfv-xtesting-mts-{tag}-pull'
338               <<: *xtesting-jobs
339       - multijob:
340           name: opnfv/xtesting:{tag}
341           projects:
342             - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
343               <<: *xtesting-jobs
344             - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
345               <<: *xtesting-jobs
346             - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
347               <<: *xtesting-jobs
348             - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
349               <<: *xtesting-jobs
350             - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
351               <<: *xtesting-jobs
352             - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
353               <<: *xtesting-jobs
354       - multijob:
355           name: opnfv/xtesting-mts:{tag}
356           projects:
357             - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
358               <<: *xtesting-jobs
359       - multijob:
360           name: dump all campaign data
361           projects:
362             - name: 'xtesting-{tag}-zip'
363               <<: *xtesting-jobs
364
365 - job-template:
366     name: 'xtesting-{repo}-{container}-{tag}-gate'
367     parameters:
368       - xtesting-slave:
369           slave: '{slave}'
370     scm:
371       - xtesting-scm:
372           ref: $GERRIT_REFSPEC
373     builders:
374       - xtesting-build-containers:
375           <<: *xtesting-build-containers
376           ref: $GERRIT_REFSPEC
377
378 - job-template:
379     name: 'xtesting-{repo}-{container}-{tag}-check'
380     parameters:
381       - xtesting-slave:
382           slave: '{slave}'
383       - xtesting-branch:
384           branch: '{branch}'
385     scm:
386       - xtesting-scm:
387           ref: $branch
388     builders:
389       - xtesting-build-containers:
390           <<: *xtesting-build-containers
391           ref: $branch
392
393 - project:
394     name: 'xtesting-_-alpine-3.12-rmi'
395     repo: _
396     port:
397     container: alpine
398     tag: '3.12'
399     slave: master
400     jobs:
401       - 'xtesting-{repo}-{container}-{tag}-rmi'
402
403 - project:
404     name: 'xtesting-_-alpine-3.12-pull'
405     repo: _
406     port:
407     container: alpine
408     tag: '3.12'
409     slave: master
410     jobs:
411       - 'xtesting-{repo}-{container}-{tag}-pull'
412
413 - project:
414     name: xtesting-opnfv-xtesting-{tag}-build
415     <<: *xtesting-params
416     container: xtesting
417     ref_arg: BRANCH
418     path: docker/core
419     jobs:
420       - 'xtesting-{repo}-{container}-{tag}-gate'
421       - 'xtesting-{repo}-{container}-{tag}-check'
422
423 - project:
424     name: xtesting-opnfv-xtesting-mts-{tag}-build
425     <<: *xtesting-params
426     container: xtesting-mts
427     ref_arg: BRANCH
428     path: docker/mts
429     jobs:
430       - 'xtesting-{repo}-{container}-{tag}-gate'
431       - 'xtesting-{repo}-{container}-{tag}-check'
432
433 - job-template:
434     name: 'xtesting-{tag}-check'
435     project-type: multijob
436     parameters:
437       - xtesting-slave:
438           slave: '{slave}'
439       - xtesting-build_tag:
440           build_tag: ''
441       - xtesting-branch:
442           branch: '{branch}'
443       - xtesting-DEBUG:
444           DEBUG: 'true'
445     properties:
446       - build-blocker:
447           use-build-blocker: true
448           blocking-level: 'NODE'
449           blocking-jobs:
450             - '^xtesting-{tag}-(daily|check|gate)$'
451     builders:
452       - multijob:
453           name: remove former images
454           projects:
455             - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
456               <<: *xtesting-jobs
457             - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
458               <<: *xtesting-jobs
459       - multijob:
460           name: remove dependencies
461           projects:
462             - name: 'xtesting-_-alpine-3.12-rmi'
463               <<: *xtesting-jobs
464       - multijob:
465           name: pull dependencies
466           projects:
467             - name: 'xtesting-_-alpine-3.12-pull'
468               <<: *xtesting-jobs
469       - multijob:
470           name: opnfv/xtesting
471           projects:
472             - name: 'xtesting-opnfv-xtesting-{tag}-check'
473               <<: *xtesting-jobs
474       - multijob:
475           name: opnfv/xtesting-mts
476           projects:
477             - name: 'xtesting-opnfv-xtesting-mts-{tag}-check'
478               <<: *xtesting-jobs
479       - multijob:
480           name: opnfv/xtesting:{tag}
481           projects:
482             - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
483               <<: *xtesting-jobs
484             - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
485               <<: *xtesting-jobs
486             - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
487               <<: *xtesting-jobs
488             - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
489               <<: *xtesting-jobs
490             - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
491               <<: *xtesting-jobs
492             - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
493               <<: *xtesting-jobs
494       - multijob:
495           name: opnfv/xtesting-mts:{tag}
496           projects:
497             - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
498               <<: *xtesting-jobs
499
500 - trigger:
501     name: xtesting-patchset-created
502     triggers:
503       - gerrit:
504           server-name: 'gerrit.opnfv.org'
505           trigger-on:
506             - patchset-created-event
507             - comment-added-contains-event:
508                 comment-contains-value: 'recheck'
509             - comment-added-contains-event:
510                 comment-contains-value: 'reverify'
511           projects:
512             - project-compare-type: 'ANT'
513               project-pattern: 'functest-xtesting'
514               branches:
515                 - branch-compare-type: 'ANT'
516                   branch-pattern: '**/{branch}'
517           skip-vote:
518             successful: false
519             failed: false
520             unstable: false
521             notbuilt: false
522
523 - job-template:
524     name: 'xtesting-{tag}-gate'
525     project-type: multijob
526     triggers:
527       - xtesting-patchset-created:
528           branch: '{branch}'
529     parameters:
530       - xtesting-slave:
531           slave: '{slave}'
532       - xtesting-build_tag:
533           build_tag: ''
534       - xtesting-DEBUG:
535           DEBUG: 'true'
536     properties:
537       - build-blocker:
538           use-build-blocker: true
539           blocking-level: 'NODE'
540           blocking-jobs:
541             - '^xtesting-{tag}-(daily|check|gate)$'
542     builders:
543       - multijob:
544           name: remove former images
545           projects:
546             - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
547               <<: *xtesting-jobs
548             - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
549               <<: *xtesting-jobs
550       - multijob:
551           name: remove dependencies
552           projects:
553             - name: 'xtesting-_-alpine-3.12-rmi'
554               <<: *xtesting-jobs
555       - multijob:
556           name: pull dependencies
557           projects:
558             - name: 'xtesting-_-alpine-3.12-pull'
559               <<: *xtesting-jobs
560       - multijob:
561           name: opnfv/xtesting
562           projects:
563             - name: 'xtesting-opnfv-xtesting-{tag}-gate'
564               <<: *xtesting-jobs
565       - multijob:
566           name: opnfv/xtesting-mts
567           projects:
568             - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
569               <<: *xtesting-jobs
570       - multijob:
571           name: opnfv/xtesting:{tag}
572           projects:
573             - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
574               <<: *xtesting-jobs
575             - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
576               <<: *xtesting-jobs
577             - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
578               <<: *xtesting-jobs
579             - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
580               <<: *xtesting-jobs
581             - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
582               <<: *xtesting-jobs
583             - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
584               <<: *xtesting-jobs
585       - multijob:
586           name: opnfv/xtesting-mts:{tag}
587           projects:
588             - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
589               <<: *xtesting-jobs
590
591 - project:
592     name: 'xtesting'
593     <<: *xtesting-params
594     jobs:
595       - 'xtesting-{tag}-daily'
596       - 'xtesting-{tag}-check'
597       - 'xtesting-{tag}-gate'
598
599 - view:
600     name: xtesting
601     view-type: list
602     columns:
603       - status
604       - weather
605       - job
606       - last-success
607       - last-failure
608       - last-duration
609     regex: ^xtesting-[a-z]+-daily$
610
611 - view:
612     name: xtesting-gate
613     view-type: list
614     columns:
615       - status
616       - weather
617       - job
618       - last-success
619       - last-failure
620       - last-duration
621     regex: ^xtesting-[a-z]+-gate$