Configure email publishers in Functest jobs
[releng.git] / jjb / functest / xtesting.yaml
1 ---
2 - xtesting-containers: &xtesting-containers
3     name: 'xtesting-containers'
4     repo: '{repo}'
5     port: '{port}'
6     container: '{container}'
7     tag: '{tag}'
8
9 - xtesting-params: &xtesting-params
10     name: 'xtesting-params'
11     repo: 'opnfv'
12     port:
13     tag:
14       - latest:
15           from:
16           build_args:
17           branch: master
18           slave: lf-virtual1
19           dependency: 3.14
20       - xena:
21           from:
22           build_args:
23           branch: stable/xena
24           slave: lf-virtual1
25           dependency: 3.14
26       - wallaby:
27           from:
28           build_args:
29           branch: stable/wallaby
30           slave: lf-virtual1
31           dependency: 3.13
32       - leguer:
33           from:
34           build_args:
35           branch: stable/leguer
36           slave: lf-virtual1
37           dependency: 3.12
38       - kali:
39           from:
40           build_args:
41           branch: stable/kali
42           slave: lf-virtual1
43           dependency: 3.11
44       - jerma:
45           from:
46           build_args:
47           branch: stable/jerma
48           slave: lf-virtual1
49           dependency: 3.10
50
51 - xtesting-jobs: &xtesting-jobs
52     name: 'xtesting-jobs'
53     current-parameters: true
54
55 - parameter:
56     name: xtesting-slave
57     parameters:
58       - label:
59           name: slave
60           default: '{slave}'
61
62 - parameter:
63     name: xtesting-build_tag
64     parameters:
65       - random-string:
66           name: build_tag
67
68 - xtesting-run-containers: &xtesting-run-containers
69     name: 'xtesting-run-containers'
70     <<: *xtesting-containers
71     test: '{test}'
72     privileged: '{privileged}'
73     volumes: '{volumes}'
74     env: '{env}'
75     network: '{network}'
76
77 - builder:
78     name: xtesting-pull-containers
79     builders:
80       - shell: |
81           set +x
82           if [ "{repo}" = "_" ]; then
83             image={container}:{tag}
84           elif [ "{port}" = "None" ]; then
85             image={repo}/{container}:{tag}
86           else
87             image={repo}:{port}/{container}:{tag}
88           fi
89           sudo docker pull $image
90
91 - builder:
92     name: xtesting-run-containers
93     builders:
94       - shell: |
95           set +x
96           volumes=;
97           if [ "{volumes}" != "None" ]; then
98             for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
99               do volumes="-v $i $volumes"; done
100           fi
101           env=;
102           if [ "{env}" != "None" ]; then
103             for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
104               do env="-e $i $env"; done
105           fi
106           [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
107           if [ "{repo}" = "_" ]; then
108             image={container}:{tag}
109           elif [ "{port}" = "None" ]; then
110             image={repo}/{container}:{tag}
111           else
112             image={repo}:{port}/{container}:{tag}
113           fi
114           sudo docker run --rm \
115             --privileged={privileged} \
116             --network={network} \
117             $volumes \
118             $env \
119             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
120             -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
121             -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
122             -v /home/opnfv/xtesting/.boto:/root/.boto \
123             -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
124             -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
125             -e NODE_NAME=$slave \
126             -e BUILD_TAG=$BUILD_TAG \
127             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
128             $image run_tests -t {test} -p -r
129
130 - builder:
131     name: xtesting-remove-images
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           sudo docker rmi $image || true
143
144 - job-template:
145     name: 'xtesting-{repo}-{container}-{tag}-pull'
146     parameters:
147       - xtesting-slave:
148           slave: '{slave}'
149     builders:
150       - xtesting-pull-containers:
151           <<: *xtesting-containers
152
153 - project:
154     name: 'xtesting-opnfv-xtesting-pull'
155     <<: *xtesting-params
156     container: 'xtesting'
157     jobs:
158       - 'xtesting-{repo}-{container}-{tag}-pull'
159
160 - project:
161     name: 'xtesting-opnfv-xtesting-mts-pull'
162     <<: *xtesting-params
163     container: 'xtesting-mts'
164     jobs:
165       - 'xtesting-{repo}-{container}-{tag}-pull'
166
167 - job-template:
168     name: 'xtesting-{repo}-{container}-{tag}-rmi'
169     parameters:
170       - xtesting-slave:
171           slave: '{slave}'
172     builders:
173       - xtesting-remove-images:
174           <<: *xtesting-containers
175
176 - project:
177     name: 'xtesting-opnfv-xtesting-rmi'
178     <<: *xtesting-params
179     container: 'xtesting'
180     jobs:
181       - 'xtesting-{repo}-{container}-{tag}-rmi'
182
183 - project:
184     name: 'xtesting-opnfv-xtesting-mts-rmi'
185     <<: *xtesting-params
186     container: 'xtesting-mts'
187     jobs:
188       - 'xtesting-{repo}-{container}-{tag}-rmi'
189
190 - job-template:
191     name: 'xtesting-opnfv-xtesting-{tag}-{test}-run'
192     parameters:
193       - xtesting-slave:
194           slave: '{slave}'
195       - xtesting-build_tag:
196           build_tag: ''
197     builders:
198       - xtesting-run-containers:
199           <<: *xtesting-run-containers
200
201 - project:
202     name: 'xtesting-opnfv-xtesting'
203     <<: *xtesting-params
204     volumes:
205     env:
206     container: 'xtesting'
207     test:
208       - first
209       - second
210       - third
211       - fourth
212       - fifth
213       - sixth
214       - eighth
215     privileged: 'false'
216     network: bridge
217     exclude:
218       - tag: leguer
219         test: eighth
220       - tag: kali
221         test: eighth
222       - tag: jerma
223         test: eighth
224     jobs:
225       - 'xtesting-opnfv-xtesting-{tag}-{test}-run'
226
227 - job-template:
228     name: 'xtesting-opnfv-xtesting-mts-{tag}-{test}-run'
229     parameters:
230       - xtesting-slave:
231           slave: '{slave}'
232       - xtesting-build_tag:
233           build_tag: ''
234     builders:
235       - xtesting-run-containers:
236           <<: *xtesting-run-containers
237
238 - project:
239     name: 'xtesting-opnfv-xtesting-mts'
240     <<: *xtesting-params
241     volumes:
242     env:
243     container: 'xtesting-mts'
244     test:
245       - seventh
246     privileged: 'false'
247     network: bridge
248     jobs:
249       - 'xtesting-opnfv-xtesting-mts-{tag}-{test}-run'
250
251 - builder:
252     name: xtesting-zip
253     builders:
254       - shell: |
255           set +x
256           volumes=;
257           if [ "{volumes}" != "None" ]; then
258             for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
259               do volumes="-v $i $volumes"; done
260           fi
261           env=;
262           if [ "{env}" != "None" ]; then
263             for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
264               do env="-e $i $env"; done
265           fi
266           [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || 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             $volumes \
276             $env \
277             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
278             -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
279             -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
280             -v /home/opnfv/xtesting/.boto:/root/.boto \
281             -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
282             -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
283             -e BUILD_TAG=$BUILD_TAG \
284             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
285             $image zip_campaign
286
287 - job-template:
288     name: 'xtesting-{tag}-zip'
289     parameters:
290       - xtesting-slave:
291           slave: '{slave}'
292       - xtesting-build_tag:
293           build_tag: ''
294     builders:
295       - xtesting-zip:
296           <<: *xtesting-containers
297           volumes: '{volumes}'
298           env: '{env}'
299
300 - project:
301     name: 'xtesting-{tag}-zip'
302     <<: *xtesting-params
303     volumes:
304     env:
305     container: 'xtesting'
306     jobs:
307       - 'xtesting-{tag}-zip'
308
309 - job-template:
310     name: 'xtesting-{tag}-daily'
311     project-type: multijob
312     triggers:
313       - timed: '@daily'
314     parameters:
315       - xtesting-slave:
316           slave: '{slave}'
317       - xtesting-build_tag:
318           build_tag: ''
319     # PyYAML and yamllint differ here
320     # see https://github.com/yaml/pyyaml/issues/234
321     # yamllint disable rule:indentation
322     properties:
323       - build-blocker:
324           blocking-jobs:
325           - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
326     # yamllint enable rule:indentation
327     builders:
328       - multijob:
329           name: remove former images
330           projects:
331             - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
332               <<: *xtesting-jobs
333             - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
334               <<: *xtesting-jobs
335       - multijob:
336           name: pull containers
337           projects:
338             - name: 'xtesting-opnfv-xtesting-{tag}-pull'
339               <<: *xtesting-jobs
340             - name: 'xtesting-opnfv-xtesting-mts-{tag}-pull'
341               <<: *xtesting-jobs
342       - multijob:
343           name: opnfv/xtesting:{tag}
344           projects:
345             - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
346               <<: *xtesting-jobs
347             - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
348               <<: *xtesting-jobs
349             - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
350               <<: *xtesting-jobs
351             - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
352               <<: *xtesting-jobs
353             - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
354               <<: *xtesting-jobs
355             - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
356               <<: *xtesting-jobs
357             - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
358               <<: *xtesting-jobs
359       - multijob:
360           name: opnfv/xtesting-mts:{tag}
361           projects:
362             - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
363               <<: *xtesting-jobs
364       - multijob:
365           name: dump all campaign data
366           projects:
367             - name: 'xtesting-{tag}-zip'
368               <<: *xtesting-jobs
369     publishers:
370       - email:
371           recipients: cedric.ollivier@orange.com
372
373 - project:
374     name: 'xtesting-daily'
375     <<: *xtesting-params
376     jobs:
377       - 'xtesting-{tag}-daily'
378
379 - view:
380     name: xtesting
381     view-type: list
382     columns:
383       - status
384       - weather
385       - job
386       - last-success
387       - last-failure
388       - last-duration
389     regex: ^xtesting-[a-z0-9.]+-daily$
390
391 - xtesting-build-containers: &xtesting-build-containers
392     name: 'xtesting-build-containers'
393     <<: *xtesting-containers
394     ref_arg: '{ref_arg}'
395     path: '{path}'
396     build_args: '{build_args}'
397     from: '{from}'
398
399 - builder:
400     name: xtesting-build-containers
401     builders:
402       - shell: |
403           set +x
404           if [ "{repo}" = "_" ]; then
405             image={container}:{tag}
406           elif [ "{port}" = "None" ]; then
407             image={repo}/{container}:{tag}
408           else
409             image={repo}:{port}/{container}:{tag}
410           fi
411           build_args=""
412           if [ "{build_args}" != "None" ]; then
413             for i in $(echo {build_args} | tr -d '[]' |sed "s/, / /g" ); \
414               do build_args="--build-arg $i $build_args"; done
415           fi
416           if [ "{ref_arg}" != "None" ]; then
417             build_args="$build_args --build-arg {ref_arg}={ref}"
418           fi
419           cd {path}
420           if [ "{from}" != "None" ]; then
421               sed -i {from} Dockerfile
422           fi
423           sudo docker build $build_args \
424             --pull=false --no-cache --force-rm=true \
425             -t $image .
426
427 - scm:
428     name: xtesting-scm
429     scm:
430       - git:
431           url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
432           refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
433           branches:
434             - '{ref}'
435
436 - xtesting-dep: &xtesting-dep
437     name: 'xtesting-containers'
438     repo: '{repo}'
439     port: '{port}'
440     tag: '{tag}'
441     dependency: '{dependency}'
442
443 - builder:
444     name: xtesting-pull-dep-images
445     builders:
446       - shell: |
447           set +x
448           if [ "_" = "_" ]; then
449             image=alpine:{dependency}
450           elif [ "" = "None" ]; then
451             image=_/alpine:{dependency}
452           else
453             image=_:/alpine:{dependency}
454           fi
455           sudo docker pull $image || true
456
457 - builder:
458     name: xtesting-remove-dep-images
459     builders:
460       - shell: |
461           set +x
462           if [ "_" = "_" ]; then
463             image=alpine:{dependency}
464           elif [ "" = "None" ]; then
465             image=_/alpine:{dependency}
466           else
467             image=_:/alpine:{dependency}
468           fi
469           sudo docker rmi $image || true
470
471 - job-template:
472     name: 'xtesting-{repo}-{tag}-dep-pull'
473     parameters:
474       - xtesting-slave:
475           slave: '{slave}'
476     builders:
477       - xtesting-pull-dep-images:
478           <<: *xtesting-dep
479
480 - project:
481     name: 'xtesting-{repo}-{tag}-dep-pull'
482     <<: *xtesting-params
483     jobs:
484       - 'xtesting-{repo}-{tag}-dep-pull'
485
486 - job-template:
487     name: 'xtesting-{repo}-{tag}-dep-rmi'
488     parameters:
489       - xtesting-slave:
490           slave: '{slave}'
491     builders:
492       - xtesting-remove-dep-images:
493           <<: *xtesting-dep
494
495 - project:
496     name: 'xtesting-{repo}-{tag}-dep-rmi'
497     <<: *xtesting-params
498     jobs:
499       - 'xtesting-{repo}-{tag}-dep-rmi'
500
501 - builder:
502     name: xtesting-tox
503     builders:
504       - shell: |
505           set +x
506           sudo apt-get update && \
507           sudo DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y
508           sudo DEBIAN_FRONTEND=noninteractive \
509           apt-get install software-properties-common gpg -y
510           sudo add-apt-repository -y ppa:deadsnakes/ppa
511           sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive \
512           apt-get install \
513             python3.9 python3.9-dev python3.9-distutils \
514             python3.8 python3.8-dev python3.8-distutils \
515             python3.7 python3.7-dev python3.6 python3.6-dev \
516             python python-dev python3-pip enchant -y
517           sudo pip3 install tox tox-pip-version
518
519           tox
520
521 - job-template:
522     name: 'xtesting-{tag}-tox'
523     scm:
524       - xtesting-scm:
525           ref: $GERRIT_REFSPEC
526     triggers:
527       - xtesting-patchset-created:
528           branch: '{branch}'
529     parameters:
530       - xtesting-slave:
531           slave: '{slave}'
532     builders:
533       - xtesting-tox:
534
535 - project:
536     name: xtesting-tox
537     <<: *xtesting-params
538     jobs:
539       - 'xtesting-{tag}-tox'
540
541 - job-template:
542     name: 'xtesting-{repo}-{container}-{tag}-gate'
543     parameters:
544       - xtesting-slave:
545           slave: '{slave}'
546     scm:
547       - xtesting-scm:
548           ref: $GERRIT_REFSPEC
549     builders:
550       - xtesting-build-containers:
551           <<: *xtesting-build-containers
552           ref: $GERRIT_REFSPEC
553           build_args: '{build_args}'
554
555 - project:
556     name: xtesting-opnfv-xtesting-{tag}-gate
557     <<: *xtesting-params
558     container: xtesting
559     ref_arg: BRANCH
560     path: docker/core
561     jobs:
562       - 'xtesting-{repo}-{container}-{tag}-gate'
563
564 - project:
565     name: xtesting-opnfv-xtesting-mts-{tag}-gate
566     <<: *xtesting-params
567     container: xtesting-mts
568     ref_arg: BRANCH
569     path: docker/mts
570     jobs:
571       - 'xtesting-{repo}-{container}-{tag}-gate'
572
573 - trigger:
574     name: xtesting-patchset-created
575     triggers:
576       - gerrit:
577           trigger-on:
578             - patchset-created-event
579             - comment-added-contains-event:
580                 comment-contains-value: 'recheck'
581             - comment-added-contains-event:
582                 comment-contains-value: 'reverify'
583           projects:
584             - project-compare-type: 'ANT'
585               project-pattern: 'functest-xtesting'
586               branches:
587                 - branch-compare-type: 'ANT'
588                   branch-pattern: '**/{branch}'
589
590 - job-template:
591     name: 'xtesting-{tag}-review'
592     project-type: multijob
593     triggers:
594       - xtesting-patchset-created:
595           branch: '{branch}'
596     parameters:
597       - xtesting-slave:
598           slave: '{slave}'
599       - xtesting-build_tag:
600           build_tag: ''
601     # PyYAML and yamllint differ here
602     # see https://github.com/yaml/pyyaml/issues/234
603     # yamllint disable rule:indentation
604     properties:
605       - build-blocker:
606           blocking-jobs:
607           - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
608     # yamllint enable rule:indentation
609     builders:
610       - multijob:
611           name: remove former images
612           projects:
613             - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
614               <<: *xtesting-jobs
615             - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
616               <<: *xtesting-jobs
617       - multijob:
618           name: remove dependency
619           projects:
620             - name: 'xtesting-{repo}-{tag}-dep-rmi'
621               <<: *xtesting-jobs
622       - multijob:
623           name: pull dependency
624           projects:
625             - name: 'xtesting-{repo}-{tag}-dep-pull'
626               <<: *xtesting-jobs
627       - multijob:
628           name: opnfv/xtesting
629           projects:
630             - name: 'xtesting-opnfv-xtesting-{tag}-gate'
631               <<: *xtesting-jobs
632       - multijob:
633           name: opnfv/xtesting-mts
634           projects:
635             - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
636               <<: *xtesting-jobs
637       - multijob:
638           name: opnfv/xtesting:{tag}
639           projects:
640             - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
641               <<: *xtesting-jobs
642             - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
643               <<: *xtesting-jobs
644             - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
645               <<: *xtesting-jobs
646             - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
647               <<: *xtesting-jobs
648             - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
649               <<: *xtesting-jobs
650             - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
651               <<: *xtesting-jobs
652             - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
653               <<: *xtesting-jobs
654       - multijob:
655           name: opnfv/xtesting-mts:{tag}
656           projects:
657             - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
658               <<: *xtesting-jobs
659     publishers:
660       - email:
661           recipients: cedric.ollivier@orange.com
662
663 - project:
664     name: 'xtesting-review'
665     <<: *xtesting-params
666     jobs:
667       - 'xtesting-{tag}-review'
668
669 - view:
670     name: xtesting-review
671     view-type: list
672     columns:
673       - status
674       - weather
675       - job
676       - last-success
677       - last-failure
678       - last-duration
679     regex: ^xtesting-[a-z0-9.]+-review$
680
681 - view:
682     name: xtesting-tox
683     view-type: list
684     columns:
685       - status
686       - weather
687       - job
688       - last-success
689       - last-failure
690       - last-duration
691     regex: ^xtesting-[a-z0-9.]+-tox$
692
693 - builder:
694     name: xtesting-push-containers
695     builders:
696       - shell: |
697           set +x
698           if [ "{repo}" = "_" ]; then
699             image={container}:{tag}
700           elif [ "{port}" = "None" ]; then
701             image={repo}/{container}:{tag}
702           else
703             image={repo}:{port}/{container}:{tag}
704           fi
705           sudo docker push $image
706
707 - trigger:
708     name: xtesting-commit
709     triggers:
710       - pollscm:
711           cron: "*/30 * * * *"
712
713 - job-template:
714     name: 'xtesting-{repo}-{container}-{tag}-build'
715     parameters:
716       - xtesting-slave:
717           slave: '{slave}'
718     scm:
719       - xtesting-scm:
720           ref: '{branch}'
721     builders:
722       - xtesting-build-containers:
723           <<: *xtesting-build-containers
724           ref: '{branch}'
725           build_args: '{build_args}'
726       - xtesting-push-containers:
727           <<: *xtesting-build-containers
728           ref: '{branch}'
729
730 - project:
731     name: xtesting-opnfv-xtesting-{tag}-build
732     <<: *xtesting-params
733     container: xtesting
734     ref_arg: BRANCH
735     path: docker/core
736     jobs:
737       - 'xtesting-{repo}-{container}-{tag}-build'
738
739 - project:
740     name: xtesting-opnfv-xtesting-mts-{tag}-build
741     <<: *xtesting-params
742     container: xtesting-mts
743     ref_arg: BRANCH
744     path: docker/mts
745     jobs:
746       - 'xtesting-{repo}-{container}-{tag}-build'
747
748 - job-template:
749     name: 'xtesting-{tag}-docker'
750     project-type: multijob
751     triggers:
752       - xtesting-commit
753     scm:
754       - xtesting-scm:
755           ref: '{branch}'
756     parameters:
757       - xtesting-slave:
758           slave: '{slave}'
759     # PyYAML and yamllint differ here
760     # see https://github.com/yaml/pyyaml/issues/234
761     # yamllint disable rule:indentation
762     properties:
763       - build-blocker:
764           blocking-jobs:
765           - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
766     # yamllint enable rule:indentation
767     builders:
768       - multijob:
769           name: remove dependency
770           projects:
771             - name: 'xtesting-{repo}-{tag}-dep-rmi'
772               <<: *xtesting-jobs
773       - multijob:
774           name: pull dependency
775           projects:
776             - name: 'xtesting-{repo}-{tag}-dep-pull'
777               <<: *xtesting-jobs
778       - multijob:
779           name: opnfv/xtesting
780           projects:
781             - name: 'xtesting-opnfv-xtesting-{tag}-build'
782               <<: *xtesting-jobs
783       - multijob:
784           name: opnfv/xtesting-mts
785           projects:
786             - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
787               <<: *xtesting-jobs
788     publishers:
789       - email:
790           recipients: cedric.ollivier@orange.com
791
792 - builder:
793     name: xtesting-trivy
794     builders:
795       - shell: |
796           sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive \
797           apt-get install curl -y
798
799           curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
800           if [ "{repo}" = "_" ]; then
801             image={container}:{tag}
802           elif [ "{port}" = "None" ]; then
803             image={repo}/{container}:{tag}
804           else
805             image={repo}:{port}/{container}:{tag}
806           fi
807           ./trivy --exit-code 1 $image
808
809 - job-template:
810     name: 'xtesting-{repo}-{container}-{tag}-trivy'
811     triggers:
812       - timed: '@daily'
813     parameters:
814       - xtesting-slave:
815           slave: '{slave}'
816     builders:
817       - xtesting-trivy:
818           <<: *xtesting-containers
819     publishers:
820       - email:
821           recipients: cedric.ollivier@orange.com
822
823 - project:
824     name: 'xtesting-opnfv-xtesting-trivy'
825     <<: *xtesting-params
826     container: 'xtesting'
827     jobs:
828       - 'xtesting-{repo}-{container}-{tag}-trivy'
829
830 - project:
831     name: 'xtesting-opnfv-xtesting-mts-trivy'
832     <<: *xtesting-params
833     container: 'xtesting-mts'
834     jobs:
835       - 'xtesting-{repo}-{container}-{tag}-trivy'
836
837 - project:
838     name: 'xtesting'
839     <<: *xtesting-params
840     jobs:
841       - 'xtesting-{tag}-docker'
842
843 - view:
844     name: xtesting-docker
845     view-type: list
846     columns:
847       - status
848       - weather
849       - job
850       - last-success
851       - last-failure
852       - last-duration
853     regex: ^xtesting-[a-z0-9.]+-docker$
854
855 - view:
856     name: xtesting-trivy
857     view-type: list
858     columns:
859       - status
860       - weather
861       - job
862       - last-success
863       - last-failure
864       - last-duration
865     regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$