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_args --build-arg {ref_arg}={ref}"
361 if [ "{from}" != "None" ]; then
362 sed -i {from} Dockerfile
364 sudo docker build $build_args \
365 --pull=false --no-cache --force-rm=true \
372 url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
373 refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
377 - xtesting-dep: &xtesting-dep
378 name: 'xtesting-containers'
382 dependency: '{dependency}'
385 name: xtesting-pull-dep-images
389 if [ "_" = "_" ]; then
390 image=alpine:{dependency}
391 elif [ "_" = "None" ]; then
392 image=_/alpine:{dependency}
394 image=_:/alpine{dependency}
396 sudo docker pull $image || true
399 name: xtesting-remove-dep-images
403 if [ "_" = "_" ]; then
404 image=alpine:{dependency}
405 elif [ "_" = "None" ]; then
406 image=_/alpine:{dependency}
408 image=_:/alpine{dependency}
410 sudo docker rmi $image || true
413 name: 'xtesting-{repo}-{tag}-dep-pull'
418 - xtesting-pull-dep-images:
422 name: 'xtesting-{repo}-{tag}-dep-pull'
425 - 'xtesting-{repo}-{tag}-dep-pull'
428 name: 'xtesting-{repo}-{tag}-dep-rmi'
433 - xtesting-remove-dep-images:
437 name: 'xtesting-{repo}-{tag}-dep-rmi'
440 - 'xtesting-{repo}-{tag}-dep-rmi'
447 sudo apt-get update && sudo apt-get install software-properties-common gpg -y
448 sudo add-apt-repository -y ppa:deadsnakes/ppa
449 sudo apt-get update && sudo apt-get install python3.8 python3.8-dev \
450 python3.8-distutils \
451 python3.7 python3.7-dev python3.6 python3.6-dev \
452 python python-dev python3-pip enchant -y
453 sudo pip3 install tox tox-pip-version
457 name: 'xtesting-{tag}-tox'
462 - xtesting-patchset-created:
474 - 'xtesting-{tag}-tox'
477 name: 'xtesting-{repo}-{container}-{tag}-gate'
485 - xtesting-build-containers:
486 <<: *xtesting-build-containers
488 buildargs: '{buildargs}'
491 name: xtesting-opnfv-xtesting-{tag}-gate
497 - 'xtesting-{repo}-{container}-{tag}-gate'
500 name: xtesting-opnfv-xtesting-mts-{tag}-gate
502 container: xtesting-mts
506 - 'xtesting-{repo}-{container}-{tag}-gate'
510 name: xtesting-patchset-created
514 - patchset-created-event
515 - comment-added-contains-event:
516 comment-contains-value: 'recheck'
517 - comment-added-contains-event:
518 comment-contains-value: 'reverify'
520 - project-compare-type: 'ANT'
521 project-pattern: 'functest-xtesting'
523 - branch-compare-type: 'ANT'
524 branch-pattern: '**/{branch}'
527 name: 'xtesting-{tag}-review'
528 project-type: multijob
530 - xtesting-patchset-created:
535 - xtesting-build_tag:
539 use-build-blocker: true
540 blocking-level: 'NODE'
542 - '^xtesting-{tag}-(daily|docker|review)$'
545 name: remove former images
547 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
549 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
552 name: remove dependency
554 - name: 'xtesting-{repo}-{tag}-dep-rmi'
557 name: pull dependency
559 - name: 'xtesting-{repo}-{tag}-dep-pull'
564 - name: 'xtesting-opnfv-xtesting-{tag}-gate'
567 name: opnfv/xtesting-mts
569 - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
572 name: opnfv/xtesting:{tag}
574 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
576 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
578 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
580 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
582 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
584 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
587 name: opnfv/xtesting-mts:{tag}
589 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
593 name: 'xtesting-review'
596 - 'xtesting-{tag}-review'
599 name: xtesting-review
608 regex: ^xtesting-[a-z0-9.]+-review$
620 regex: ^xtesting-[a-z0-9.]+-tox$
623 name: xtesting-push-containers
627 if [ "{repo}" = "_" ]; then
628 image={container}:{tag}
629 elif [ "{port}" = "None" ]; then
630 image={repo}/{container}:{tag}
632 image={repo}:{port}/{container}:{tag}
634 sudo docker push $image
637 name: xtesting-commit
643 name: 'xtesting-{repo}-{container}-{tag}-build'
651 - xtesting-build-containers:
652 <<: *xtesting-build-containers
654 buildargs: '{buildargs}'
655 - xtesting-push-containers:
656 <<: *xtesting-build-containers
660 name: xtesting-opnfv-xtesting-{tag}-build
666 - 'xtesting-{repo}-{container}-{tag}-build'
669 name: xtesting-opnfv-xtesting-mts-{tag}-build
671 container: xtesting-mts
675 - 'xtesting-{repo}-{container}-{tag}-build'
679 name: 'xtesting-{tag}-docker'
680 project-type: multijob
691 use-build-blocker: true
692 blocking-level: 'NODE'
694 - '^xtesting-{tag}-(daily|docker|review)$'
697 name: remove dependency
699 - name: 'xtesting-{repo}-{tag}-dep-rmi'
702 name: pull dependency
704 - name: 'xtesting-{repo}-{tag}-dep-pull'
709 - name: 'xtesting-opnfv-xtesting-{tag}-build'
712 name: opnfv/xtesting-mts
714 - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
721 sudo apt-get update && sudo apt-get install curl -y
722 curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
723 if [ "{repo}" = "_" ]; then
724 image={container}:{tag}
725 elif [ "{port}" = "None" ]; then
726 image={repo}/{container}:{tag}
728 image={repo}:{port}/{container}:{tag}
730 ./trivy --exit-code 1 $image
733 name: 'xtesting-{repo}-{container}-{tag}-trivy'
741 <<: *xtesting-containers
744 name: 'xtesting-opnfv-xtesting-trivy'
746 container: 'xtesting'
748 - 'xtesting-{repo}-{container}-{tag}-trivy'
751 name: 'xtesting-opnfv-xtesting-mts-trivy'
753 container: 'xtesting-mts'
755 - 'xtesting-{repo}-{container}-{tag}-trivy'
761 - 'xtesting-{tag}-docker'
764 name: xtesting-docker
773 regex: ^xtesting-[a-z0-9.]+-docker$
785 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$