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
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'
197 - {'tag': 'leguer', 'test': 'eighth'}
198 - {'tag': 'kali', 'test': 'eighth'}
199 - {'tag': 'jerma', 'test': 'eighth'}
201 - 'xtesting-{repo}-{container}-{tag}-{test}-run'
204 name: 'xtesting-opnfv-xtesting-mts'
206 container: 'xtesting-mts'
212 - 'xtesting-{repo}-{container}-{tag}-{test}-run'
220 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
221 if [ "{repo}" = "_" ]; then
222 image={container}:{tag}
223 elif [ "{port}" = "None" ]; then
224 image={repo}/{container}:{tag}
226 image={repo}:{port}/{container}:{tag}
228 sudo docker run --rm \
229 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
230 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
231 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
232 -v /home/opnfv/xtesting/.boto:/root/.boto \
233 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
234 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
235 -e BUILD_TAG=$BUILD_TAG \
236 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
240 name: 'xtesting-{tag}-zip'
244 - xtesting-build_tag:
248 <<: *xtesting-containers
251 name: 'xtesting-{tag}-zip'
253 container: 'xtesting'
255 - 'xtesting-{tag}-zip'
258 name: 'xtesting-{tag}-daily'
259 project-type: multijob
265 - xtesting-build_tag:
269 use-build-blocker: true
270 blocking-level: 'NODE'
272 - '^xtesting-{tag}-(daily|docker|review)$'
275 name: remove former images
277 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
279 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
282 name: pull containers
284 - name: 'xtesting-opnfv-xtesting-{tag}-pull'
286 - name: 'xtesting-opnfv-xtesting-mts-{tag}-pull'
289 name: opnfv/xtesting:{tag}
291 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
293 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
295 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
297 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
299 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
301 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
303 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
306 name: opnfv/xtesting-mts:{tag}
308 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
311 name: dump all campaign data
313 - name: 'xtesting-{tag}-zip'
317 name: 'xtesting-daily'
320 - 'xtesting-{tag}-daily'
332 regex: ^xtesting-[a-z0-9.]+-daily$
334 - xtesting-build-containers: &xtesting-build-containers
335 name: 'xtesting-build-containers'
336 <<: *xtesting-containers
339 buildargs: '{buildargs}'
343 name: xtesting-build-containers
347 if [ "{repo}" = "_" ]; then
348 image={container}:{tag}
349 elif [ "{port}" = "None" ]; then
350 image={repo}/{container}:{tag}
352 image={repo}:{port}/{container}:{tag}
355 if [ "{buildargs}" != "None" ]; then
356 build_args="{buildargs}"
358 if [ "{ref_arg}" != "None" ]; then
359 build_args="$build_args --build-arg {ref_arg}={ref}"
362 if [ "{from}" != "None" ]; then
363 sed -i {from} Dockerfile
365 sudo docker build $build_args \
366 --pull=false --no-cache --force-rm=true \
373 url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
374 refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
378 - xtesting-dep: &xtesting-dep
379 name: 'xtesting-containers'
383 dependency: '{dependency}'
386 name: xtesting-pull-dep-images
390 if [ "_" = "_" ]; then
391 image=alpine:{dependency}
392 elif [ "" = "None" ]; then
393 image=_/alpine:{dependency}
395 image=_:/alpine:{dependency}
397 sudo docker pull $image || true
400 name: xtesting-remove-dep-images
404 if [ "_" = "_" ]; then
405 image=alpine:{dependency}
406 elif [ "" = "None" ]; then
407 image=_/alpine:{dependency}
409 image=_:/alpine:{dependency}
411 sudo docker rmi $image || true
414 name: 'xtesting-{repo}-{tag}-dep-pull'
419 - xtesting-pull-dep-images:
423 name: 'xtesting-{repo}-{tag}-dep-pull'
426 - 'xtesting-{repo}-{tag}-dep-pull'
429 name: 'xtesting-{repo}-{tag}-dep-rmi'
434 - xtesting-remove-dep-images:
438 name: 'xtesting-{repo}-{tag}-dep-rmi'
441 - 'xtesting-{repo}-{tag}-dep-rmi'
448 sudo apt-get update && sudo apt-get install \
449 software-properties-common gpg -y
450 sudo add-apt-repository -y ppa:deadsnakes/ppa
451 sudo apt-get update && sudo apt-get install python3.8 \
452 python3.8-dev python3.8-distutils \
453 python3.7 python3.7-dev python3.6 python3.6-dev \
454 python python-dev python3-pip enchant -y
455 sudo pip3 install tox tox-pip-version
460 name: 'xtesting-{tag}-tox'
465 - xtesting-patchset-created:
477 - 'xtesting-{tag}-tox'
480 name: 'xtesting-{repo}-{container}-{tag}-gate'
488 - xtesting-build-containers:
489 <<: *xtesting-build-containers
491 buildargs: '{buildargs}'
494 name: xtesting-opnfv-xtesting-{tag}-gate
500 - 'xtesting-{repo}-{container}-{tag}-gate'
503 name: xtesting-opnfv-xtesting-mts-{tag}-gate
505 container: xtesting-mts
509 - 'xtesting-{repo}-{container}-{tag}-gate'
513 name: xtesting-patchset-created
517 - patchset-created-event
518 - comment-added-contains-event:
519 comment-contains-value: 'recheck'
520 - comment-added-contains-event:
521 comment-contains-value: 'reverify'
523 - project-compare-type: 'ANT'
524 project-pattern: 'functest-xtesting'
526 - branch-compare-type: 'ANT'
527 branch-pattern: '**/{branch}'
530 name: 'xtesting-{tag}-review'
531 project-type: multijob
533 - xtesting-patchset-created:
538 - xtesting-build_tag:
542 use-build-blocker: true
543 blocking-level: 'NODE'
545 - '^xtesting-{tag}-(daily|docker|review)$'
548 name: remove former images
550 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
552 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
555 name: remove dependency
557 - name: 'xtesting-{repo}-{tag}-dep-rmi'
560 name: pull dependency
562 - name: 'xtesting-{repo}-{tag}-dep-pull'
567 - name: 'xtesting-opnfv-xtesting-{tag}-gate'
570 name: opnfv/xtesting-mts
572 - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
575 name: opnfv/xtesting:{tag}
577 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
579 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
581 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
583 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
585 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
587 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
589 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
592 name: opnfv/xtesting-mts:{tag}
594 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
598 name: 'xtesting-review'
601 - 'xtesting-{tag}-review'
604 name: xtesting-review
613 regex: ^xtesting-[a-z0-9.]+-review$
625 regex: ^xtesting-[a-z0-9.]+-tox$
628 name: xtesting-push-containers
632 if [ "{repo}" = "_" ]; then
633 image={container}:{tag}
634 elif [ "{port}" = "None" ]; then
635 image={repo}/{container}:{tag}
637 image={repo}:{port}/{container}:{tag}
639 sudo docker push $image
642 name: xtesting-commit
648 name: 'xtesting-{repo}-{container}-{tag}-build'
656 - xtesting-build-containers:
657 <<: *xtesting-build-containers
659 buildargs: '{buildargs}'
660 - xtesting-push-containers:
661 <<: *xtesting-build-containers
665 name: xtesting-opnfv-xtesting-{tag}-build
671 - 'xtesting-{repo}-{container}-{tag}-build'
674 name: xtesting-opnfv-xtesting-mts-{tag}-build
676 container: xtesting-mts
680 - 'xtesting-{repo}-{container}-{tag}-build'
684 name: 'xtesting-{tag}-docker'
685 project-type: multijob
696 use-build-blocker: true
697 blocking-level: 'NODE'
699 - '^xtesting-{tag}-(daily|docker|review)$'
702 name: remove dependency
704 - name: 'xtesting-{repo}-{tag}-dep-rmi'
707 name: pull dependency
709 - name: 'xtesting-{repo}-{tag}-dep-pull'
714 - name: 'xtesting-opnfv-xtesting-{tag}-build'
717 name: opnfv/xtesting-mts
719 - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
726 sudo apt-get update && sudo apt-get install curl -y
728 curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
729 if [ "{repo}" = "_" ]; then
730 image={container}:{tag}
731 elif [ "{port}" = "None" ]; then
732 image={repo}/{container}:{tag}
734 image={repo}:{port}/{container}:{tag}
736 ./trivy --exit-code 1 $image
739 name: 'xtesting-{repo}-{container}-{tag}-trivy'
747 <<: *xtesting-containers
750 name: 'xtesting-opnfv-xtesting-trivy'
752 container: 'xtesting'
754 - 'xtesting-{repo}-{container}-{tag}-trivy'
757 name: 'xtesting-opnfv-xtesting-mts-trivy'
759 container: 'xtesting-mts'
761 - 'xtesting-{repo}-{container}-{tag}-trivy'
767 - 'xtesting-{tag}-docker'
770 name: xtesting-docker
779 regex: ^xtesting-[a-z0-9.]+-docker$
791 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$