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