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