efe7daab7d691ba6c51a3de9eabe394babfd73b3
[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-ext:
371           failure: false
372           first-failure: true
373           fixed: true
374           recipients: cedric.ollivier@orange.com
375
376 - project:
377     name: 'xtesting-daily'
378     <<: *xtesting-params
379     jobs:
380       - 'xtesting-{tag}-daily'
381
382 - view:
383     name: xtesting
384     view-type: list
385     columns:
386       - status
387       - weather
388       - job
389       - last-success
390       - last-failure
391       - last-duration
392     regex: ^xtesting-[a-z0-9.]+-daily$
393
394 - xtesting-build-containers: &xtesting-build-containers
395     name: 'xtesting-build-containers'
396     <<: *xtesting-containers
397     ref_arg: '{ref_arg}'
398     path: '{path}'
399     build_args: '{build_args}'
400     from: '{from}'
401
402 - builder:
403     name: xtesting-build-containers
404     builders:
405       - shell: |
406           set +x
407           if [ "{repo}" = "_" ]; then
408             image={container}:{tag}
409           elif [ "{port}" = "None" ]; then
410             image={repo}/{container}:{tag}
411           else
412             image={repo}:{port}/{container}:{tag}
413           fi
414           build_args=""
415           if [ "{build_args}" != "None" ]; then
416             for i in $(echo {build_args} | tr -d '[]' |sed "s/, / /g" ); \
417               do build_args="--build-arg $i $build_args"; done
418           fi
419           if [ "{ref_arg}" != "None" ]; then
420             build_args="$build_args --build-arg {ref_arg}={ref}"
421           fi
422           cd {path}
423           if [ "{from}" != "None" ]; then
424               sed -i {from} Dockerfile
425           fi
426           sudo docker build $build_args \
427             --pull=false --no-cache --force-rm=true \
428             -t $image .
429
430 - scm:
431     name: xtesting-scm
432     scm:
433       - git:
434           url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
435           refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
436           branches:
437             - '{ref}'
438
439 - xtesting-dep: &xtesting-dep
440     name: 'xtesting-containers'
441     repo: '{repo}'
442     port: '{port}'
443     tag: '{tag}'
444     dependency: '{dependency}'
445
446 - builder:
447     name: xtesting-pull-dep-images
448     builders:
449       - shell: |
450           set +x
451           if [ "_" = "_" ]; then
452             image=alpine:{dependency}
453           elif [ "" = "None" ]; then
454             image=_/alpine:{dependency}
455           else
456             image=_:/alpine:{dependency}
457           fi
458           sudo docker pull $image || true
459
460 - builder:
461     name: xtesting-remove-dep-images
462     builders:
463       - shell: |
464           set +x
465           if [ "_" = "_" ]; then
466             image=alpine:{dependency}
467           elif [ "" = "None" ]; then
468             image=_/alpine:{dependency}
469           else
470             image=_:/alpine:{dependency}
471           fi
472           sudo docker rmi $image || true
473
474 - job-template:
475     name: 'xtesting-{repo}-{tag}-dep-pull'
476     parameters:
477       - xtesting-slave:
478           slave: '{slave}'
479     builders:
480       - xtesting-pull-dep-images:
481           <<: *xtesting-dep
482
483 - project:
484     name: 'xtesting-{repo}-{tag}-dep-pull'
485     <<: *xtesting-params
486     jobs:
487       - 'xtesting-{repo}-{tag}-dep-pull'
488
489 - job-template:
490     name: 'xtesting-{repo}-{tag}-dep-rmi'
491     parameters:
492       - xtesting-slave:
493           slave: '{slave}'
494     builders:
495       - xtesting-remove-dep-images:
496           <<: *xtesting-dep
497
498 - project:
499     name: 'xtesting-{repo}-{tag}-dep-rmi'
500     <<: *xtesting-params
501     jobs:
502       - 'xtesting-{repo}-{tag}-dep-rmi'
503
504 - builder:
505     name: xtesting-tox
506     builders:
507       - shell: |
508           set +x
509           sudo apt-get -o DPkg::Lock::Timeout=300 update && \
510           sudo DEBIAN_FRONTEND=noninteractive apt-get \
511             -o DPkg::Lock::Timeout=300 dist-upgrade -y
512           sudo DEBIAN_FRONTEND=noninteractive \
513           apt-get -o DPkg::Lock::Timeout=300 install software-properties-common gpg -y
514           sudo add-apt-repository -y ppa:deadsnakes/ppa
515           sudo apt-get -o DPkg::Lock::Timeout=300 update && \
516           sudo DEBIAN_FRONTEND=noninteractive apt-get \
517             -o DPkg::Lock::Timeout=300 install \
518             python3.9 python3.9-dev python3.9-distutils \
519             python3.8 python3.8-dev python3.8-distutils \
520             python3.7 python3.7-dev python3.6 python3.6-dev \
521             python python-dev python3-pip enchant -y
522           sudo pip3 install tox tox-pip-version
523
524           tox
525
526 - job-template:
527     name: 'xtesting-{tag}-tox'
528     scm:
529       - xtesting-scm:
530           ref: $GERRIT_REFSPEC
531     triggers:
532       - xtesting-patchset-created:
533           branch: '{branch}'
534     parameters:
535       - xtesting-slave:
536           slave: '{slave}'
537     builders:
538       - xtesting-tox:
539
540 - project:
541     name: xtesting-tox
542     <<: *xtesting-params
543     jobs:
544       - 'xtesting-{tag}-tox'
545
546 - job-template:
547     name: 'xtesting-{repo}-{container}-{tag}-gate'
548     parameters:
549       - xtesting-slave:
550           slave: '{slave}'
551     scm:
552       - xtesting-scm:
553           ref: $GERRIT_REFSPEC
554     builders:
555       - xtesting-build-containers:
556           <<: *xtesting-build-containers
557           ref: $GERRIT_REFSPEC
558           build_args: '{build_args}'
559
560 - project:
561     name: xtesting-opnfv-xtesting-{tag}-gate
562     <<: *xtesting-params
563     container: xtesting
564     ref_arg: BRANCH
565     path: docker/core
566     jobs:
567       - 'xtesting-{repo}-{container}-{tag}-gate'
568
569 - project:
570     name: xtesting-opnfv-xtesting-mts-{tag}-gate
571     <<: *xtesting-params
572     container: xtesting-mts
573     ref_arg: BRANCH
574     path: docker/mts
575     jobs:
576       - 'xtesting-{repo}-{container}-{tag}-gate'
577
578 - trigger:
579     name: xtesting-patchset-created
580     triggers:
581       - gerrit:
582           trigger-on:
583             - patchset-created-event
584             - comment-added-contains-event:
585                 comment-contains-value: 'recheck'
586             - comment-added-contains-event:
587                 comment-contains-value: 'reverify'
588           projects:
589             - project-compare-type: 'ANT'
590               project-pattern: 'functest-xtesting'
591               branches:
592                 - branch-compare-type: 'ANT'
593                   branch-pattern: '**/{branch}'
594
595 - job-template:
596     name: 'xtesting-{tag}-review'
597     project-type: multijob
598     triggers:
599       - xtesting-patchset-created:
600           branch: '{branch}'
601     parameters:
602       - xtesting-slave:
603           slave: '{slave}'
604       - xtesting-build_tag:
605           build_tag: ''
606     # PyYAML and yamllint differ here
607     # see https://github.com/yaml/pyyaml/issues/234
608     # yamllint disable rule:indentation
609     properties:
610       - build-blocker:
611           blocking-jobs:
612           - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
613     # yamllint enable rule:indentation
614     builders:
615       - multijob:
616           name: remove former images
617           projects:
618             - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
619               <<: *xtesting-jobs
620             - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
621               <<: *xtesting-jobs
622       - multijob:
623           name: remove dependency
624           projects:
625             - name: 'xtesting-{repo}-{tag}-dep-rmi'
626               <<: *xtesting-jobs
627       - multijob:
628           name: pull dependency
629           projects:
630             - name: 'xtesting-{repo}-{tag}-dep-pull'
631               <<: *xtesting-jobs
632       - multijob:
633           name: opnfv/xtesting
634           projects:
635             - name: 'xtesting-opnfv-xtesting-{tag}-gate'
636               <<: *xtesting-jobs
637       - multijob:
638           name: opnfv/xtesting-mts
639           projects:
640             - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
641               <<: *xtesting-jobs
642       - multijob:
643           name: opnfv/xtesting:{tag}
644           projects:
645             - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
646               <<: *xtesting-jobs
647             - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
648               <<: *xtesting-jobs
649             - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
650               <<: *xtesting-jobs
651             - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
652               <<: *xtesting-jobs
653             - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
654               <<: *xtesting-jobs
655             - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
656               <<: *xtesting-jobs
657             - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
658               <<: *xtesting-jobs
659       - multijob:
660           name: opnfv/xtesting-mts:{tag}
661           projects:
662             - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
663               <<: *xtesting-jobs
664     publishers:
665       - email-ext:
666           failure: false
667           first-failure: true
668           fixed: true
669           recipients: cedric.ollivier@orange.com
670
671 - project:
672     name: 'xtesting-review'
673     <<: *xtesting-params
674     jobs:
675       - 'xtesting-{tag}-review'
676
677 - view:
678     name: xtesting-review
679     view-type: list
680     columns:
681       - status
682       - weather
683       - job
684       - last-success
685       - last-failure
686       - last-duration
687     regex: ^xtesting-[a-z0-9.]+-review$
688
689 - view:
690     name: xtesting-tox
691     view-type: list
692     columns:
693       - status
694       - weather
695       - job
696       - last-success
697       - last-failure
698       - last-duration
699     regex: ^xtesting-[a-z0-9.]+-tox$
700
701 - builder:
702     name: xtesting-push-containers
703     builders:
704       - shell: |
705           set +x
706           if [ "{repo}" = "_" ]; then
707             image={container}:{tag}
708           elif [ "{port}" = "None" ]; then
709             image={repo}/{container}:{tag}
710           else
711             image={repo}:{port}/{container}:{tag}
712           fi
713           sudo docker push $image
714
715 - trigger:
716     name: xtesting-commit
717     triggers:
718       - pollscm:
719           cron: "*/30 * * * *"
720
721 - job-template:
722     name: 'xtesting-{repo}-{container}-{tag}-build'
723     parameters:
724       - xtesting-slave:
725           slave: '{slave}'
726     scm:
727       - xtesting-scm:
728           ref: '{branch}'
729     builders:
730       - xtesting-build-containers:
731           <<: *xtesting-build-containers
732           ref: '{branch}'
733           build_args: '{build_args}'
734       - xtesting-push-containers:
735           <<: *xtesting-build-containers
736           ref: '{branch}'
737
738 - project:
739     name: xtesting-opnfv-xtesting-{tag}-build
740     <<: *xtesting-params
741     container: xtesting
742     ref_arg: BRANCH
743     path: docker/core
744     jobs:
745       - 'xtesting-{repo}-{container}-{tag}-build'
746
747 - project:
748     name: xtesting-opnfv-xtesting-mts-{tag}-build
749     <<: *xtesting-params
750     container: xtesting-mts
751     ref_arg: BRANCH
752     path: docker/mts
753     jobs:
754       - 'xtesting-{repo}-{container}-{tag}-build'
755
756 - job-template:
757     name: 'xtesting-{tag}-docker'
758     project-type: multijob
759     triggers:
760       - xtesting-commit
761     scm:
762       - xtesting-scm:
763           ref: '{branch}'
764     parameters:
765       - xtesting-slave:
766           slave: '{slave}'
767     # PyYAML and yamllint differ here
768     # see https://github.com/yaml/pyyaml/issues/234
769     # yamllint disable rule:indentation
770     properties:
771       - build-blocker:
772           blocking-jobs:
773           - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
774     # yamllint enable rule:indentation
775     builders:
776       - multijob:
777           name: remove dependency
778           projects:
779             - name: 'xtesting-{repo}-{tag}-dep-rmi'
780               <<: *xtesting-jobs
781       - multijob:
782           name: pull dependency
783           projects:
784             - name: 'xtesting-{repo}-{tag}-dep-pull'
785               <<: *xtesting-jobs
786       - multijob:
787           name: opnfv/xtesting
788           projects:
789             - name: 'xtesting-opnfv-xtesting-{tag}-build'
790               <<: *xtesting-jobs
791       - multijob:
792           name: opnfv/xtesting-mts
793           projects:
794             - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
795               <<: *xtesting-jobs
796     publishers:
797       - email-ext:
798           failure: false
799           first-failure: true
800           fixed: true
801           recipients: cedric.ollivier@orange.com
802
803 - builder:
804     name: xtesting-trivy
805     builders:
806       - shell: |
807           sudo apt-get -o DPkg::Lock::Timeout=300 update && \
808           sudo DEBIAN_FRONTEND=noninteractive apt-get \
809             -o DPkg::Lock::Timeout=300 install curl -y
810
811           curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
812           if [ "{repo}" = "_" ]; then
813             image={container}:{tag}
814           elif [ "{port}" = "None" ]; then
815             image={repo}/{container}:{tag}
816           else
817             image={repo}:{port}/{container}:{tag}
818           fi
819           ./trivy --exit-code 1 $image
820
821 - job-template:
822     name: 'xtesting-{repo}-{container}-{tag}-trivy'
823     triggers:
824       - timed: '@daily'
825     parameters:
826       - xtesting-slave:
827           slave: '{slave}'
828     builders:
829       - xtesting-trivy:
830           <<: *xtesting-containers
831     publishers:
832       - email-ext:
833           failure: false
834           first-failure: true
835           fixed: true
836           recipients: cedric.ollivier@orange.com
837
838 - project:
839     name: 'xtesting-opnfv-xtesting-trivy'
840     <<: *xtesting-params
841     container: 'xtesting'
842     jobs:
843       - 'xtesting-{repo}-{container}-{tag}-trivy'
844
845 - project:
846     name: 'xtesting-opnfv-xtesting-mts-trivy'
847     <<: *xtesting-params
848     container: 'xtesting-mts'
849     jobs:
850       - 'xtesting-{repo}-{container}-{tag}-trivy'
851
852 - builder:
853     name: xtesting-docker-scan
854     builders:
855       - shell: |
856           sudo apt-get -o DPkg::Lock::Timeout=300 update && \
857           sudo DEBIAN_FRONTEND=noninteractive apt-get \
858             -o DPkg::Lock::Timeout=300 install curl docker.io -y
859
860           mkdir -p ~/.docker/cli-plugins && \
861           curl https://github.com/docker/scan-cli-plugin/releases/latest/download/docker-scan_linux_amd64 \
862             -L -s -S -o ~/.docker/cli-plugins/docker-scan &&\
863           chmod +x ~/.docker/cli-plugins/docker-scan
864           if [ "{repo}" = "_" ]; then
865             image={container}:{tag}
866           elif [ "{port}" = "None" ]; then
867             image={repo}/{container}:{tag}
868           else
869             image={repo}:{port}/{container}:{tag}
870           fi
871           sudo docker scan $image
872
873 - job-template:
874     name: 'xtesting-{repo}-{container}-{tag}-docker-scan'
875     triggers:
876       - timed: '@daily'
877     parameters:
878       - xtesting-slave:
879           slave: '{slave}'
880     builders:
881       - xtesting-docker-scan:
882           <<: *xtesting-containers
883     publishers:
884       - email-ext:
885           failure: false
886           first-failure: true
887           fixed: true
888           recipients: cedric.ollivier@orange.com
889
890 - project:
891     name: 'xtesting-opnfv-xtesting-docker-scan'
892     <<: *xtesting-params
893     container: 'xtesting'
894     jobs:
895       - 'xtesting-{repo}-{container}-{tag}-docker-scan'
896
897 - project:
898     name: 'xtesting-opnfv-xtesting-mts-docker-scan'
899     <<: *xtesting-params
900     container: 'xtesting-mts'
901     jobs:
902       - 'xtesting-{repo}-{container}-{tag}-docker-scan'
903
904 - project:
905     name: 'xtesting'
906     <<: *xtesting-params
907     jobs:
908       - 'xtesting-{tag}-docker'
909
910 - view:
911     name: xtesting-docker
912     view-type: list
913     columns:
914       - status
915       - weather
916       - job
917       - last-success
918       - last-failure
919       - last-duration
920     regex: ^xtesting-[a-z0-9.]+-docker$
921
922 - view:
923     name: xtesting-trivy
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.]+-trivy$
933
934 - view:
935     name: xtesting-docker-scan
936     view-type: list
937     columns:
938       - status
939       - weather
940       - job
941       - last-success
942       - last-failure
943       - last-duration
944     regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-docker-scan$