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