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 apt-get install \
493 software-properties-common gpg -y
494 sudo add-apt-repository -y ppa:deadsnakes/ppa
495 sudo apt-get update && sudo apt-get install \
496 python3.9 python3.9-dev python3.9-distutils \
497 python3.8 python3.8-dev python3.8-distutils \
498 python3.7 python3.7-dev python3.6 python3.6-dev \
499 python python-dev python3-pip enchant -y
500 sudo pip3 install tox tox-pip-version
505 name: 'xtesting-{tag}-tox'
510 - xtesting-patchset-created:
522 - 'xtesting-{tag}-tox'
525 name: 'xtesting-{repo}-{container}-{tag}-gate'
533 - xtesting-build-containers:
534 <<: *xtesting-build-containers
536 buildargs: '{buildargs}'
539 name: xtesting-opnfv-xtesting-{tag}-gate
545 - 'xtesting-{repo}-{container}-{tag}-gate'
548 name: xtesting-opnfv-xtesting-mts-{tag}-gate
550 container: xtesting-mts
554 - 'xtesting-{repo}-{container}-{tag}-gate'
557 name: xtesting-patchset-created
561 - patchset-created-event
562 - comment-added-contains-event:
563 comment-contains-value: 'recheck'
564 - comment-added-contains-event:
565 comment-contains-value: 'reverify'
567 - project-compare-type: 'ANT'
568 project-pattern: 'functest-xtesting'
570 - branch-compare-type: 'ANT'
571 branch-pattern: '**/{branch}'
574 name: 'xtesting-{tag}-review'
575 project-type: multijob
577 - xtesting-patchset-created:
582 - xtesting-build_tag:
584 # PyYAML and yamllint differ here
585 # see https://github.com/yaml/pyyaml/issues/234
586 # yamllint disable rule:indentation
590 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
591 # yamllint enable rule:indentation
594 name: remove former images
596 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
598 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
601 name: remove dependency
603 - name: 'xtesting-{repo}-{tag}-dep-rmi'
606 name: pull dependency
608 - name: 'xtesting-{repo}-{tag}-dep-pull'
613 - name: 'xtesting-opnfv-xtesting-{tag}-gate'
616 name: opnfv/xtesting-mts
618 - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
621 name: opnfv/xtesting:{tag}
623 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
625 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
627 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
629 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
631 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
633 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
635 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
638 name: opnfv/xtesting-mts:{tag}
640 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
644 name: 'xtesting-review'
647 - 'xtesting-{tag}-review'
650 name: xtesting-review
659 regex: ^xtesting-[a-z0-9.]+-review$
671 regex: ^xtesting-[a-z0-9.]+-tox$
674 name: xtesting-push-containers
678 if [ "{repo}" = "_" ]; then
679 image={container}:{tag}
680 elif [ "{port}" = "None" ]; then
681 image={repo}/{container}:{tag}
683 image={repo}:{port}/{container}:{tag}
685 sudo docker push $image
688 name: xtesting-commit
694 name: 'xtesting-{repo}-{container}-{tag}-build'
702 - xtesting-build-containers:
703 <<: *xtesting-build-containers
705 buildargs: '{buildargs}'
706 - xtesting-push-containers:
707 <<: *xtesting-build-containers
711 name: xtesting-opnfv-xtesting-{tag}-build
717 - 'xtesting-{repo}-{container}-{tag}-build'
720 name: xtesting-opnfv-xtesting-mts-{tag}-build
722 container: xtesting-mts
726 - 'xtesting-{repo}-{container}-{tag}-build'
729 name: 'xtesting-{tag}-docker'
730 project-type: multijob
739 # PyYAML and yamllint differ here
740 # see https://github.com/yaml/pyyaml/issues/234
741 # yamllint disable rule:indentation
745 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
746 # yamllint enable rule:indentation
749 name: remove dependency
751 - name: 'xtesting-{repo}-{tag}-dep-rmi'
754 name: pull dependency
756 - name: 'xtesting-{repo}-{tag}-dep-pull'
761 - name: 'xtesting-opnfv-xtesting-{tag}-build'
764 name: opnfv/xtesting-mts
766 - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
773 sudo apt-get update && sudo apt-get install curl -y
775 curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
776 if [ "{repo}" = "_" ]; then
777 image={container}:{tag}
778 elif [ "{port}" = "None" ]; then
779 image={repo}/{container}:{tag}
781 image={repo}:{port}/{container}:{tag}
783 ./trivy --exit-code 1 $image
786 name: 'xtesting-{repo}-{container}-{tag}-trivy'
794 <<: *xtesting-containers
797 name: 'xtesting-opnfv-xtesting-trivy'
799 container: 'xtesting'
801 - 'xtesting-{repo}-{container}-{tag}-trivy'
804 name: 'xtesting-opnfv-xtesting-mts-trivy'
806 container: 'xtesting-mts'
808 - 'xtesting-{repo}-{container}-{tag}-trivy'
814 - 'xtesting-{tag}-docker'
817 name: xtesting-docker
826 regex: ^xtesting-[a-z0-9.]+-docker$
838 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$