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