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