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
90 volumes=; for i in $(echo {volumes} | tr -d '[] ' |sed "s/,/ /g" ); do volumes="-v $i $volumes"; done
91 env=; for i in $(eval echo {env} | tr -d '[] ' |sed "s/,/ /g" ); do env="-e $i $env"; done
92 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
93 if [ "{repo}" = "_" ]; then
94 image={container}:{tag}
95 elif [ "{port}" = "None" ]; then
96 image={repo}/{container}:{tag}
98 image={repo}:{port}/{container}:{tag}
100 sudo docker run --rm \
101 --privileged={privileged} \
102 --network={network} \
105 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
106 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
107 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
108 -v /home/opnfv/xtesting/.boto:/root/.boto \
109 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
110 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
111 -e NODE_NAME=$slave \
112 -e BUILD_TAG=$BUILD_TAG \
113 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
114 $image run_tests -t {test} -p -r
117 name: xtesting-remove-images
121 if [ "{repo}" = "_" ]; then
122 image={container}:{tag}
123 elif [ "{port}" = "None" ]; then
124 image={repo}/{container}:{tag}
126 image={repo}:{port}/{container}:{tag}
128 sudo docker rmi $image || true
131 name: 'xtesting-{repo}-{container}-{tag}-pull'
136 - xtesting-pull-containers:
137 <<: *xtesting-containers
140 name: 'xtesting-opnfv-xtesting-pull'
142 container: 'xtesting'
144 - 'xtesting-{repo}-{container}-{tag}-pull'
147 name: 'xtesting-opnfv-xtesting-mts-pull'
149 container: 'xtesting-mts'
151 - 'xtesting-{repo}-{container}-{tag}-pull'
154 name: 'xtesting-{repo}-{container}-{tag}-rmi'
159 - xtesting-remove-images:
160 <<: *xtesting-containers
163 name: 'xtesting-opnfv-xtesting-rmi'
165 container: 'xtesting'
167 - 'xtesting-{repo}-{container}-{tag}-rmi'
170 name: 'xtesting-opnfv-xtesting-mts-rmi'
172 container: 'xtesting-mts'
174 - 'xtesting-{repo}-{container}-{tag}-rmi'
177 name: 'xtesting-opnfv-xtesting-{tag}-{test}-run'
181 - xtesting-build_tag:
184 - xtesting-run-containers:
185 <<: *xtesting-run-containers
188 name: 'xtesting-opnfv-xtesting'
192 container: 'xtesting'
211 - 'xtesting-opnfv-xtesting-{tag}-{test}-run'
214 name: 'xtesting-opnfv-xtesting-mts-{tag}-{test}-run'
218 - xtesting-build_tag:
221 - xtesting-run-containers:
222 <<: *xtesting-run-containers
225 name: 'xtesting-opnfv-xtesting-mts'
229 container: 'xtesting-mts'
235 - 'xtesting-opnfv-xtesting-mts-{tag}-{test}-run'
242 volumes=; for i in $(echo {volumes} | tr -d '[] ' |sed "s/,/ /g" ); do volumes="-v $i $volumes"; done
243 env=; for i in $(eval echo {env} | tr -d '[] ' |sed "s/,/ /g" ); do env="-e $i $env"; done
244 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
245 if [ "{repo}" = "_" ]; then
246 image={container}:{tag}
247 elif [ "{port}" = "None" ]; then
248 image={repo}/{container}:{tag}
250 image={repo}:{port}/{container}:{tag}
252 sudo docker run --rm \
255 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
256 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
257 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
258 -v /home/opnfv/xtesting/.boto:/root/.boto \
259 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
260 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
261 -e BUILD_TAG=$BUILD_TAG \
262 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
266 name: 'xtesting-{tag}-zip'
270 - xtesting-build_tag:
274 <<: *xtesting-containers
279 name: 'xtesting-{tag}-zip'
283 container: 'xtesting'
285 - 'xtesting-{tag}-zip'
288 name: 'xtesting-{tag}-daily'
289 project-type: multijob
295 - xtesting-build_tag:
297 # PyYAML and yamllint differ here
298 # see https://github.com/yaml/pyyaml/issues/234
299 # yamllint disable rule:indentation
303 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
304 # yamllint enable rule:indentation
307 name: remove former images
309 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
311 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
314 name: pull containers
316 - name: 'xtesting-opnfv-xtesting-{tag}-pull'
318 - name: 'xtesting-opnfv-xtesting-mts-{tag}-pull'
321 name: opnfv/xtesting:{tag}
323 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
325 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
327 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
329 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
331 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
333 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
335 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
338 name: opnfv/xtesting-mts:{tag}
340 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
343 name: dump all campaign data
345 - name: 'xtesting-{tag}-zip'
349 name: 'xtesting-daily'
352 - 'xtesting-{tag}-daily'
364 regex: ^xtesting-[a-z0-9.]+-daily$
366 - xtesting-build-containers: &xtesting-build-containers
367 name: 'xtesting-build-containers'
368 <<: *xtesting-containers
371 buildargs: '{buildargs}'
375 name: xtesting-build-containers
379 if [ "{repo}" = "_" ]; then
380 image={container}:{tag}
381 elif [ "{port}" = "None" ]; then
382 image={repo}/{container}:{tag}
384 image={repo}:{port}/{container}:{tag}
387 if [ "{buildargs}" != "None" ]; then
388 build_args="{buildargs}"
390 if [ "{ref_arg}" != "None" ]; then
391 build_args="$build_args --build-arg {ref_arg}={ref}"
394 if [ "{from}" != "None" ]; then
395 sed -i {from} Dockerfile
397 sudo docker build $build_args \
398 --pull=false --no-cache --force-rm=true \
405 url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
406 refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
410 - xtesting-dep: &xtesting-dep
411 name: 'xtesting-containers'
415 dependency: '{dependency}'
418 name: xtesting-pull-dep-images
422 if [ "_" = "_" ]; then
423 image=alpine:{dependency}
424 elif [ "" = "None" ]; then
425 image=_/alpine:{dependency}
427 image=_:/alpine:{dependency}
429 sudo docker pull $image || true
432 name: xtesting-remove-dep-images
436 if [ "_" = "_" ]; then
437 image=alpine:{dependency}
438 elif [ "" = "None" ]; then
439 image=_/alpine:{dependency}
441 image=_:/alpine:{dependency}
443 sudo docker rmi $image || true
446 name: 'xtesting-{repo}-{tag}-dep-pull'
451 - xtesting-pull-dep-images:
455 name: 'xtesting-{repo}-{tag}-dep-pull'
458 - 'xtesting-{repo}-{tag}-dep-pull'
461 name: 'xtesting-{repo}-{tag}-dep-rmi'
466 - xtesting-remove-dep-images:
470 name: 'xtesting-{repo}-{tag}-dep-rmi'
473 - 'xtesting-{repo}-{tag}-dep-rmi'
480 sudo apt-get update && sudo apt-get install \
481 software-properties-common gpg -y
482 sudo add-apt-repository -y ppa:deadsnakes/ppa
483 sudo apt-get update && sudo apt-get install python3.8 \
484 python3.8-dev python3.8-distutils \
485 python3.7 python3.7-dev python3.6 python3.6-dev \
486 python python-dev python3-pip enchant -y
487 sudo pip3 install tox tox-pip-version
492 name: 'xtesting-{tag}-tox'
497 - xtesting-patchset-created:
509 - 'xtesting-{tag}-tox'
512 name: 'xtesting-{repo}-{container}-{tag}-gate'
520 - xtesting-build-containers:
521 <<: *xtesting-build-containers
523 buildargs: '{buildargs}'
526 name: xtesting-opnfv-xtesting-{tag}-gate
532 - 'xtesting-{repo}-{container}-{tag}-gate'
535 name: xtesting-opnfv-xtesting-mts-{tag}-gate
537 container: xtesting-mts
541 - 'xtesting-{repo}-{container}-{tag}-gate'
544 name: xtesting-patchset-created
548 - patchset-created-event
549 - comment-added-contains-event:
550 comment-contains-value: 'recheck'
551 - comment-added-contains-event:
552 comment-contains-value: 'reverify'
554 - project-compare-type: 'ANT'
555 project-pattern: 'functest-xtesting'
557 - branch-compare-type: 'ANT'
558 branch-pattern: '**/{branch}'
561 name: 'xtesting-{tag}-review'
562 project-type: multijob
564 - xtesting-patchset-created:
569 - xtesting-build_tag:
571 # PyYAML and yamllint differ here
572 # see https://github.com/yaml/pyyaml/issues/234
573 # yamllint disable rule:indentation
577 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
578 # yamllint enable rule:indentation
581 name: remove former images
583 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
585 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
588 name: remove dependency
590 - name: 'xtesting-{repo}-{tag}-dep-rmi'
593 name: pull dependency
595 - name: 'xtesting-{repo}-{tag}-dep-pull'
600 - name: 'xtesting-opnfv-xtesting-{tag}-gate'
603 name: opnfv/xtesting-mts
605 - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
608 name: opnfv/xtesting:{tag}
610 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
612 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
614 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
616 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
618 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
620 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
622 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
625 name: opnfv/xtesting-mts:{tag}
627 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
631 name: 'xtesting-review'
634 - 'xtesting-{tag}-review'
637 name: xtesting-review
646 regex: ^xtesting-[a-z0-9.]+-review$
658 regex: ^xtesting-[a-z0-9.]+-tox$
661 name: xtesting-push-containers
665 if [ "{repo}" = "_" ]; then
666 image={container}:{tag}
667 elif [ "{port}" = "None" ]; then
668 image={repo}/{container}:{tag}
670 image={repo}:{port}/{container}:{tag}
672 sudo docker push $image
675 name: xtesting-commit
681 name: 'xtesting-{repo}-{container}-{tag}-build'
689 - xtesting-build-containers:
690 <<: *xtesting-build-containers
692 buildargs: '{buildargs}'
693 - xtesting-push-containers:
694 <<: *xtesting-build-containers
698 name: xtesting-opnfv-xtesting-{tag}-build
704 - 'xtesting-{repo}-{container}-{tag}-build'
707 name: xtesting-opnfv-xtesting-mts-{tag}-build
709 container: xtesting-mts
713 - 'xtesting-{repo}-{container}-{tag}-build'
716 name: 'xtesting-{tag}-docker'
717 project-type: multijob
726 # PyYAML and yamllint differ here
727 # see https://github.com/yaml/pyyaml/issues/234
728 # yamllint disable rule:indentation
732 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
733 # yamllint enable rule:indentation
736 name: remove dependency
738 - name: 'xtesting-{repo}-{tag}-dep-rmi'
741 name: pull dependency
743 - name: 'xtesting-{repo}-{tag}-dep-pull'
748 - name: 'xtesting-opnfv-xtesting-{tag}-build'
751 name: opnfv/xtesting-mts
753 - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
760 sudo apt-get update && sudo apt-get install curl -y
762 curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
763 if [ "{repo}" = "_" ]; then
764 image={container}:{tag}
765 elif [ "{port}" = "None" ]; then
766 image={repo}/{container}:{tag}
768 image={repo}:{port}/{container}:{tag}
770 ./trivy --exit-code 1 $image
773 name: 'xtesting-{repo}-{container}-{tag}-trivy'
781 <<: *xtesting-containers
784 name: 'xtesting-opnfv-xtesting-trivy'
786 container: 'xtesting'
788 - 'xtesting-{repo}-{container}-{tag}-trivy'
791 name: 'xtesting-opnfv-xtesting-mts-trivy'
793 container: 'xtesting-mts'
795 - 'xtesting-{repo}-{container}-{tag}-trivy'
801 - 'xtesting-{tag}-docker'
804 name: xtesting-docker
813 regex: ^xtesting-[a-z0-9.]+-docker$
825 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$