2 - xtesting-containers: &xtesting-containers
3 name: 'xtesting-containers'
6 container: '{container}'
9 - xtesting-params: &xtesting-params
10 name: 'xtesting-params'
45 branch: stable/wallaby
49 - xtesting-opnfv-xtesting-params: &xtesting-opnfv-xtesting-params
50 name: 'xtesting-opnfv-xtesting-params'
88 branch: stable/wallaby
92 - xtesting-jobs: &xtesting-jobs
94 current-parameters: true
104 name: xtesting-build_tag
109 - xtesting-run-containers: &xtesting-run-containers
110 name: 'xtesting-run-containers'
111 <<: *xtesting-containers
112 privileged: '{privileged}'
118 published_ports: '{published_ports}'
121 name: xtesting-pull-containers
125 if [ "{repo}" = "_" ]; then
126 image={container}:{tag}
127 elif [ "{port}" = "None" ]; then
128 image={repo}/{container}:{tag}
130 image={repo}:{port}/{container}:{tag}
132 sudo docker pull $image
135 name: xtesting-run-containers
140 if [ "{volumes}" != "None" ]; then
141 for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
142 do volumes="-v $i $volumes"; done
145 if [ "{env}" != "None" ]; then
146 for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
147 do env="-e $i $env"; done
150 if [ "{published_ports}" != "None" ]; then
151 for i in $(echo {published_ports} | tr -d '[]' |sed "s/, / /g" ); \
152 do published_ports="-p $i $published_ports"; done
154 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
155 if [ "{repo}" = "_" ]; then
156 image={container}:{tag}
157 elif [ "{port}" = "None" ]; then
158 image={repo}/{container}:{tag}
160 image={repo}:{port}/{container}:{tag}
162 sudo mkdir -p $WORKSPACE/results
163 sudo chown {uid}:{gid} $WORKSPACE/results
164 sudo docker run --rm \
165 --privileged={privileged} \
166 --network={network} \
170 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
171 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
172 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
173 -v /home/opnfv/xtesting/.boto:/etc/boto.cfg \
174 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
175 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
177 -e BUILD_TAG=$BUILD_TAG \
178 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
179 $image run_tests -t {test} -p -r
182 name: xtesting-remove-images
186 if [ "{repo}" = "_" ]; then
187 image={container}:{tag}
188 elif [ "{port}" = "None" ]; then
189 image={repo}/{container}:{tag}
191 image={repo}:{port}/{container}:{tag}
193 sudo docker rmi $image || true
196 name: 'xtesting-opnfv-xtesting-{tag}-pull'
201 - xtesting-pull-containers:
202 <<: *xtesting-containers
205 name: 'xtesting-opnfv-xtesting-pull'
206 <<: *xtesting-opnfv-xtesting-params
208 - 'xtesting-opnfv-xtesting-{tag}-pull'
211 name: 'xtesting-opnfv-xtesting-{tag}-rmi'
216 - xtesting-remove-images:
217 <<: *xtesting-containers
220 name: 'xtesting-opnfv-xtesting-rmi'
221 <<: *xtesting-opnfv-xtesting-params
223 - 'xtesting-opnfv-xtesting-{tag}-rmi'
226 name: 'xtesting-opnfv-xtesting-{tag}-{test}-run'
230 - xtesting-build_tag:
233 - xtesting-run-containers:
234 <<: *xtesting-run-containers
238 name: 'xtesting-opnfv-xtesting'
239 <<: *xtesting-opnfv-xtesting-params
243 container: 'xtesting'
263 - 'xtesting-opnfv-xtesting-{tag}-{test}-run'
271 if [ "{volumes}" != "None" ]; then
272 for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
273 do volumes="-v $i $volumes"; done
276 if [ "{env}" != "None" ]; then
277 for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
278 do env="-e $i $env"; done
281 if [ "{published_ports}" != "None" ]; then
282 for i in $(echo {published_ports} | tr -d '[]' |sed "s/, / /g" ); \
283 do published_ports="-p $i $published_ports"; done
285 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
286 if [ "{repo}" = "_" ]; then
287 image={container}:{tag}
288 elif [ "{port}" = "None" ]; then
289 image={repo}/{container}:{tag}
291 image={repo}:{port}/{container}:{tag}
293 sudo mkdir -p $WORKSPACE/results
294 sudo chown {uid}:{gid} $WORKSPACE/results
295 sudo docker run --rm \
296 --privileged={privileged} \
297 --network={network} \
301 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
302 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
303 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
304 -v /home/opnfv/xtesting/.boto:/etc/boto.cfg \
305 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
306 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
308 -e BUILD_TAG=$BUILD_TAG \
309 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
313 name: 'xtesting-{tag}-zip'
317 - xtesting-build_tag:
321 <<: *xtesting-run-containers
325 <<: *xtesting-opnfv-xtesting-params
329 container: 'xtesting'
335 - 'xtesting-{tag}-zip'
338 name: 'xtesting-{tag}-daily'
339 project-type: multijob
345 - xtesting-build_tag:
347 # PyYAML and yamllint differ here
348 # see https://github.com/yaml/pyyaml/issues/234
349 # yamllint disable rule:indentation
353 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
354 # yamllint enable rule:indentation
357 name: remove former images
359 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
362 name: pull containers
364 - name: 'xtesting-opnfv-xtesting-{tag}-pull'
367 name: opnfv/xtesting:{tag}
369 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
371 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
373 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
375 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
377 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
379 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
381 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
383 - name: 'xtesting-opnfv-xtesting-{tag}-nineth-run'
386 name: dump all campaign data
388 - name: 'xtesting-{tag}-zip'
395 recipients: cedric.ollivier@orange.com
398 name: 'xtesting-daily'
401 - 'xtesting-{tag}-daily'
413 regex: ^xtesting-[a-z0-9.-]+-daily$
415 - xtesting-build-containers: &xtesting-build-containers
416 name: 'xtesting-build-containers'
417 <<: *xtesting-containers
420 build_args: '{build_args}'
424 name: xtesting-build-containers
428 if [ "{repo}" = "_" ]; then
429 image={container}:{tag}
430 elif [ "{port}" = "None" ]; then
431 image={repo}/{container}:{tag}
433 image={repo}:{port}/{container}:{tag}
436 if [ "{build_args}" != "None" ]; then
437 for i in $(echo {build_args} | tr -d '[]' |sed "s/, / /g" ); \
438 do build_args="--build-arg $i $build_args"; done
440 if [ "{ref_arg}" != "None" ]; then
441 build_args="$build_args --build-arg {ref_arg}={ref}"
444 if [ "{from}" != "None" ]; then
445 sed -i {from} Dockerfile
447 sudo docker build $build_args \
448 --pull=false --no-cache --force-rm=true \
455 url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
456 refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
460 - xtesting-dep: &xtesting-dep
461 name: 'xtesting-containers'
463 container: '{container}'
468 name: 'xtesting-{tag}-dep-pull'
473 - xtesting-pull-containers:
476 - xtesting-dep-params: &xtesting-dep-params
477 name: 'xtesting-dep-params'
496 name: 'xtesting-dep-pull'
497 <<: *xtesting-dep-params
499 - 'xtesting-{tag}-dep-pull'
502 name: 'xtesting-{tag}-dep-rmi'
507 - xtesting-remove-images:
511 name: 'xtesting-dep-rmi'
512 <<: *xtesting-dep-params
514 - 'xtesting-{tag}-dep-rmi'
521 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
522 sudo DEBIAN_FRONTEND=noninteractive apt-get \
523 -o DPkg::Lock::Timeout=300 dist-upgrade -y
524 sudo DEBIAN_FRONTEND=noninteractive \
525 apt-get -o DPkg::Lock::Timeout=300 install software-properties-common gpg -y
526 sudo add-apt-repository -y ppa:deadsnakes/ppa
527 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
528 sudo DEBIAN_FRONTEND=noninteractive apt-get \
529 -o DPkg::Lock::Timeout=300 install \
530 libxml2-dev libxslt-dev libffi-dev libjpeg-dev \
531 python3.10 python3.10-dev python3.10-distutils \
532 python3.9 python3.9-dev python3.9-distutils \
533 python3.8 python3.8-dev python3.8-distutils \
534 python3-pip enchant-2 -y
535 sudo pip3 install tox tox-pip-version
540 name: 'xtesting-{tag}-tox'
545 - xtesting-patchset-created:
557 - 'xtesting-{tag}-tox'
560 name: 'xtesting-opnfv-xtesting-{tag}-gate'
568 - xtesting-build-containers:
569 <<: *xtesting-build-containers
571 build_args: '{build_args}'
574 name: xtesting-opnfv-xtesting-gate
582 - 'xtesting-opnfv-xtesting-{tag}-gate'
585 name: xtesting-patchset-created
589 - patchset-created-event
590 - comment-added-contains-event:
591 comment-contains-value: 'recheck'
592 - comment-added-contains-event:
593 comment-contains-value: 'reverify'
595 - project-compare-type: 'ANT'
596 project-pattern: 'functest-xtesting'
598 - branch-compare-type: 'ANT'
599 branch-pattern: '**/{branch}'
602 name: 'xtesting-{tag}-review'
603 project-type: multijob
605 - xtesting-patchset-created:
610 - xtesting-build_tag:
612 # PyYAML and yamllint differ here
613 # see https://github.com/yaml/pyyaml/issues/234
614 # yamllint disable rule:indentation
618 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
619 # yamllint enable rule:indentation
622 name: remove former images
624 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
627 name: remove dependency
629 - name: 'xtesting-{tag}-dep-rmi'
632 name: pull dependency
634 - name: 'xtesting-{tag}-dep-pull'
639 - name: 'xtesting-opnfv-xtesting-{tag}-gate'
642 name: opnfv/xtesting:{tag}
644 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
646 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
648 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
650 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
652 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
654 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
656 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
658 - name: 'xtesting-opnfv-xtesting-{tag}-nineth-run'
665 recipients: cedric.ollivier@orange.com
668 name: 'xtesting-review'
671 - 'xtesting-{tag}-review'
674 name: xtesting-review
683 regex: ^xtesting-[a-z0-9.-]+-review$
695 regex: ^xtesting-[a-z0-9.-]+-tox$
698 name: xtesting-push-containers
702 if [ "{repo}" = "_" ]; then
703 image={container}:{tag}
704 elif [ "{port}" = "None" ]; then
705 image={repo}/{container}:{tag}
707 image={repo}:{port}/{container}:{tag}
709 sudo docker push $image
712 name: xtesting-commit
718 name: 'xtesting-opnfv-xtesting-{tag}-build'
726 - xtesting-build-containers:
727 <<: *xtesting-build-containers
729 build_args: '{build_args}'
730 - xtesting-push-containers:
731 <<: *xtesting-build-containers
735 name: xtesting-opnfv-xtesting-build
743 - 'xtesting-opnfv-xtesting-{tag}-build'
746 name: 'xtesting-{tag}-docker'
747 project-type: multijob
756 # PyYAML and yamllint differ here
757 # see https://github.com/yaml/pyyaml/issues/234
758 # yamllint disable rule:indentation
762 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
763 # yamllint enable rule:indentation
766 name: remove dependency
768 - name: 'xtesting-{tag}-dep-rmi'
771 name: pull dependency
773 - name: 'xtesting-{tag}-dep-pull'
778 - name: 'xtesting-opnfv-xtesting-{tag}-build'
785 recipients: cedric.ollivier@orange.com
788 name: 'xtesting-docker'
791 - 'xtesting-{tag}-docker'
797 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
798 sudo DEBIAN_FRONTEND=noninteractive apt-get \
799 -o DPkg::Lock::Timeout=300 install curl -y
801 curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
802 if [ "{repo}" = "_" ]; then
803 image={container}:{tag}
804 elif [ "{port}" = "None" ]; then
805 image={repo}/{container}:{tag}
807 image={repo}:{port}/{container}:{tag}
809 ./trivy image --exit-code 1 $image
812 name: 'xtesting-opnfv-xtesting-{tag}-trivy'
820 <<: *xtesting-containers
826 recipients: cedric.ollivier@orange.com
829 name: 'xtesting-opnfv-xtesting-trivy'
832 container: 'xtesting'
835 - 'xtesting-opnfv-xtesting-{tag}-trivy'
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 curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sudo sh -s -- -b .
846 if [ "{repo}" = "_" ]; then
847 image={container}:{tag}
848 elif [ "{port}" = "None" ]; then
849 image={repo}/{container}:{tag}
851 image={repo}:{port}/{container}:{tag}
856 name: 'xtesting-opnfv-xtesting-{tag}-grype'
864 <<: *xtesting-containers
870 recipients: cedric.ollivier@orange.com
873 name: 'xtesting-opnfv-xtesting-grype'
876 container: 'xtesting'
879 - 'xtesting-opnfv-xtesting-{tag}-grype'
885 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
886 sudo DEBIAN_FRONTEND=noninteractive apt-get \
887 -o DPkg::Lock::Timeout=300 install curl -y
889 sudo mkdir -p ~/.docker
890 curl -sSfL https://raw.githubusercontent.com/docker/sbom-cli-plugin/main/install.sh | sudo sh -s --
891 if [ "{repo}" = "_" ]; then
892 image={container}:{tag}
893 elif [ "{port}" = "None" ]; then
894 image={repo}/{container}:{tag}
896 image={repo}:{port}/{container}:{tag}
898 sudo docker sbom $image
901 name: 'xtesting-opnfv-xtesting-{tag}-sbom'
909 <<: *xtesting-containers
915 recipients: cedric.ollivier@orange.com
918 name: 'xtesting-opnfv-xtesting-sbom'
921 container: 'xtesting'
924 - 'xtesting-opnfv-xtesting-{tag}-sbom'
927 name: xtesting-docker
936 regex: ^xtesting-[a-z0-9.-]+-docker$
948 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$
960 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-grype$
972 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-sbom$