2 - xtesting-containers: &xtesting-containers
3 name: 'xtesting-containers'
6 container: '{container}'
9 - xtesting-params: &xtesting-params
10 name: 'xtesting-params'
51 - xtesting-jobs: &xtesting-jobs
53 current-parameters: true
63 name: xtesting-build_tag
69 - xtesting-run-containers: &xtesting-run-containers
70 name: 'xtesting-run-containers'
71 <<: *xtesting-containers
73 privileged: '{privileged}'
77 name: xtesting-pull-containers
81 if [ "{repo}" = "_" ]; then
82 image={container}:{tag}
83 elif [ "{port}" = "None" ]; then
84 image={repo}/{container}:{tag}
86 image={repo}:{port}/{container}:{tag}
88 sudo docker pull $image
91 name: xtesting-run-containers
95 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
96 if [ "{repo}" = "_" ]; then
97 image={container}:{tag}
98 elif [ "{port}" = "None" ]; then
99 image={repo}/{container}:{tag}
101 image={repo}:{port}/{container}:{tag}
103 sudo docker run --rm \
104 --privileged={privileged} \
105 --network={network} \
106 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
107 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
108 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
109 -v /home/opnfv/xtesting/.boto:/root/.boto \
110 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
111 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
112 -e NODE_NAME=$slave \
113 -e BUILD_TAG=$BUILD_TAG \
114 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
115 $image run_tests -t {test} -p -r
118 name: xtesting-remove-images
122 if [ "{repo}" = "_" ]; then
123 image={container}:{tag}
124 elif [ "{port}" = "None" ]; then
125 image={repo}/{container}:{tag}
127 image={repo}:{port}/{container}:{tag}
129 sudo docker rmi $image || true
132 name: 'xtesting-{repo}-{container}-{tag}-pull'
137 - xtesting-pull-containers:
138 <<: *xtesting-containers
141 name: 'xtesting-opnfv-xtesting-pull'
143 container: 'xtesting'
145 - 'xtesting-{repo}-{container}-{tag}-pull'
148 name: 'xtesting-opnfv-xtesting-mts-pull'
150 container: 'xtesting-mts'
152 - 'xtesting-{repo}-{container}-{tag}-pull'
155 name: 'xtesting-{repo}-{container}-{tag}-rmi'
160 - xtesting-remove-images:
161 <<: *xtesting-containers
164 name: 'xtesting-opnfv-xtesting-rmi'
166 container: 'xtesting'
168 - 'xtesting-{repo}-{container}-{tag}-rmi'
171 name: 'xtesting-opnfv-xtesting-mts-rmi'
173 container: 'xtesting-mts'
175 - 'xtesting-{repo}-{container}-{tag}-rmi'
178 name: 'xtesting-{repo}-{container}-{tag}-{test}-run'
182 - xtesting-build_tag:
185 - xtesting-run-containers:
186 <<: *xtesting-run-containers
189 name: 'xtesting-opnfv-xtesting'
191 container: 'xtesting'
202 - 'xtesting-{repo}-{container}-{tag}-{test}-run'
205 name: 'xtesting-opnfv-xtesting-mts'
207 container: 'xtesting-mts'
213 - 'xtesting-{repo}-{container}-{tag}-{test}-run'
221 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
222 if [ "{repo}" = "_" ]; then
223 image={container}:{tag}
224 elif [ "{port}" = "None" ]; then
225 image={repo}/{container}:{tag}
227 image={repo}:{port}/{container}:{tag}
229 sudo docker run --rm \
230 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
231 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
232 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
233 -v /home/opnfv/xtesting/.boto:/root/.boto \
234 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
235 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
236 -e BUILD_TAG=$BUILD_TAG \
237 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
241 name: 'xtesting-{tag}-zip'
245 - xtesting-build_tag:
249 <<: *xtesting-containers
252 name: 'xtesting-{tag}-zip'
254 container: 'xtesting'
256 - 'xtesting-{tag}-zip'
259 name: 'xtesting-{tag}-daily'
260 project-type: multijob
266 - xtesting-build_tag:
270 use-build-blocker: true
271 blocking-level: 'NODE'
273 - '^xtesting-{tag}-(daily|docker|review)$'
276 name: remove former images
278 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
280 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
283 name: pull containers
285 - name: 'xtesting-opnfv-xtesting-{tag}-pull'
287 - name: 'xtesting-opnfv-xtesting-mts-{tag}-pull'
290 name: opnfv/xtesting:{tag}
292 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
294 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
296 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
298 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
300 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
302 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
305 name: opnfv/xtesting-mts:{tag}
307 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
310 name: dump all campaign data
312 - name: 'xtesting-{tag}-zip'
316 name: 'xtesting-daily'
319 - 'xtesting-{tag}-daily'
331 regex: ^xtesting-[a-z0-9.]+-daily$
333 - xtesting-build-containers: &xtesting-build-containers
334 name: 'xtesting-build-containers'
335 <<: *xtesting-containers
338 buildargs: '{buildargs}'
342 name: xtesting-build-containers
346 if [ "{repo}" = "_" ]; then
347 image={container}:{tag}
348 elif [ "{port}" = "None" ]; then
349 image={repo}/{container}:{tag}
351 image={repo}:{port}/{container}:{tag}
354 if [ "{buildargs}" != "None" ]; then
355 build_args="{buildargs} "
357 if [ "{ref_arg}" != "None" ]; then
358 build_args="--build-arg {ref_arg}={ref}"
361 if [ "{from}" != "None" ]; then
362 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 software-properties-common gpg -y
449 sudo add-apt-repository -y ppa:deadsnakes/ppa
450 sudo apt-get update && sudo apt-get install python3.8 python3.8-dev \
451 python3.8-distutils \
452 python3.7 python3.7-dev python3.6 python3.6-dev \
453 python python-dev python3-pip enchant -y
454 sudo pip3 install tox tox-pip-version
458 name: 'xtesting-{tag}-tox'
463 - xtesting-patchset-created:
475 - 'xtesting-{tag}-tox'
478 name: 'xtesting-{repo}-{container}-{tag}-gate'
486 - xtesting-build-containers:
487 <<: *xtesting-build-containers
489 buildargs: '{buildargs}'
492 name: xtesting-opnfv-xtesting-{tag}-gate
498 - 'xtesting-{repo}-{container}-{tag}-gate'
501 name: xtesting-opnfv-xtesting-mts-{tag}-gate
503 container: xtesting-mts
507 - 'xtesting-{repo}-{container}-{tag}-gate'
511 name: xtesting-patchset-created
515 - patchset-created-event
516 - comment-added-contains-event:
517 comment-contains-value: 'recheck'
518 - comment-added-contains-event:
519 comment-contains-value: 'reverify'
521 - project-compare-type: 'ANT'
522 project-pattern: 'functest-xtesting'
524 - branch-compare-type: 'ANT'
525 branch-pattern: '**/{branch}'
528 name: 'xtesting-{tag}-review'
529 project-type: multijob
531 - xtesting-patchset-created:
536 - xtesting-build_tag:
540 use-build-blocker: true
541 blocking-level: 'NODE'
543 - '^xtesting-{tag}-(daily|docker|review)$'
546 name: remove former images
548 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
550 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
553 name: remove dependency
555 - name: 'xtesting-{repo}-{tag}-dep-rmi'
558 name: pull dependency
560 - name: 'xtesting-{repo}-{tag}-dep-pull'
565 - name: 'xtesting-opnfv-xtesting-{tag}-gate'
568 name: opnfv/xtesting-mts
570 - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
573 name: opnfv/xtesting:{tag}
575 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
577 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
579 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
581 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
583 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
585 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
588 name: opnfv/xtesting-mts:{tag}
590 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
594 name: 'xtesting-review'
597 - 'xtesting-{tag}-review'
600 name: xtesting-review
609 regex: ^xtesting-[a-z0-9.]+-review$
621 regex: ^xtesting-[a-z0-9.]+-tox$
624 name: xtesting-push-containers
628 if [ "{repo}" = "_" ]; then
629 image={container}:{tag}
630 elif [ "{port}" = "None" ]; then
631 image={repo}/{container}:{tag}
633 image={repo}:{port}/{container}:{tag}
635 sudo docker push $image
638 name: xtesting-commit
644 name: 'xtesting-{repo}-{container}-{tag}-build'
652 - xtesting-build-containers:
653 <<: *xtesting-build-containers
655 buildargs: '{buildargs}'
656 - xtesting-push-containers:
657 <<: *xtesting-build-containers
661 name: xtesting-opnfv-xtesting-{tag}-build
667 - 'xtesting-{repo}-{container}-{tag}-build'
670 name: xtesting-opnfv-xtesting-mts-{tag}-build
672 container: xtesting-mts
676 - 'xtesting-{repo}-{container}-{tag}-build'
680 name: 'xtesting-{tag}-docker'
681 project-type: multijob
692 use-build-blocker: true
693 blocking-level: 'NODE'
695 - '^xtesting-{tag}-(daily|docker|review)$'
698 name: remove dependency
700 - name: 'xtesting-{repo}-{tag}-dep-rmi'
703 name: pull dependency
705 - name: 'xtesting-{repo}-{tag}-dep-pull'
710 - name: 'xtesting-opnfv-xtesting-{tag}-build'
713 name: opnfv/xtesting-mts
715 - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
722 sudo apt-get update && sudo apt-get install curl -y
723 curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
724 if [ "{repo}" = "_" ]; then
725 image={container}:{tag}
726 elif [ "{port}" = "None" ]; then
727 image={repo}/{container}:{tag}
729 image={repo}:{port}/{container}:{tag}
731 ./trivy --exit-code 1 $image
734 name: 'xtesting-{repo}-{container}-{tag}-trivy'
742 <<: *xtesting-containers
745 name: 'xtesting-opnfv-xtesting-trivy'
747 container: 'xtesting'
749 - 'xtesting-{repo}-{container}-{tag}-trivy'
752 name: 'xtesting-opnfv-xtesting-mts-trivy'
754 container: 'xtesting-mts'
756 - 'xtesting-{repo}-{container}-{tag}-trivy'
762 - 'xtesting-{tag}-docker'
765 name: xtesting-docker
774 regex: ^xtesting-[a-z0-9.]+-docker$
786 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$