2 - xtesting-containers: &xtesting-containers
3 name: 'xtesting-containers'
6 container: '{container}'
9 - xtesting-params: &xtesting-params
10 name: 'xtesting-params'
29 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}'
80 name: xtesting-pull-containers
84 if [ "{repo}" = "_" ]; then
85 image={container}:{tag}
86 elif [ "{port}" = "None" ]; then
87 image={repo}/{container}:{tag}
89 image={repo}:{port}/{container}:{tag}
91 sudo docker pull $image
94 name: xtesting-run-containers
99 if [ "{volumes}" != "None" ]; then
100 for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
101 do volumes="-v $i $volumes"; done
104 if [ "{env}" != "None" ]; then
105 for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
106 do env="-e $i $env"; done
108 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
109 if [ "{repo}" = "_" ]; then
110 image={container}:{tag}
111 elif [ "{port}" = "None" ]; then
112 image={repo}/{container}:{tag}
114 image={repo}:{port}/{container}:{tag}
116 sudo mkdir -p $WORKSPACE/results
117 sudo chown {uid}:{gid} $WORKSPACE/results
118 sudo docker run --rm \
119 --privileged={privileged} \
120 --network={network} \
123 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
124 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
125 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
126 -v /home/opnfv/xtesting/.boto:/etc/boto.cfg \
127 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
128 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
129 -e NODE_NAME=$slave \
130 -e BUILD_TAG=$BUILD_TAG \
131 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
132 $image run_tests -t {test} -p -r
135 name: xtesting-remove-images
139 if [ "{repo}" = "_" ]; then
140 image={container}:{tag}
141 elif [ "{port}" = "None" ]; then
142 image={repo}/{container}:{tag}
144 image={repo}:{port}/{container}:{tag}
146 sudo docker rmi $image || true
149 name: 'xtesting-{repo}-{container}-{tag}-pull'
154 - xtesting-pull-containers:
155 <<: *xtesting-containers
158 name: 'xtesting-opnfv-xtesting-pull'
160 container: 'xtesting'
162 - 'xtesting-{repo}-{container}-{tag}-pull'
165 name: 'xtesting-opnfv-xtesting-mts-pull'
167 container: 'xtesting-mts'
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-mts-rmi'
190 container: 'xtesting-mts'
192 - 'xtesting-{repo}-{container}-{tag}-rmi'
195 name: 'xtesting-opnfv-xtesting-{tag}-{test}-run'
199 - xtesting-build_tag:
202 - xtesting-run-containers:
203 <<: *xtesting-run-containers
206 name: 'xtesting-opnfv-xtesting'
210 container: 'xtesting'
231 - 'xtesting-opnfv-xtesting-{tag}-{test}-run'
234 name: 'xtesting-opnfv-xtesting-mts-{tag}-{test}-run'
238 - xtesting-build_tag:
241 - xtesting-run-containers:
242 <<: *xtesting-run-containers
245 name: 'xtesting-opnfv-xtesting-mts'
249 container: 'xtesting-mts'
257 - 'xtesting-opnfv-xtesting-mts-{tag}-{test}-run'
265 if [ "{volumes}" != "None" ]; then
266 for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
267 do volumes="-v $i $volumes"; done
270 if [ "{env}" != "None" ]; then
271 for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
272 do env="-e $i $env"; done
274 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
275 if [ "{repo}" = "_" ]; then
276 image={container}:{tag}
277 elif [ "{port}" = "None" ]; then
278 image={repo}/{container}:{tag}
280 image={repo}:{port}/{container}:{tag}
282 sudo mkdir -p $WORKSPACE/results
283 sudo chown {uid}:{gid} $WORKSPACE/results
284 sudo docker run --rm \
287 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
288 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
289 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
290 -v /home/opnfv/xtesting/.boto:/etc/boto.cfg \
291 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
292 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
293 -e BUILD_TAG=$BUILD_TAG \
294 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
298 name: 'xtesting-{tag}-zip'
302 - xtesting-build_tag:
306 <<: *xtesting-containers
313 name: 'xtesting-{tag}-zip'
317 container: 'xtesting'
321 - 'xtesting-{tag}-zip'
324 name: 'xtesting-{tag}-daily'
325 project-type: multijob
331 - xtesting-build_tag:
333 # PyYAML and yamllint differ here
334 # see https://github.com/yaml/pyyaml/issues/234
335 # yamllint disable rule:indentation
339 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
340 # yamllint enable rule:indentation
343 name: remove former images
345 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
347 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
350 name: pull containers
352 - name: 'xtesting-opnfv-xtesting-{tag}-pull'
354 - name: 'xtesting-opnfv-xtesting-mts-{tag}-pull'
357 name: opnfv/xtesting:{tag}
359 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
361 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
363 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
365 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
367 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
369 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
371 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
374 name: opnfv/xtesting-mts:{tag}
376 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
379 name: dump all campaign data
381 - name: 'xtesting-{tag}-zip'
388 recipients: cedric.ollivier@orange.com
391 name: 'xtesting-daily'
394 - 'xtesting-{tag}-daily'
406 regex: ^xtesting-[a-z0-9.]+-daily$
408 - xtesting-build-containers: &xtesting-build-containers
409 name: 'xtesting-build-containers'
410 <<: *xtesting-containers
413 build_args: '{build_args}'
417 name: xtesting-build-containers
421 if [ "{repo}" = "_" ]; then
422 image={container}:{tag}
423 elif [ "{port}" = "None" ]; then
424 image={repo}/{container}:{tag}
426 image={repo}:{port}/{container}:{tag}
429 if [ "{build_args}" != "None" ]; then
430 for i in $(echo {build_args} | tr -d '[]' |sed "s/, / /g" ); \
431 do build_args="--build-arg $i $build_args"; done
433 if [ "{ref_arg}" != "None" ]; then
434 build_args="$build_args --build-arg {ref_arg}={ref}"
437 if [ "{from}" != "None" ]; then
438 sed -i {from} Dockerfile
440 sudo docker build $build_args \
441 --pull=false --no-cache --force-rm=true \
448 url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
449 refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
453 - xtesting-dep: &xtesting-dep
454 name: 'xtesting-containers'
458 dependency: '{dependency}'
461 name: xtesting-pull-dep-images
465 if [ "_" = "_" ]; then
466 image=alpine:{dependency}
467 elif [ "" = "None" ]; then
468 image=_/alpine:{dependency}
470 image=_:/alpine:{dependency}
472 sudo docker pull $image || true
475 name: xtesting-remove-dep-images
479 if [ "_" = "_" ]; then
480 image=alpine:{dependency}
481 elif [ "" = "None" ]; then
482 image=_/alpine:{dependency}
484 image=_:/alpine:{dependency}
486 sudo docker rmi $image || true
489 name: 'xtesting-{repo}-{tag}-dep-pull'
494 - xtesting-pull-dep-images:
498 name: 'xtesting-{repo}-{tag}-dep-pull'
501 - 'xtesting-{repo}-{tag}-dep-pull'
504 name: 'xtesting-{repo}-{tag}-dep-rmi'
509 - xtesting-remove-dep-images:
513 name: 'xtesting-{repo}-{tag}-dep-rmi'
516 - 'xtesting-{repo}-{tag}-dep-rmi'
523 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
524 sudo DEBIAN_FRONTEND=noninteractive apt-get \
525 -o DPkg::Lock::Timeout=300 dist-upgrade -y
526 sudo DEBIAN_FRONTEND=noninteractive \
527 apt-get -o DPkg::Lock::Timeout=300 install software-properties-common gpg -y
528 sudo add-apt-repository -y ppa:deadsnakes/ppa
529 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
530 sudo DEBIAN_FRONTEND=noninteractive apt-get \
531 -o DPkg::Lock::Timeout=300 install \
532 python3.9 python3.9-dev python3.9-distutils \
533 python3.8 python3.8-dev python3.8-distutils \
534 python3.7 python3.7-dev python3.6 python3.6-dev \
535 python python-dev python3-pip enchant -y
536 sudo pip3 install tox tox-pip-version
541 name: 'xtesting-{tag}-tox'
546 - xtesting-patchset-created:
558 - 'xtesting-{tag}-tox'
561 name: 'xtesting-{repo}-{container}-{tag}-gate'
569 - xtesting-build-containers:
570 <<: *xtesting-build-containers
572 build_args: '{build_args}'
575 name: xtesting-opnfv-xtesting-{tag}-gate
581 - 'xtesting-{repo}-{container}-{tag}-gate'
584 name: xtesting-opnfv-xtesting-mts-{tag}-gate
586 container: xtesting-mts
590 - 'xtesting-{repo}-{container}-{tag}-gate'
593 name: xtesting-patchset-created
597 - patchset-created-event
598 - comment-added-contains-event:
599 comment-contains-value: 'recheck'
600 - comment-added-contains-event:
601 comment-contains-value: 'reverify'
603 - project-compare-type: 'ANT'
604 project-pattern: 'functest-xtesting'
606 - branch-compare-type: 'ANT'
607 branch-pattern: '**/{branch}'
610 name: 'xtesting-{tag}-review'
611 project-type: multijob
613 - xtesting-patchset-created:
618 - xtesting-build_tag:
620 # PyYAML and yamllint differ here
621 # see https://github.com/yaml/pyyaml/issues/234
622 # yamllint disable rule:indentation
626 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
627 # yamllint enable rule:indentation
630 name: remove former images
632 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
634 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
637 name: remove dependency
639 - name: 'xtesting-{repo}-{tag}-dep-rmi'
642 name: pull dependency
644 - name: 'xtesting-{repo}-{tag}-dep-pull'
649 - name: 'xtesting-opnfv-xtesting-{tag}-gate'
652 name: opnfv/xtesting-mts
654 - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
657 name: opnfv/xtesting:{tag}
659 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
661 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
663 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
665 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
667 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
669 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
671 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
674 name: opnfv/xtesting-mts:{tag}
676 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
683 recipients: cedric.ollivier@orange.com
686 name: 'xtesting-review'
689 - 'xtesting-{tag}-review'
692 name: xtesting-review
701 regex: ^xtesting-[a-z0-9.]+-review$
713 regex: ^xtesting-[a-z0-9.]+-tox$
716 name: xtesting-push-containers
720 if [ "{repo}" = "_" ]; then
721 image={container}:{tag}
722 elif [ "{port}" = "None" ]; then
723 image={repo}/{container}:{tag}
725 image={repo}:{port}/{container}:{tag}
727 sudo docker push $image
730 name: xtesting-commit
736 name: 'xtesting-{repo}-{container}-{tag}-build'
744 - xtesting-build-containers:
745 <<: *xtesting-build-containers
747 build_args: '{build_args}'
748 - xtesting-push-containers:
749 <<: *xtesting-build-containers
753 name: xtesting-opnfv-xtesting-{tag}-build
759 - 'xtesting-{repo}-{container}-{tag}-build'
762 name: xtesting-opnfv-xtesting-mts-{tag}-build
764 container: xtesting-mts
768 - 'xtesting-{repo}-{container}-{tag}-build'
771 name: 'xtesting-{tag}-docker'
772 project-type: multijob
781 # PyYAML and yamllint differ here
782 # see https://github.com/yaml/pyyaml/issues/234
783 # yamllint disable rule:indentation
787 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
788 # yamllint enable rule:indentation
791 name: remove dependency
793 - name: 'xtesting-{repo}-{tag}-dep-rmi'
796 name: pull dependency
798 - name: 'xtesting-{repo}-{tag}-dep-pull'
803 - name: 'xtesting-opnfv-xtesting-{tag}-build'
806 name: opnfv/xtesting-mts
808 - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
815 recipients: cedric.ollivier@orange.com
821 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
822 sudo DEBIAN_FRONTEND=noninteractive apt-get \
823 -o DPkg::Lock::Timeout=300 install curl -y
825 curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
826 if [ "{repo}" = "_" ]; then
827 image={container}:{tag}
828 elif [ "{port}" = "None" ]; then
829 image={repo}/{container}:{tag}
831 image={repo}:{port}/{container}:{tag}
833 ./trivy --exit-code 1 $image
836 name: 'xtesting-{repo}-{container}-{tag}-trivy'
844 <<: *xtesting-containers
850 recipients: cedric.ollivier@orange.com
853 name: 'xtesting-opnfv-xtesting-trivy'
855 container: 'xtesting'
857 - 'xtesting-{repo}-{container}-{tag}-trivy'
860 name: 'xtesting-opnfv-xtesting-mts-trivy'
862 container: 'xtesting-mts'
864 - 'xtesting-{repo}-{container}-{tag}-trivy'
870 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
871 sudo DEBIAN_FRONTEND=noninteractive apt-get \
872 -o DPkg::Lock::Timeout=300 install curl -y
874 curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sudo sh -s -- -b .
875 if [ "{repo}" = "_" ]; then
876 image={container}:{tag}
877 elif [ "{port}" = "None" ]; then
878 image={repo}/{container}:{tag}
880 image={repo}:{port}/{container}:{tag}
885 name: 'xtesting-{repo}-{container}-{tag}-grype'
893 <<: *xtesting-containers
899 recipients: cedric.ollivier@orange.com
902 name: 'xtesting-opnfv-xtesting-grype'
904 container: 'xtesting'
906 - 'xtesting-{repo}-{container}-{tag}-grype'
909 name: 'xtesting-opnfv-xtesting-mts-grype'
911 container: 'xtesting-mts'
913 - 'xtesting-{repo}-{container}-{tag}-grype'
919 - 'xtesting-{tag}-docker'
922 name: xtesting-docker
931 regex: ^xtesting-[a-z0-9.]+-docker$
943 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$
955 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-grype$