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