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