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