2 - xtesting-containers: &xtesting-containers
3 name: 'xtesting-containers'
6 container: '{container}'
9 - xtesting-params: &xtesting-params
10 name: 'xtesting-params'
47 branch: stable/wallaby
51 - xtesting-jobs: &xtesting-jobs
53 current-parameters: true
63 name: xtesting-build_tag
68 - xtesting-run-containers: &xtesting-run-containers
69 name: 'xtesting-run-containers'
70 <<: *xtesting-containers
72 privileged: '{privileged}'
78 published_ports: '{published_ports}'
81 name: xtesting-pull-containers
85 if [ "{repo}" = "_" ]; then
86 image={container}:{tag}
87 elif [ "{port}" = "None" ]; then
88 image={repo}/{container}:{tag}
90 image={repo}:{port}/{container}:{tag}
92 sudo docker pull $image
95 name: xtesting-run-containers
100 if [ "{volumes}" != "None" ]; then
101 for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
102 do volumes="-v $i $volumes"; done
105 if [ "{env}" != "None" ]; then
106 for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
107 do env="-e $i $env"; done
110 if [ "{published_ports}" != "None" ]; then
111 for i in $(echo {published_ports} | tr -d '[]' |sed "s/, / /g" ); \
112 do published_ports="-p $i $published_ports"; done
114 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
115 if [ "{repo}" = "_" ]; then
116 image={container}:{tag}
117 elif [ "{port}" = "None" ]; then
118 image={repo}/{container}:{tag}
120 image={repo}:{port}/{container}:{tag}
122 sudo mkdir -p $WORKSPACE/results
123 sudo chown {uid}:{gid} $WORKSPACE/results
124 sudo docker run --rm \
125 --privileged={privileged} \
126 --network={network} \
130 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
131 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
132 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
133 -v /home/opnfv/xtesting/.boto:/etc/boto.cfg \
134 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
135 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
137 -e BUILD_TAG=$BUILD_TAG \
138 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
139 $image run_tests -t {test} -p -r
142 name: xtesting-remove-images
146 if [ "{repo}" = "_" ]; then
147 image={container}:{tag}
148 elif [ "{port}" = "None" ]; then
149 image={repo}/{container}:{tag}
151 image={repo}:{port}/{container}:{tag}
153 sudo docker rmi $image || true
156 name: 'xtesting-{repo}-{container}-{tag}-pull'
161 - xtesting-pull-containers:
162 <<: *xtesting-containers
165 name: 'xtesting-opnfv-xtesting-pull'
167 container: 'xtesting'
169 - 'xtesting-{repo}-{container}-{tag}-pull'
172 name: 'xtesting-{repo}-{container}-{tag}-rmi'
177 - xtesting-remove-images:
178 <<: *xtesting-containers
181 name: 'xtesting-opnfv-xtesting-rmi'
183 container: 'xtesting'
185 - 'xtesting-{repo}-{container}-{tag}-rmi'
188 name: 'xtesting-opnfv-xtesting-{tag}-{test}-run'
192 - xtesting-build_tag:
195 - xtesting-run-containers:
196 <<: *xtesting-run-containers
199 name: 'xtesting-opnfv-xtesting'
204 container: 'xtesting'
224 - 'xtesting-opnfv-xtesting-{tag}-{test}-run'
232 if [ "{volumes}" != "None" ]; then
233 for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
234 do volumes="-v $i $volumes"; done
237 if [ "{env}" != "None" ]; then
238 for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
239 do env="-e $i $env"; done
242 if [ "{published_ports}" != "None" ]; then
243 for i in $(echo {published_ports} | tr -d '[]' |sed "s/, / /g" ); \
244 do published_ports="-p $i $published_ports"; done
246 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
247 if [ "{repo}" = "_" ]; then
248 image={container}:{tag}
249 elif [ "{port}" = "None" ]; then
250 image={repo}/{container}:{tag}
252 image={repo}:{port}/{container}:{tag}
254 sudo mkdir -p $WORKSPACE/results
255 sudo chown {uid}:{gid} $WORKSPACE/results
256 sudo docker run --rm \
260 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
261 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
262 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
263 -v /home/opnfv/xtesting/.boto:/etc/boto.cfg \
264 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
265 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
266 -e BUILD_TAG=$BUILD_TAG \
267 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
271 name: 'xtesting-{tag}-zip'
275 - xtesting-build_tag:
279 <<: *xtesting-containers
284 published_ports: '{published_ports}'
287 name: 'xtesting-{tag}-zip'
292 container: 'xtesting'
296 - 'xtesting-{tag}-zip'
299 name: 'xtesting-{tag}-daily'
300 project-type: multijob
306 - xtesting-build_tag:
308 # PyYAML and yamllint differ here
309 # see https://github.com/yaml/pyyaml/issues/234
310 # yamllint disable rule:indentation
314 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
315 # yamllint enable rule:indentation
318 name: remove former images
320 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
323 name: pull containers
325 - name: 'xtesting-opnfv-xtesting-{tag}-pull'
328 name: opnfv/xtesting:{tag}
330 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
332 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
334 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
336 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
338 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
340 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
342 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
344 - name: 'xtesting-opnfv-xtesting-{tag}-nineth-run'
347 name: dump all campaign data
349 - name: 'xtesting-{tag}-zip'
356 recipients: cedric.ollivier@orange.com
359 name: 'xtesting-daily'
362 - 'xtesting-{tag}-daily'
374 regex: ^xtesting-[a-z0-9.]+-daily$
376 - xtesting-build-containers: &xtesting-build-containers
377 name: 'xtesting-build-containers'
378 <<: *xtesting-containers
381 build_args: '{build_args}'
385 name: xtesting-build-containers
389 if [ "{repo}" = "_" ]; then
390 image={container}:{tag}
391 elif [ "{port}" = "None" ]; then
392 image={repo}/{container}:{tag}
394 image={repo}:{port}/{container}:{tag}
397 if [ "{build_args}" != "None" ]; then
398 for i in $(echo {build_args} | tr -d '[]' |sed "s/, / /g" ); \
399 do build_args="--build-arg $i $build_args"; done
401 if [ "{ref_arg}" != "None" ]; then
402 build_args="$build_args --build-arg {ref_arg}={ref}"
405 if [ "{from}" != "None" ]; then
406 sed -i {from} Dockerfile
408 sudo docker build $build_args \
409 --pull=false --no-cache --force-rm=true \
416 url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
417 refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
421 - xtesting-dep: &xtesting-dep
422 name: 'xtesting-containers'
426 dependency: '{dependency}'
429 name: xtesting-pull-dep-images
433 if [ "_" = "_" ]; then
434 image=alpine:{dependency}
435 elif [ "" = "None" ]; then
436 image=_/alpine:{dependency}
438 image=_:/alpine:{dependency}
440 sudo docker pull $image || true
443 name: xtesting-remove-dep-images
447 if [ "_" = "_" ]; then
448 image=alpine:{dependency}
449 elif [ "" = "None" ]; then
450 image=_/alpine:{dependency}
452 image=_:/alpine:{dependency}
454 sudo docker rmi $image || true
457 name: 'xtesting-{repo}-{tag}-dep-pull'
462 - xtesting-pull-dep-images:
466 name: 'xtesting-{repo}-{tag}-dep-pull'
469 - 'xtesting-{repo}-{tag}-dep-pull'
472 name: 'xtesting-{repo}-{tag}-dep-rmi'
477 - xtesting-remove-dep-images:
481 name: 'xtesting-{repo}-{tag}-dep-rmi'
484 - 'xtesting-{repo}-{tag}-dep-rmi'
491 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
492 sudo DEBIAN_FRONTEND=noninteractive apt-get \
493 -o DPkg::Lock::Timeout=300 dist-upgrade -y
494 sudo DEBIAN_FRONTEND=noninteractive \
495 apt-get -o DPkg::Lock::Timeout=300 install software-properties-common gpg -y
496 sudo add-apt-repository -y ppa:deadsnakes/ppa
497 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
498 sudo DEBIAN_FRONTEND=noninteractive apt-get \
499 -o DPkg::Lock::Timeout=300 install \
500 libxml2-dev libxslt-dev libffi-dev libjpeg-dev \
501 python3.10 python3.10-dev python3.10-distutils \
502 python3.9 python3.9-dev python3.9-distutils \
503 python3.8 python3.8-dev python3.8-distutils \
504 python3-pip enchant-2 -y
505 sudo pip3 install tox
510 name: 'xtesting-{tag}-tox'
515 - xtesting-patchset-created:
527 - 'xtesting-{tag}-tox'
530 name: 'xtesting-{repo}-{container}-{tag}-gate'
538 - xtesting-build-containers:
539 <<: *xtesting-build-containers
541 build_args: '{build_args}'
544 name: xtesting-opnfv-xtesting-{tag}-gate
550 - 'xtesting-{repo}-{container}-{tag}-gate'
553 name: xtesting-patchset-created
557 - patchset-created-event
558 - comment-added-contains-event:
559 comment-contains-value: 'recheck'
560 - comment-added-contains-event:
561 comment-contains-value: 'reverify'
563 - project-compare-type: 'ANT'
564 project-pattern: 'functest-xtesting'
566 - branch-compare-type: 'ANT'
567 branch-pattern: '**/{branch}'
570 name: 'xtesting-{tag}-review'
571 project-type: multijob
573 - xtesting-patchset-created:
578 - xtesting-build_tag:
580 # PyYAML and yamllint differ here
581 # see https://github.com/yaml/pyyaml/issues/234
582 # yamllint disable rule:indentation
586 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
587 # yamllint enable rule:indentation
590 name: remove former images
592 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
595 name: remove dependency
597 - name: 'xtesting-{repo}-{tag}-dep-rmi'
600 name: pull dependency
602 - name: 'xtesting-{repo}-{tag}-dep-pull'
607 - name: 'xtesting-opnfv-xtesting-{tag}-gate'
610 name: opnfv/xtesting:{tag}
612 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
614 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
616 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
618 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
620 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
622 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
624 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
626 - name: 'xtesting-opnfv-xtesting-{tag}-nineth-run'
633 recipients: cedric.ollivier@orange.com
636 name: 'xtesting-review'
639 - 'xtesting-{tag}-review'
642 name: xtesting-review
651 regex: ^xtesting-[a-z0-9.]+-review$
663 regex: ^xtesting-[a-z0-9.]+-tox$
666 name: xtesting-push-containers
670 if [ "{repo}" = "_" ]; then
671 image={container}:{tag}
672 elif [ "{port}" = "None" ]; then
673 image={repo}/{container}:{tag}
675 image={repo}:{port}/{container}:{tag}
677 sudo docker push $image
680 name: xtesting-commit
686 name: 'xtesting-{repo}-{container}-{tag}-build'
694 - xtesting-build-containers:
695 <<: *xtesting-build-containers
697 build_args: '{build_args}'
698 - xtesting-push-containers:
699 <<: *xtesting-build-containers
703 name: xtesting-opnfv-xtesting-{tag}-build
709 - 'xtesting-{repo}-{container}-{tag}-build'
712 name: 'xtesting-{tag}-docker'
713 project-type: multijob
722 # PyYAML and yamllint differ here
723 # see https://github.com/yaml/pyyaml/issues/234
724 # yamllint disable rule:indentation
728 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
729 # yamllint enable rule:indentation
732 name: remove dependency
734 - name: 'xtesting-{repo}-{tag}-dep-rmi'
737 name: pull dependency
739 - name: 'xtesting-{repo}-{tag}-dep-pull'
744 - name: 'xtesting-opnfv-xtesting-{tag}-build'
751 recipients: cedric.ollivier@orange.com
757 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
758 sudo DEBIAN_FRONTEND=noninteractive apt-get \
759 -o DPkg::Lock::Timeout=300 install curl -y
761 curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
762 if [ "{repo}" = "_" ]; then
763 image={container}:{tag}
764 elif [ "{port}" = "None" ]; then
765 image={repo}/{container}:{tag}
767 image={repo}:{port}/{container}:{tag}
769 ./trivy image --exit-code 1 $image
772 name: 'xtesting-{repo}-{container}-{tag}-trivy'
780 <<: *xtesting-containers
786 recipients: cedric.ollivier@orange.com
789 name: 'xtesting-opnfv-xtesting-trivy'
791 container: 'xtesting'
793 - 'xtesting-{repo}-{container}-{tag}-trivy'
799 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
800 sudo DEBIAN_FRONTEND=noninteractive apt-get \
801 -o DPkg::Lock::Timeout=300 install curl -y
803 curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sudo sh -s -- -b .
804 if [ "{repo}" = "_" ]; then
805 image={container}:{tag}
806 elif [ "{port}" = "None" ]; then
807 image={repo}/{container}:{tag}
809 image={repo}:{port}/{container}:{tag}
814 name: 'xtesting-{repo}-{container}-{tag}-grype'
822 <<: *xtesting-containers
828 recipients: cedric.ollivier@orange.com
831 name: 'xtesting-opnfv-xtesting-grype'
833 container: 'xtesting'
835 - 'xtesting-{repo}-{container}-{tag}-grype'
841 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
842 sudo DEBIAN_FRONTEND=noninteractive apt-get \
843 -o DPkg::Lock::Timeout=300 install curl -y
845 sudo mkdir -p ~/.docker
846 curl -sSfL https://raw.githubusercontent.com/docker/sbom-cli-plugin/main/install.sh | sudo sh -s --
847 if [ "{repo}" = "_" ]; then
848 image={container}:{tag}
849 elif [ "{port}" = "None" ]; then
850 image={repo}/{container}:{tag}
852 image={repo}:{port}/{container}:{tag}
854 sudo docker sbom $image
857 name: 'xtesting-{repo}-{container}-{tag}-sbom'
865 <<: *xtesting-containers
871 recipients: cedric.ollivier@orange.com
874 name: 'xtesting-opnfv-xtesting-sbom'
876 container: 'xtesting'
878 - 'xtesting-{repo}-{container}-{tag}-sbom'
884 - 'xtesting-{tag}-docker'
887 name: xtesting-docker
896 regex: ^xtesting-[a-z0-9.]+-docker$
908 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$
920 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-grype$
932 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-sbom$