2 - xtesting-containers: &xtesting-containers
3 name: 'xtesting-containers'
6 container: '{container}'
9 - xtesting-params: &xtesting-params
10 name: 'xtesting-params'
23 branch: stable/wallaby
45 - xtesting-jobs: &xtesting-jobs
47 current-parameters: true
57 name: xtesting-build_tag
62 - xtesting-run-containers: &xtesting-run-containers
63 name: 'xtesting-run-containers'
64 <<: *xtesting-containers
66 privileged: '{privileged}'
72 name: xtesting-pull-containers
76 if [ "{repo}" = "_" ]; then
77 image={container}:{tag}
78 elif [ "{port}" = "None" ]; then
79 image={repo}/{container}:{tag}
81 image={repo}:{port}/{container}:{tag}
83 sudo docker pull $image
86 name: xtesting-run-containers
91 if [ "{volumes}" != "None" ]; then
92 for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
93 do volumes="-v $i $volumes"; done
96 if [ "{env}" != "None" ]; then
97 for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
98 do env="-e $i $env"; done
100 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
101 if [ "{repo}" = "_" ]; then
102 image={container}:{tag}
103 elif [ "{port}" = "None" ]; then
104 image={repo}/{container}:{tag}
106 image={repo}:{port}/{container}:{tag}
108 sudo docker run --rm \
109 --privileged={privileged} \
110 --network={network} \
113 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
114 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
115 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
116 -v /home/opnfv/xtesting/.boto:/root/.boto \
117 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
118 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
119 -e NODE_NAME=$slave \
120 -e BUILD_TAG=$BUILD_TAG \
121 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
122 $image run_tests -t {test} -p -r
125 name: xtesting-remove-images
129 if [ "{repo}" = "_" ]; then
130 image={container}:{tag}
131 elif [ "{port}" = "None" ]; then
132 image={repo}/{container}:{tag}
134 image={repo}:{port}/{container}:{tag}
136 sudo docker rmi $image || true
139 name: 'xtesting-{repo}-{container}-{tag}-pull'
144 - xtesting-pull-containers:
145 <<: *xtesting-containers
148 name: 'xtesting-opnfv-xtesting-pull'
150 container: 'xtesting'
152 - 'xtesting-{repo}-{container}-{tag}-pull'
155 name: 'xtesting-opnfv-xtesting-mts-pull'
157 container: 'xtesting-mts'
159 - 'xtesting-{repo}-{container}-{tag}-pull'
162 name: 'xtesting-{repo}-{container}-{tag}-rmi'
167 - xtesting-remove-images:
168 <<: *xtesting-containers
171 name: 'xtesting-opnfv-xtesting-rmi'
173 container: 'xtesting'
175 - 'xtesting-{repo}-{container}-{tag}-rmi'
178 name: 'xtesting-opnfv-xtesting-mts-rmi'
180 container: 'xtesting-mts'
182 - 'xtesting-{repo}-{container}-{tag}-rmi'
185 name: 'xtesting-opnfv-xtesting-{tag}-{test}-run'
189 - xtesting-build_tag:
192 - xtesting-run-containers:
193 <<: *xtesting-run-containers
196 name: 'xtesting-opnfv-xtesting'
200 container: 'xtesting'
219 - 'xtesting-opnfv-xtesting-{tag}-{test}-run'
222 name: 'xtesting-opnfv-xtesting-mts-{tag}-{test}-run'
226 - xtesting-build_tag:
229 - xtesting-run-containers:
230 <<: *xtesting-run-containers
233 name: 'xtesting-opnfv-xtesting-mts'
237 container: 'xtesting-mts'
243 - 'xtesting-opnfv-xtesting-mts-{tag}-{test}-run'
251 if [ "{volumes}" != "None" ]; then
252 for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
253 do volumes="-v $i $volumes"; done
256 if [ "{env}" != "None" ]; then
257 for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
258 do env="-e $i $env"; done
260 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
261 if [ "{repo}" = "_" ]; then
262 image={container}:{tag}
263 elif [ "{port}" = "None" ]; then
264 image={repo}/{container}:{tag}
266 image={repo}:{port}/{container}:{tag}
268 sudo docker run --rm \
271 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
272 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
273 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
274 -v /home/opnfv/xtesting/.boto:/root/.boto \
275 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
276 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
277 -e BUILD_TAG=$BUILD_TAG \
278 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
282 name: 'xtesting-{tag}-zip'
286 - xtesting-build_tag:
290 <<: *xtesting-containers
295 name: 'xtesting-{tag}-zip'
299 container: 'xtesting'
301 - 'xtesting-{tag}-zip'
304 name: 'xtesting-{tag}-daily'
305 project-type: multijob
311 - xtesting-build_tag:
313 # PyYAML and yamllint differ here
314 # see https://github.com/yaml/pyyaml/issues/234
315 # yamllint disable rule:indentation
319 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
320 # yamllint enable rule:indentation
323 name: remove former images
325 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
327 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
330 name: pull containers
332 - name: 'xtesting-opnfv-xtesting-{tag}-pull'
334 - name: 'xtesting-opnfv-xtesting-mts-{tag}-pull'
337 name: opnfv/xtesting:{tag}
339 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
341 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
343 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
345 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
347 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
349 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
351 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
354 name: opnfv/xtesting-mts:{tag}
356 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
359 name: dump all campaign data
361 - name: 'xtesting-{tag}-zip'
365 name: 'xtesting-daily'
368 - 'xtesting-{tag}-daily'
380 regex: ^xtesting-[a-z0-9.]+-daily$
382 - xtesting-build-containers: &xtesting-build-containers
383 name: 'xtesting-build-containers'
384 <<: *xtesting-containers
387 build_args: '{build_args}'
391 name: xtesting-build-containers
395 if [ "{repo}" = "_" ]; then
396 image={container}:{tag}
397 elif [ "{port}" = "None" ]; then
398 image={repo}/{container}:{tag}
400 image={repo}:{port}/{container}:{tag}
403 if [ "{build_args}" != "None" ]; then
404 for i in $(echo {build_args} | tr -d '[]' |sed "s/, / /g" ); \
405 do build_args="--build-arg $i $build_args"; done
407 if [ "{ref_arg}" != "None" ]; then
408 build_args="$build_args --build-arg {ref_arg}={ref}"
411 if [ "{from}" != "None" ]; then
412 sed -i {from} Dockerfile
414 sudo docker build $build_args \
415 --pull=false --no-cache --force-rm=true \
422 url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
423 refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
427 - xtesting-dep: &xtesting-dep
428 name: 'xtesting-containers'
432 dependency: '{dependency}'
435 name: xtesting-pull-dep-images
439 if [ "_" = "_" ]; then
440 image=alpine:{dependency}
441 elif [ "" = "None" ]; then
442 image=_/alpine:{dependency}
444 image=_:/alpine:{dependency}
446 sudo docker pull $image || true
449 name: xtesting-remove-dep-images
453 if [ "_" = "_" ]; then
454 image=alpine:{dependency}
455 elif [ "" = "None" ]; then
456 image=_/alpine:{dependency}
458 image=_:/alpine:{dependency}
460 sudo docker rmi $image || true
463 name: 'xtesting-{repo}-{tag}-dep-pull'
468 - xtesting-pull-dep-images:
472 name: 'xtesting-{repo}-{tag}-dep-pull'
475 - 'xtesting-{repo}-{tag}-dep-pull'
478 name: 'xtesting-{repo}-{tag}-dep-rmi'
483 - xtesting-remove-dep-images:
487 name: 'xtesting-{repo}-{tag}-dep-rmi'
490 - 'xtesting-{repo}-{tag}-dep-rmi'
497 sudo apt-get update && \
498 sudo DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y
499 sudo DEBIAN_FRONTEND=noninteractive \
500 apt-get install software-properties-common gpg -y
501 sudo add-apt-repository -y ppa:deadsnakes/ppa
502 sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive \
504 python3.9 python3.9-dev python3.9-distutils \
505 python3.8 python3.8-dev python3.8-distutils \
506 python3.7 python3.7-dev python3.6 python3.6-dev \
507 python python-dev python3-pip enchant -y
508 sudo pip3 install tox tox-pip-version
513 name: 'xtesting-{tag}-tox'
518 - xtesting-patchset-created:
530 - 'xtesting-{tag}-tox'
533 name: 'xtesting-{repo}-{container}-{tag}-gate'
541 - xtesting-build-containers:
542 <<: *xtesting-build-containers
544 build_args: '{build_args}'
547 name: xtesting-opnfv-xtesting-{tag}-gate
553 - 'xtesting-{repo}-{container}-{tag}-gate'
556 name: xtesting-opnfv-xtesting-mts-{tag}-gate
558 container: xtesting-mts
562 - 'xtesting-{repo}-{container}-{tag}-gate'
565 name: xtesting-patchset-created
569 - patchset-created-event
570 - comment-added-contains-event:
571 comment-contains-value: 'recheck'
572 - comment-added-contains-event:
573 comment-contains-value: 'reverify'
575 - project-compare-type: 'ANT'
576 project-pattern: 'functest-xtesting'
578 - branch-compare-type: 'ANT'
579 branch-pattern: '**/{branch}'
582 name: 'xtesting-{tag}-review'
583 project-type: multijob
585 - xtesting-patchset-created:
590 - xtesting-build_tag:
592 # PyYAML and yamllint differ here
593 # see https://github.com/yaml/pyyaml/issues/234
594 # yamllint disable rule:indentation
598 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
599 # yamllint enable rule:indentation
602 name: remove former images
604 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
606 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
609 name: remove dependency
611 - name: 'xtesting-{repo}-{tag}-dep-rmi'
614 name: pull dependency
616 - name: 'xtesting-{repo}-{tag}-dep-pull'
621 - name: 'xtesting-opnfv-xtesting-{tag}-gate'
624 name: opnfv/xtesting-mts
626 - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
629 name: opnfv/xtesting:{tag}
631 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
633 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
635 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
637 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
639 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
641 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
643 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
646 name: opnfv/xtesting-mts:{tag}
648 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
652 name: 'xtesting-review'
655 - 'xtesting-{tag}-review'
658 name: xtesting-review
667 regex: ^xtesting-[a-z0-9.]+-review$
679 regex: ^xtesting-[a-z0-9.]+-tox$
682 name: xtesting-push-containers
686 if [ "{repo}" = "_" ]; then
687 image={container}:{tag}
688 elif [ "{port}" = "None" ]; then
689 image={repo}/{container}:{tag}
691 image={repo}:{port}/{container}:{tag}
693 sudo docker push $image
696 name: xtesting-commit
702 name: 'xtesting-{repo}-{container}-{tag}-build'
710 - xtesting-build-containers:
711 <<: *xtesting-build-containers
713 build_args: '{build_args}'
714 - xtesting-push-containers:
715 <<: *xtesting-build-containers
719 name: xtesting-opnfv-xtesting-{tag}-build
725 - 'xtesting-{repo}-{container}-{tag}-build'
728 name: xtesting-opnfv-xtesting-mts-{tag}-build
730 container: xtesting-mts
734 - 'xtesting-{repo}-{container}-{tag}-build'
737 name: 'xtesting-{tag}-docker'
738 project-type: multijob
747 # PyYAML and yamllint differ here
748 # see https://github.com/yaml/pyyaml/issues/234
749 # yamllint disable rule:indentation
753 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
754 # yamllint enable rule:indentation
757 name: remove dependency
759 - name: 'xtesting-{repo}-{tag}-dep-rmi'
762 name: pull dependency
764 - name: 'xtesting-{repo}-{tag}-dep-pull'
769 - name: 'xtesting-opnfv-xtesting-{tag}-build'
772 name: opnfv/xtesting-mts
774 - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
781 sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive \
782 apt-get install curl -y
784 curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
785 if [ "{repo}" = "_" ]; then
786 image={container}:{tag}
787 elif [ "{port}" = "None" ]; then
788 image={repo}/{container}:{tag}
790 image={repo}:{port}/{container}:{tag}
792 ./trivy --exit-code 1 $image
795 name: 'xtesting-{repo}-{container}-{tag}-trivy'
803 <<: *xtesting-containers
806 name: 'xtesting-opnfv-xtesting-trivy'
808 container: 'xtesting'
810 - 'xtesting-{repo}-{container}-{tag}-trivy'
813 name: 'xtesting-opnfv-xtesting-mts-trivy'
815 container: 'xtesting-mts'
817 - 'xtesting-{repo}-{container}-{tag}-trivy'
823 - 'xtesting-{tag}-docker'
826 name: xtesting-docker
835 regex: ^xtesting-[a-z0-9.]+-docker$
847 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$