2 - xtesting-containers: &xtesting-containers
3 name: 'xtesting-containers'
6 container: '{container}'
9 - xtesting-params: &xtesting-params
10 name: 'xtesting-params'
45 - xtesting-jobs: &xtesting-jobs
47 current-parameters: true
57 name: xtesting-build_tag
63 - xtesting-run-containers: &xtesting-run-containers
64 name: 'xtesting-run-containers'
65 <<: *xtesting-containers
67 privileged: '{privileged}'
71 name: xtesting-pull-containers
75 if [ "{repo}" = "_" ]; then
76 image={container}:{tag}
77 elif [ "{port}" = "None" ]; then
78 image={repo}/{container}:{tag}
80 image={repo}:{port}/{container}:{tag}
82 sudo docker pull $image
85 name: xtesting-run-containers
89 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
90 if [ "{repo}" = "_" ]; then
91 image={container}:{tag}
92 elif [ "{port}" = "None" ]; then
93 image={repo}/{container}:{tag}
95 image={repo}:{port}/{container}:{tag}
97 sudo docker run --rm \
98 --privileged={privileged} \
100 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
101 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
102 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
103 -v /home/opnfv/xtesting/.boto:/root/.boto \
104 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
105 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
106 -e NODE_NAME=$slave \
107 -e BUILD_TAG=$BUILD_TAG \
108 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
109 $image run_tests -t {test} -p -r
112 name: xtesting-remove-images
116 if [ "{repo}" = "_" ]; then
117 image={container}:{tag}
118 elif [ "{port}" = "None" ]; then
119 image={repo}/{container}:{tag}
121 image={repo}:{port}/{container}:{tag}
123 sudo docker rmi $image || true
126 name: 'xtesting-{repo}-{container}-{tag}-pull'
131 - xtesting-pull-containers:
132 <<: *xtesting-containers
135 name: 'xtesting-opnfv-xtesting-pull'
137 container: 'xtesting'
139 - 'xtesting-{repo}-{container}-{tag}-pull'
142 name: 'xtesting-opnfv-xtesting-mts-pull'
144 container: 'xtesting-mts'
146 - 'xtesting-{repo}-{container}-{tag}-pull'
149 name: 'xtesting-{repo}-{container}-{tag}-rmi'
154 - xtesting-remove-images:
155 <<: *xtesting-containers
158 name: 'xtesting-opnfv-xtesting-rmi'
160 container: 'xtesting'
162 - 'xtesting-{repo}-{container}-{tag}-rmi'
165 name: 'xtesting-opnfv-xtesting-mts-rmi'
167 container: 'xtesting-mts'
169 - 'xtesting-{repo}-{container}-{tag}-rmi'
172 name: 'xtesting-{repo}-{container}-{tag}-{test}-run'
176 - xtesting-build_tag:
179 - xtesting-run-containers:
180 <<: *xtesting-run-containers
183 name: 'xtesting-opnfv-xtesting'
185 container: 'xtesting'
196 - 'xtesting-{repo}-{container}-{tag}-{test}-run'
199 name: 'xtesting-opnfv-xtesting-mts'
201 container: 'xtesting-mts'
207 - 'xtesting-{repo}-{container}-{tag}-{test}-run'
215 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
216 if [ "{repo}" = "_" ]; then
217 image={container}:{tag}
218 elif [ "{port}" = "None" ]; then
219 image={repo}/{container}:{tag}
221 image={repo}:{port}/{container}:{tag}
223 sudo docker run --rm \
224 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
225 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
226 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
227 -v /home/opnfv/xtesting/.boto:/root/.boto \
228 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
229 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
230 -e BUILD_TAG=$BUILD_TAG \
231 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
235 name: 'xtesting-{tag}-zip'
239 - xtesting-build_tag:
243 <<: *xtesting-containers
246 name: 'xtesting-{tag}-zip'
248 container: 'xtesting'
250 - 'xtesting-{tag}-zip'
253 name: 'xtesting-{tag}-daily'
254 project-type: multijob
260 - xtesting-build_tag:
264 use-build-blocker: true
265 blocking-level: 'NODE'
267 - '^xtesting-{tag}-(daily|docker|review)$'
270 name: remove former images
272 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
274 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
277 name: pull containers
279 - name: 'xtesting-opnfv-xtesting-{tag}-pull'
281 - name: 'xtesting-opnfv-xtesting-mts-{tag}-pull'
284 name: opnfv/xtesting:{tag}
286 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
288 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
290 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
292 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
294 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
296 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
299 name: opnfv/xtesting-mts:{tag}
301 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
304 name: dump all campaign data
306 - name: 'xtesting-{tag}-zip'
310 name: 'xtesting-daily'
313 - 'xtesting-{tag}-daily'
325 regex: ^xtesting-[a-z0-9.]+-daily$
327 - xtesting-build-containers: &xtesting-build-containers
328 name: 'xtesting-build-containers'
329 <<: *xtesting-containers
332 buildargs: '{buildargs}'
335 name: xtesting-build-containers
339 if [ "{repo}" = "_" ]; then
340 image={container}:{tag}
341 elif [ "{port}" = "None" ]; then
342 image={repo}/{container}:{tag}
344 image={repo}:{port}/{container}:{tag}
347 if [ "{buildargs}" != "None" ]; then
348 build_args="{buildargs} "
350 if [ "{ref_arg}" != "None" ]; then
351 build_args="--build-arg {ref_arg}={ref}"
354 sudo docker build $build_args \
355 --pull=false --no-cache --force-rm=true \
362 url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
363 refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
367 - xtesting-dep: &xtesting-dep
368 name: 'xtesting-containers'
372 dependency: '{dependency}'
375 name: xtesting-pull-dep-images
379 if [ "_" = "_" ]; then
380 image=alpine:{dependency}
381 elif [ "_" = "None" ]; then
382 image=_/alpine:{dependency}
384 image=_:/alpine{dependency}
386 sudo docker pull $image || true
389 name: xtesting-remove-dep-images
393 if [ "_" = "_" ]; then
394 image=alpine:{dependency}
395 elif [ "_" = "None" ]; then
396 image=_/alpine:{dependency}
398 image=_:/alpine{dependency}
400 sudo docker rmi $image || true
403 name: 'xtesting-{repo}-{tag}-dep-pull'
408 - xtesting-pull-dep-images:
412 name: 'xtesting-{repo}-{tag}-dep-pull'
415 - 'xtesting-{repo}-{tag}-dep-pull'
418 name: 'xtesting-{repo}-{tag}-dep-rmi'
423 - xtesting-remove-dep-images:
427 name: 'xtesting-{repo}-{tag}-dep-rmi'
430 - 'xtesting-{repo}-{tag}-dep-rmi'
437 sudo apt-get update && sudo apt-get install software-properties-common gpg -y
438 sudo add-apt-repository -y ppa:deadsnakes/ppa
439 sudo apt-get update && sudo apt-get install python3.8 python3.8-dev \
440 python3.8-distutils \
441 python3.7 python3.7-dev python3.6 python3.6-dev \
442 python python-dev python3-pip enchant -y
443 sudo pip3 install tox tox-pip-version
447 name: 'xtesting-{tag}-tox'
452 - xtesting-patchset-created:
464 - 'xtesting-{tag}-tox'
467 name: 'xtesting-{repo}-{container}-{tag}-gate'
475 - xtesting-build-containers:
476 <<: *xtesting-build-containers
478 buildargs: '{buildargs}'
481 name: xtesting-opnfv-xtesting-{tag}-gate
487 - 'xtesting-{repo}-{container}-{tag}-gate'
490 name: xtesting-opnfv-xtesting-mts-{tag}-gate
492 container: xtesting-mts
496 - 'xtesting-{repo}-{container}-{tag}-gate'
500 name: xtesting-patchset-created
504 - patchset-created-event
505 - comment-added-contains-event:
506 comment-contains-value: 'recheck'
507 - comment-added-contains-event:
508 comment-contains-value: 'reverify'
510 - project-compare-type: 'ANT'
511 project-pattern: 'functest-xtesting'
513 - branch-compare-type: 'ANT'
514 branch-pattern: '**/{branch}'
517 name: 'xtesting-{tag}-review'
518 project-type: multijob
520 - xtesting-patchset-created:
525 - xtesting-build_tag:
529 use-build-blocker: true
530 blocking-level: 'NODE'
532 - '^xtesting-{tag}-(daily|docker|review)$'
535 name: remove former images
537 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
539 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
542 name: remove dependency
544 - name: 'xtesting-{repo}-{tag}-dep-rmi'
547 name: pull dependency
549 - name: 'xtesting-{repo}-{tag}-dep-pull'
554 - name: 'xtesting-opnfv-xtesting-{tag}-gate'
557 name: opnfv/xtesting-mts
559 - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
562 name: opnfv/xtesting:{tag}
564 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
566 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
568 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
570 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
572 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
574 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
577 name: opnfv/xtesting-mts:{tag}
579 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
583 name: 'xtesting-review'
586 - 'xtesting-{tag}-review'
589 name: xtesting-review
598 regex: ^xtesting-[a-z0-9.]+-review$
610 regex: ^xtesting-[a-z0-9.]+-tox$
613 name: xtesting-push-containers
617 if [ "{repo}" = "_" ]; then
618 image={container}:{tag}
619 elif [ "{port}" = "None" ]; then
620 image={repo}/{container}:{tag}
622 image={repo}:{port}/{container}:{tag}
624 sudo docker push $image
627 name: xtesting-commit
633 name: 'xtesting-{repo}-{container}-{tag}-build'
641 - xtesting-build-containers:
642 <<: *xtesting-build-containers
644 buildargs: '{buildargs}'
645 - xtesting-push-containers:
646 <<: *xtesting-build-containers
650 name: xtesting-opnfv-xtesting-{tag}-build
656 - 'xtesting-{repo}-{container}-{tag}-build'
659 name: xtesting-opnfv-xtesting-mts-{tag}-build
661 container: xtesting-mts
665 - 'xtesting-{repo}-{container}-{tag}-build'
669 name: 'xtesting-{tag}-docker'
670 project-type: multijob
681 use-build-blocker: true
682 blocking-level: 'NODE'
684 - '^xtesting-{tag}-(daily|docker|review)$'
687 name: remove dependency
689 - name: 'xtesting-{repo}-{tag}-dep-rmi'
692 name: pull dependency
694 - name: 'xtesting-{repo}-{tag}-dep-pull'
699 - name: 'xtesting-opnfv-xtesting-{tag}-build'
702 name: opnfv/xtesting-mts
704 - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
711 sudo apt-get update && sudo apt-get install curl -y
712 curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
713 if [ "{repo}" = "_" ]; then
714 image={container}:{tag}
715 elif [ "{port}" = "None" ]; then
716 image={repo}/{container}:{tag}
718 image={repo}:{port}/{container}:{tag}
720 ./trivy --exit-code 1 $image
723 name: 'xtesting-{repo}-{container}-{tag}-trivy'
731 <<: *xtesting-containers
734 name: 'xtesting-opnfv-xtesting-trivy'
736 container: 'xtesting'
738 - 'xtesting-{repo}-{container}-{tag}-trivy'
740 name: 'xtesting-opnfv-xtesting-mts-trivy'
742 container: 'xtesting-mts'
744 - 'xtesting-{repo}-{container}-{tag}-trivy'
750 - 'xtesting-{tag}-docker'
753 name: xtesting-docker
762 regex: ^xtesting-[a-z0-9.]+-docker$
774 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$