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" ); do volumes="-v $i $volumes"; done
95 if [ "{env}" != "None" ]; then
96 for i in $(eval echo {env} | tr -d '[] ' |sed "s/,/ /g" ); do env="-e $i $env"; done
98 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
99 if [ "{repo}" = "_" ]; then
100 image={container}:{tag}
101 elif [ "{port}" = "None" ]; then
102 image={repo}/{container}:{tag}
104 image={repo}:{port}/{container}:{tag}
106 sudo docker run --rm \
107 --privileged={privileged} \
108 --network={network} \
111 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
112 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
113 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
114 -v /home/opnfv/xtesting/.boto:/root/.boto \
115 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
116 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
117 -e NODE_NAME=$slave \
118 -e BUILD_TAG=$BUILD_TAG \
119 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
120 $image run_tests -t {test} -p -r
123 name: xtesting-remove-images
127 if [ "{repo}" = "_" ]; then
128 image={container}:{tag}
129 elif [ "{port}" = "None" ]; then
130 image={repo}/{container}:{tag}
132 image={repo}:{port}/{container}:{tag}
134 sudo docker rmi $image || true
137 name: 'xtesting-{repo}-{container}-{tag}-pull'
142 - xtesting-pull-containers:
143 <<: *xtesting-containers
146 name: 'xtesting-opnfv-xtesting-pull'
148 container: 'xtesting'
150 - 'xtesting-{repo}-{container}-{tag}-pull'
153 name: 'xtesting-opnfv-xtesting-mts-pull'
155 container: 'xtesting-mts'
157 - 'xtesting-{repo}-{container}-{tag}-pull'
160 name: 'xtesting-{repo}-{container}-{tag}-rmi'
165 - xtesting-remove-images:
166 <<: *xtesting-containers
169 name: 'xtesting-opnfv-xtesting-rmi'
171 container: 'xtesting'
173 - 'xtesting-{repo}-{container}-{tag}-rmi'
176 name: 'xtesting-opnfv-xtesting-mts-rmi'
178 container: 'xtesting-mts'
180 - 'xtesting-{repo}-{container}-{tag}-rmi'
183 name: 'xtesting-opnfv-xtesting-{tag}-{test}-run'
187 - xtesting-build_tag:
190 - xtesting-run-containers:
191 <<: *xtesting-run-containers
194 name: 'xtesting-opnfv-xtesting'
198 container: 'xtesting'
217 - 'xtesting-opnfv-xtesting-{tag}-{test}-run'
220 name: 'xtesting-opnfv-xtesting-mts-{tag}-{test}-run'
224 - xtesting-build_tag:
227 - xtesting-run-containers:
228 <<: *xtesting-run-containers
231 name: 'xtesting-opnfv-xtesting-mts'
235 container: 'xtesting-mts'
241 - 'xtesting-opnfv-xtesting-mts-{tag}-{test}-run'
249 if [ "{volumes}" != "None" ]; then
250 for i in $(echo {volumes} | tr -d '[] ' |sed "s/,/ /g" ); do volumes="-v $i $volumes"; done
253 if [ "{env}" != "None" ]; then
254 for i in $(eval echo {env} | tr -d '[] ' |sed "s/,/ /g" ); do env="-e $i $env"; done
256 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
257 if [ "{repo}" = "_" ]; then
258 image={container}:{tag}
259 elif [ "{port}" = "None" ]; then
260 image={repo}/{container}:{tag}
262 image={repo}:{port}/{container}:{tag}
264 sudo docker run --rm \
267 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
268 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
269 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
270 -v /home/opnfv/xtesting/.boto:/root/.boto \
271 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
272 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
273 -e BUILD_TAG=$BUILD_TAG \
274 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
278 name: 'xtesting-{tag}-zip'
282 - xtesting-build_tag:
286 <<: *xtesting-containers
291 name: 'xtesting-{tag}-zip'
295 container: 'xtesting'
297 - 'xtesting-{tag}-zip'
300 name: 'xtesting-{tag}-daily'
301 project-type: multijob
307 - xtesting-build_tag:
309 # PyYAML and yamllint differ here
310 # see https://github.com/yaml/pyyaml/issues/234
311 # yamllint disable rule:indentation
315 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
316 # yamllint enable rule:indentation
319 name: remove former images
321 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
323 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
326 name: pull containers
328 - name: 'xtesting-opnfv-xtesting-{tag}-pull'
330 - name: 'xtesting-opnfv-xtesting-mts-{tag}-pull'
333 name: opnfv/xtesting:{tag}
335 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
337 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
339 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
341 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
343 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
345 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
347 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
350 name: opnfv/xtesting-mts:{tag}
352 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
355 name: dump all campaign data
357 - name: 'xtesting-{tag}-zip'
361 name: 'xtesting-daily'
364 - 'xtesting-{tag}-daily'
376 regex: ^xtesting-[a-z0-9.]+-daily$
378 - xtesting-build-containers: &xtesting-build-containers
379 name: 'xtesting-build-containers'
380 <<: *xtesting-containers
383 buildargs: '{buildargs}'
387 name: xtesting-build-containers
391 if [ "{repo}" = "_" ]; then
392 image={container}:{tag}
393 elif [ "{port}" = "None" ]; then
394 image={repo}/{container}:{tag}
396 image={repo}:{port}/{container}:{tag}
399 if [ "{buildargs}" != "None" ]; then
400 build_args="{buildargs}"
402 if [ "{ref_arg}" != "None" ]; then
403 build_args="$build_args --build-arg {ref_arg}={ref}"
406 if [ "{from}" != "None" ]; then
407 sed -i {from} Dockerfile
409 sudo docker build $build_args \
410 --pull=false --no-cache --force-rm=true \
417 url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
418 refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
422 - xtesting-dep: &xtesting-dep
423 name: 'xtesting-containers'
427 dependency: '{dependency}'
430 name: xtesting-pull-dep-images
434 if [ "_" = "_" ]; then
435 image=alpine:{dependency}
436 elif [ "" = "None" ]; then
437 image=_/alpine:{dependency}
439 image=_:/alpine:{dependency}
441 sudo docker pull $image || true
444 name: xtesting-remove-dep-images
448 if [ "_" = "_" ]; then
449 image=alpine:{dependency}
450 elif [ "" = "None" ]; then
451 image=_/alpine:{dependency}
453 image=_:/alpine:{dependency}
455 sudo docker rmi $image || true
458 name: 'xtesting-{repo}-{tag}-dep-pull'
463 - xtesting-pull-dep-images:
467 name: 'xtesting-{repo}-{tag}-dep-pull'
470 - 'xtesting-{repo}-{tag}-dep-pull'
473 name: 'xtesting-{repo}-{tag}-dep-rmi'
478 - xtesting-remove-dep-images:
482 name: 'xtesting-{repo}-{tag}-dep-rmi'
485 - 'xtesting-{repo}-{tag}-dep-rmi'
492 sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive \
493 apt-get install software-properties-common gpg -y
494 sudo add-apt-repository -y ppa:deadsnakes/ppa
495 sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive \
497 python3.9 python3.9-dev python3.9-distutils \
498 python3.8 python3.8-dev python3.8-distutils \
499 python3.7 python3.7-dev python3.6 python3.6-dev \
500 python python-dev python3-pip enchant -y
501 sudo pip3 install tox tox-pip-version
506 name: 'xtesting-{tag}-tox'
511 - xtesting-patchset-created:
523 - 'xtesting-{tag}-tox'
526 name: 'xtesting-{repo}-{container}-{tag}-gate'
534 - xtesting-build-containers:
535 <<: *xtesting-build-containers
537 buildargs: '{buildargs}'
540 name: xtesting-opnfv-xtesting-{tag}-gate
546 - 'xtesting-{repo}-{container}-{tag}-gate'
549 name: xtesting-opnfv-xtesting-mts-{tag}-gate
551 container: xtesting-mts
555 - 'xtesting-{repo}-{container}-{tag}-gate'
558 name: xtesting-patchset-created
562 - patchset-created-event
563 - comment-added-contains-event:
564 comment-contains-value: 'recheck'
565 - comment-added-contains-event:
566 comment-contains-value: 'reverify'
568 - project-compare-type: 'ANT'
569 project-pattern: 'functest-xtesting'
571 - branch-compare-type: 'ANT'
572 branch-pattern: '**/{branch}'
575 name: 'xtesting-{tag}-review'
576 project-type: multijob
578 - xtesting-patchset-created:
583 - xtesting-build_tag:
585 # PyYAML and yamllint differ here
586 # see https://github.com/yaml/pyyaml/issues/234
587 # yamllint disable rule:indentation
591 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
592 # yamllint enable rule:indentation
595 name: remove former images
597 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
599 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
602 name: remove dependency
604 - name: 'xtesting-{repo}-{tag}-dep-rmi'
607 name: pull dependency
609 - name: 'xtesting-{repo}-{tag}-dep-pull'
614 - name: 'xtesting-opnfv-xtesting-{tag}-gate'
617 name: opnfv/xtesting-mts
619 - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
622 name: opnfv/xtesting:{tag}
624 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
626 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
628 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
630 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
632 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
634 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
636 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
639 name: opnfv/xtesting-mts:{tag}
641 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
645 name: 'xtesting-review'
648 - 'xtesting-{tag}-review'
651 name: xtesting-review
660 regex: ^xtesting-[a-z0-9.]+-review$
672 regex: ^xtesting-[a-z0-9.]+-tox$
675 name: xtesting-push-containers
679 if [ "{repo}" = "_" ]; then
680 image={container}:{tag}
681 elif [ "{port}" = "None" ]; then
682 image={repo}/{container}:{tag}
684 image={repo}:{port}/{container}:{tag}
686 sudo docker push $image
689 name: xtesting-commit
695 name: 'xtesting-{repo}-{container}-{tag}-build'
703 - xtesting-build-containers:
704 <<: *xtesting-build-containers
706 buildargs: '{buildargs}'
707 - xtesting-push-containers:
708 <<: *xtesting-build-containers
712 name: xtesting-opnfv-xtesting-{tag}-build
718 - 'xtesting-{repo}-{container}-{tag}-build'
721 name: xtesting-opnfv-xtesting-mts-{tag}-build
723 container: xtesting-mts
727 - 'xtesting-{repo}-{container}-{tag}-build'
730 name: 'xtesting-{tag}-docker'
731 project-type: multijob
740 # PyYAML and yamllint differ here
741 # see https://github.com/yaml/pyyaml/issues/234
742 # yamllint disable rule:indentation
746 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
747 # yamllint enable rule:indentation
750 name: remove dependency
752 - name: 'xtesting-{repo}-{tag}-dep-rmi'
755 name: pull dependency
757 - name: 'xtesting-{repo}-{tag}-dep-pull'
762 - name: 'xtesting-opnfv-xtesting-{tag}-build'
765 name: opnfv/xtesting-mts
767 - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
774 sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive \
775 apt-get install curl -y
777 curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
778 if [ "{repo}" = "_" ]; then
779 image={container}:{tag}
780 elif [ "{port}" = "None" ]; then
781 image={repo}/{container}:{tag}
783 image={repo}:{port}/{container}:{tag}
785 ./trivy --exit-code 1 $image
788 name: 'xtesting-{repo}-{container}-{tag}-trivy'
796 <<: *xtesting-containers
799 name: 'xtesting-opnfv-xtesting-trivy'
801 container: 'xtesting'
803 - 'xtesting-{repo}-{container}-{tag}-trivy'
806 name: 'xtesting-opnfv-xtesting-mts-trivy'
808 container: 'xtesting-mts'
810 - 'xtesting-{repo}-{container}-{tag}-trivy'
816 - 'xtesting-{tag}-docker'
819 name: xtesting-docker
828 regex: ^xtesting-[a-z0-9.]+-docker$
840 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$