2 - xtesting-containers: &xtesting-containers
3 name: 'xtesting-containers'
6 container: '{container}'
9 - xtesting-params: &xtesting-params
10 name: 'xtesting-params'
51 branch: stable/wallaby
55 - xtesting-opnfv-xtesting-params: &xtesting-opnfv-xtesting-params
56 name: 'xtesting-opnfv-xtesting-params'
100 branch: stable/wallaby
104 - xtesting-jobs: &xtesting-jobs
105 name: 'xtesting-jobs'
106 current-parameters: true
116 name: xtesting-build_tag
121 - xtesting-run-containers: &xtesting-run-containers
122 name: 'xtesting-run-containers'
123 <<: *xtesting-containers
124 privileged: '{privileged}'
130 published_ports: '{published_ports}'
133 name: xtesting-pull-containers
137 if [ "{repo}" = "_" ]; then
138 image={container}:{tag}
139 elif [ "{port}" = "None" ]; then
140 image={repo}/{container}:{tag}
142 image={repo}:{port}/{container}:{tag}
144 sudo docker pull $image
147 name: xtesting-run-containers
152 if [ "{volumes}" != "None" ]; then
153 for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
154 do volumes="-v $i $volumes"; done
157 if [ "{env}" != "None" ]; then
158 for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
159 do env="-e $i $env"; done
162 if [ "{published_ports}" != "None" ]; then
163 for i in $(echo {published_ports} | tr -d '[]' |sed "s/, / /g" ); \
164 do published_ports="-p $i $published_ports"; done
166 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
167 if [ "{repo}" = "_" ]; then
168 image={container}:{tag}
169 elif [ "{port}" = "None" ]; then
170 image={repo}/{container}:{tag}
172 image={repo}:{port}/{container}:{tag}
174 sudo mkdir -p $WORKSPACE/results
175 sudo chown {uid}:{gid} $WORKSPACE/results
176 sudo docker run --rm \
177 --privileged={privileged} \
178 --network={network} \
182 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
183 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
184 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
185 -v /home/opnfv/xtesting/.boto:/etc/boto.cfg \
186 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
187 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
189 -e BUILD_TAG=$BUILD_TAG \
190 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
191 $image run_tests -t {test} -p -r
194 name: xtesting-remove-images
198 if [ "{repo}" = "_" ]; then
199 image={container}:{tag}
200 elif [ "{port}" = "None" ]; then
201 image={repo}/{container}:{tag}
203 image={repo}:{port}/{container}:{tag}
205 sudo docker rmi $image || true
208 name: 'xtesting-opnfv-xtesting-{tag}-pull'
213 - xtesting-pull-containers:
214 <<: *xtesting-containers
217 name: 'xtesting-opnfv-xtesting-pull'
218 <<: *xtesting-opnfv-xtesting-params
220 - 'xtesting-opnfv-xtesting-{tag}-pull'
223 name: 'xtesting-opnfv-xtesting-{tag}-rmi'
228 - xtesting-remove-images:
229 <<: *xtesting-containers
232 name: 'xtesting-opnfv-xtesting-rmi'
233 <<: *xtesting-opnfv-xtesting-params
235 - 'xtesting-opnfv-xtesting-{tag}-rmi'
238 name: 'xtesting-opnfv-xtesting-{tag}-{test}-run'
242 - xtesting-build_tag:
245 - xtesting-run-containers:
246 <<: *xtesting-run-containers
250 name: 'xtesting-opnfv-xtesting'
251 <<: *xtesting-opnfv-xtesting-params
255 container: 'xtesting'
275 - 'xtesting-opnfv-xtesting-{tag}-{test}-run'
283 if [ "{volumes}" != "None" ]; then
284 for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
285 do volumes="-v $i $volumes"; done
288 if [ "{env}" != "None" ]; then
289 for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
290 do env="-e $i $env"; done
293 if [ "{published_ports}" != "None" ]; then
294 for i in $(echo {published_ports} | tr -d '[]' |sed "s/, / /g" ); \
295 do published_ports="-p $i $published_ports"; done
297 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
298 if [ "{repo}" = "_" ]; then
299 image={container}:{tag}
300 elif [ "{port}" = "None" ]; then
301 image={repo}/{container}:{tag}
303 image={repo}:{port}/{container}:{tag}
305 sudo mkdir -p $WORKSPACE/results
306 sudo chown {uid}:{gid} $WORKSPACE/results
307 sudo docker run --rm \
308 --privileged={privileged} \
309 --network={network} \
313 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
314 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
315 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
316 -v /home/opnfv/xtesting/.boto:/etc/boto.cfg \
317 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
318 -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 \
325 name: 'xtesting-{tag}-zip'
329 - xtesting-build_tag:
333 <<: *xtesting-run-containers
337 <<: *xtesting-opnfv-xtesting-params
341 container: 'xtesting'
347 - 'xtesting-{tag}-zip'
350 name: 'xtesting-{tag}-daily'
351 project-type: multijob
357 - xtesting-build_tag:
359 # PyYAML and yamllint differ here
360 # see https://github.com/yaml/pyyaml/issues/234
361 # yamllint disable rule:indentation
365 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
366 # yamllint enable rule:indentation
369 name: remove former images
371 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
374 name: pull containers
376 - name: 'xtesting-opnfv-xtesting-{tag}-pull'
379 name: opnfv/xtesting:{tag}
381 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
383 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
385 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
387 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
389 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
391 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
393 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
395 - name: 'xtesting-opnfv-xtesting-{tag}-nineth-run'
398 name: dump all campaign data
400 - name: 'xtesting-{tag}-zip'
407 recipients: cedric.ollivier@orange.com
410 name: 'xtesting-daily'
413 - 'xtesting-{tag}-daily'
425 regex: ^xtesting-[a-z0-9.-]+-daily$
427 - xtesting-build-containers: &xtesting-build-containers
428 name: 'xtesting-build-containers'
429 <<: *xtesting-containers
432 build_args: '{build_args}'
436 name: xtesting-build-containers
440 if [ "{repo}" = "_" ]; then
441 image={container}:{tag}
442 elif [ "{port}" = "None" ]; then
443 image={repo}/{container}:{tag}
445 image={repo}:{port}/{container}:{tag}
448 if [ "{build_args}" != "None" ]; then
449 for i in $(echo {build_args} | tr -d '[]' |sed "s/, / /g" ); \
450 do build_args="--build-arg $i $build_args"; done
452 if [ "{ref_arg}" != "None" ]; then
453 build_args="$build_args --build-arg {ref_arg}={ref}"
456 if [ "{from}" != "None" ]; then
457 sed -i {from} Dockerfile
459 sudo docker build $build_args \
460 --pull=false --no-cache --force-rm=true \
467 url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
468 refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
472 - xtesting-dep: &xtesting-dep
473 name: 'xtesting-containers'
475 container: '{container}'
480 name: 'xtesting-{tag}-dep-pull'
485 - xtesting-pull-containers:
488 - xtesting-dep-params: &xtesting-dep-params
489 name: 'xtesting-dep-params'
510 name: 'xtesting-dep-pull'
511 <<: *xtesting-dep-params
513 - 'xtesting-{tag}-dep-pull'
516 name: 'xtesting-{tag}-dep-rmi'
521 - xtesting-remove-images:
525 name: 'xtesting-dep-rmi'
526 <<: *xtesting-dep-params
528 - 'xtesting-{tag}-dep-rmi'
535 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
536 sudo DEBIAN_FRONTEND=noninteractive apt-get \
537 -o DPkg::Lock::Timeout=300 dist-upgrade -y
538 sudo DEBIAN_FRONTEND=noninteractive \
539 apt-get -o DPkg::Lock::Timeout=300 install software-properties-common gpg -y
540 sudo add-apt-repository -y ppa:deadsnakes/ppa
541 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
542 sudo DEBIAN_FRONTEND=noninteractive apt-get \
543 -o DPkg::Lock::Timeout=300 install \
544 libxml2-dev libxslt-dev libffi-dev libjpeg-dev \
545 python3.10 python3.10-dev python3.10-distutils \
546 python3.9 python3.9-dev python3.9-distutils \
547 python3.8 python3.8-dev python3.8-distutils \
548 python3-pip enchant-2 -y
549 sudo pip3 install tox
554 name: 'xtesting-{tag}-tox'
559 - xtesting-patchset-created:
571 - 'xtesting-{tag}-tox'
574 name: 'xtesting-opnfv-xtesting-{tag}-gate'
582 - xtesting-build-containers:
583 <<: *xtesting-build-containers
585 build_args: '{build_args}'
588 name: xtesting-opnfv-xtesting-gate
596 - 'xtesting-opnfv-xtesting-{tag}-gate'
599 name: xtesting-patchset-created
603 - patchset-created-event
604 - comment-added-contains-event:
605 comment-contains-value: 'recheck'
606 - comment-added-contains-event:
607 comment-contains-value: 'reverify'
609 - project-compare-type: 'ANT'
610 project-pattern: 'functest-xtesting'
612 - branch-compare-type: 'ANT'
613 branch-pattern: '**/{branch}'
616 name: 'xtesting-{tag}-review'
617 project-type: multijob
619 - xtesting-patchset-created:
624 - xtesting-build_tag:
626 # PyYAML and yamllint differ here
627 # see https://github.com/yaml/pyyaml/issues/234
628 # yamllint disable rule:indentation
632 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
633 # yamllint enable rule:indentation
636 name: remove former images
638 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
641 name: remove dependency
643 - name: 'xtesting-{tag}-dep-rmi'
646 name: pull dependency
648 - name: 'xtesting-{tag}-dep-pull'
653 - name: 'xtesting-opnfv-xtesting-{tag}-gate'
656 name: opnfv/xtesting:{tag}
658 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
660 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
662 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
664 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
666 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
668 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
670 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
672 - name: 'xtesting-opnfv-xtesting-{tag}-nineth-run'
679 recipients: cedric.ollivier@orange.com
682 name: 'xtesting-review'
685 - 'xtesting-{tag}-review'
688 name: xtesting-review
697 regex: ^xtesting-[a-z0-9.-]+-review$
709 regex: ^xtesting-[a-z0-9.-]+-tox$
712 name: xtesting-push-containers
716 if [ "{repo}" = "_" ]; then
717 image={container}:{tag}
718 elif [ "{port}" = "None" ]; then
719 image={repo}/{container}:{tag}
721 image={repo}:{port}/{container}:{tag}
723 sudo docker push $image
726 name: xtesting-commit
732 name: 'xtesting-opnfv-xtesting-{tag}-build'
740 - xtesting-build-containers:
741 <<: *xtesting-build-containers
743 build_args: '{build_args}'
744 - xtesting-push-containers:
745 <<: *xtesting-build-containers
749 name: xtesting-opnfv-xtesting-build
757 - 'xtesting-opnfv-xtesting-{tag}-build'
760 name: 'xtesting-{tag}-docker'
761 project-type: multijob
770 # PyYAML and yamllint differ here
771 # see https://github.com/yaml/pyyaml/issues/234
772 # yamllint disable rule:indentation
776 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
777 # yamllint enable rule:indentation
780 name: remove dependency
782 - name: 'xtesting-{tag}-dep-rmi'
785 name: pull dependency
787 - name: 'xtesting-{tag}-dep-pull'
792 - name: 'xtesting-opnfv-xtesting-{tag}-build'
799 recipients: cedric.ollivier@orange.com
802 name: 'xtesting-docker'
805 - 'xtesting-{tag}-docker'
811 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
812 sudo DEBIAN_FRONTEND=noninteractive apt-get \
813 -o DPkg::Lock::Timeout=300 install curl -y
815 curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
816 if [ "{repo}" = "_" ]; then
817 image={container}:{tag}
818 elif [ "{port}" = "None" ]; then
819 image={repo}/{container}:{tag}
821 image={repo}:{port}/{container}:{tag}
823 ./trivy image --exit-code 1 $image
826 name: 'xtesting-opnfv-xtesting-{tag}-trivy'
834 <<: *xtesting-containers
840 recipients: cedric.ollivier@orange.com
843 name: 'xtesting-opnfv-xtesting-trivy'
846 container: 'xtesting'
849 - 'xtesting-opnfv-xtesting-{tag}-trivy'
855 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
856 sudo DEBIAN_FRONTEND=noninteractive apt-get \
857 -o DPkg::Lock::Timeout=300 install curl -y
859 curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sudo sh -s -- -b .
860 if [ "{repo}" = "_" ]; then
861 image={container}:{tag}
862 elif [ "{port}" = "None" ]; then
863 image={repo}/{container}:{tag}
865 image={repo}:{port}/{container}:{tag}
870 name: 'xtesting-opnfv-xtesting-{tag}-grype'
878 <<: *xtesting-containers
884 recipients: cedric.ollivier@orange.com
887 name: 'xtesting-opnfv-xtesting-grype'
890 container: 'xtesting'
893 - 'xtesting-opnfv-xtesting-{tag}-grype'
899 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
900 sudo DEBIAN_FRONTEND=noninteractive apt-get \
901 -o DPkg::Lock::Timeout=300 install curl -y
903 sudo mkdir -p ~/.docker
904 curl -sSfL https://raw.githubusercontent.com/docker/sbom-cli-plugin/main/install.sh | sudo sh -s --
905 if [ "{repo}" = "_" ]; then
906 image={container}:{tag}
907 elif [ "{port}" = "None" ]; then
908 image={repo}/{container}:{tag}
910 image={repo}:{port}/{container}:{tag}
912 sudo docker sbom $image
915 name: 'xtesting-opnfv-xtesting-{tag}-sbom'
923 <<: *xtesting-containers
929 recipients: cedric.ollivier@orange.com
932 name: 'xtesting-opnfv-xtesting-sbom'
935 container: 'xtesting'
938 - 'xtesting-opnfv-xtesting-{tag}-sbom'
941 name: xtesting-docker
950 regex: ^xtesting-[a-z0-9.-]+-docker$
962 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$
974 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-grype$
986 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-sbom$