2 - xtesting-jobs: &xtesting-jobs
4 current-parameters: true
6 - xtesting-params: &xtesting-params
7 name: 'xtesting-params'
44 name: xtesting-build_tag
50 - xtesting-containers: &xtesting-containers
51 name: 'xtesting-containers'
54 container: '{container}'
57 - xtesting-run-containers: &xtesting-run-containers
58 name: 'xtesting-run-containers'
59 <<: *xtesting-containers
61 privileged: '{privileged}'
65 name: xtesting-pull-containers
69 if [ "{repo}" = "_" ]; then
70 image={container}:{tag}
71 elif [ "{port}" = "None" ]; then
72 image={repo}/{container}:{tag}
74 image={repo}:{port}/{container}:{tag}
76 sudo docker pull $image
79 name: xtesting-run-containers
83 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
84 if [ "{repo}" = "_" ]; then
85 image={container}:{tag}
86 elif [ "{port}" = "None" ]; then
87 image={repo}/{container}:{tag}
89 image={repo}:{port}/{container}:{tag}
91 sudo docker run --rm \
92 --privileged={privileged} \
94 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
95 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
96 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
97 -v /home/opnfv/xtesting/.boto:/root/.boto \
98 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
99 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
100 -e NODE_NAME=$slave \
101 -e BUILD_TAG=$BUILD_TAG \
102 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
103 $image run_tests -t {test} -p -r
106 name: xtesting-remove-images
110 if [ "{repo}" = "_" ]; then
111 image={container}:{tag}
112 elif [ "{port}" = "None" ]; then
113 image={repo}/{container}:{tag}
115 image={repo}:{port}/{container}:{tag}
117 sudo docker rmi $image || true
119 - xtesting-build-containers: &xtesting-build-containers
120 name: 'xtesting-build-containers'
121 <<: *xtesting-containers
126 name: xtesting-build-containers
130 if [ "{repo}" = "_" ]; then
131 image={container}:{tag}
132 elif [ "{port}" = "None" ]; then
133 image={repo}/{container}:{tag}
135 image={repo}:{port}/{container}:{tag}
137 if [ "{ref_arg}" = "None" ]; then
140 build_arg="--build-arg {ref_arg}={ref}"
143 sudo docker build $build_arg \
144 --pull=false --no-cache --force-rm=true \
151 url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
152 refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
157 name: 'xtesting-{repo}-{container}-{tag}-pull'
162 - xtesting-pull-containers:
163 <<: *xtesting-containers
166 name: 'xtesting-opnfv-xtesting-pull'
168 container: 'xtesting'
170 - 'xtesting-{repo}-{container}-{tag}-pull'
173 name: 'xtesting-opnfv-xtesting-mts-pull'
175 container: 'xtesting-mts'
177 - 'xtesting-{repo}-{container}-{tag}-pull'
180 name: 'xtesting-{repo}-{container}-{tag}-rmi'
185 - xtesting-remove-images:
186 <<: *xtesting-containers
189 name: 'xtesting-opnfv-xtesting-rmi'
191 container: 'xtesting'
193 - 'xtesting-{repo}-{container}-{tag}-rmi'
196 name: 'xtesting-opnfv-xtesting-mts-rmi'
198 container: 'xtesting-mts'
200 - 'xtesting-{repo}-{container}-{tag}-rmi'
203 name: 'xtesting-{repo}-{container}-{tag}-{test}-run'
207 - xtesting-build_tag:
210 - xtesting-run-containers:
211 <<: *xtesting-run-containers
214 name: 'xtesting-opnfv-xtesting'
216 container: 'xtesting'
227 - 'xtesting-{repo}-{container}-{tag}-{test}-run'
230 name: 'xtesting-opnfv-xtesting-mts'
232 container: 'xtesting-mts'
238 - 'xtesting-{repo}-{container}-{tag}-{test}-run'
246 if [ "{repo}" = "_" ]; then
247 image={container}:{tag}
248 elif [ "{port}" = "None" ]; then
249 image={repo}/{container}:{tag}
251 image={repo}:{port}/{container}:{tag}
253 sudo docker run --rm \
254 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
255 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
256 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
257 -v /home/opnfv/xtesting/.boto:/root/.boto \
258 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
259 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
260 -e BUILD_TAG=$BUILD_TAG \
261 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
265 name: 'xtesting-{tag}-zip'
269 - xtesting-build_tag:
273 <<: *xtesting-containers
276 name: 'xtesting-{tag}-zip'
278 container: 'xtesting'
280 - 'xtesting-{tag}-zip'
283 name: 'xtesting-{tag}-daily'
284 project-type: multijob
290 - xtesting-build_tag:
294 use-build-blocker: true
295 blocking-level: 'NODE'
297 - '^xtesting-{tag}-(daily|docker|review)$'
300 name: remove former images
302 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
304 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
307 name: pull containers
309 - name: 'xtesting-opnfv-xtesting-{tag}-pull'
311 - name: 'xtesting-opnfv-xtesting-mts-{tag}-pull'
314 name: opnfv/xtesting:{tag}
316 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
318 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
320 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
322 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
324 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
326 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
329 name: opnfv/xtesting-mts:{tag}
331 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
334 name: dump all campaign data
336 - name: 'xtesting-{tag}-zip'
339 - xtesting-dep: &xtesting-dep
340 name: 'xtesting-containers'
344 dependency: '{dependency}'
347 name: xtesting-pull-dep-images
351 if [ "_" = "_" ]; then
352 image=alpine:{dependency}
353 elif [ "_" = "None" ]; then
354 image=_/alpine:{dependency}
356 image=_:/alpine{dependency}
358 sudo docker pull $image || true
361 name: xtesting-remove-dep-images
365 if [ "_" = "_" ]; then
366 image=alpine:{dependency}
367 elif [ "_" = "None" ]; then
368 image=_/alpine:{dependency}
370 image=_:/alpine{dependency}
372 sudo docker rmi $image || true
375 name: 'xtesting-{repo}-{tag}-dep-pull'
380 - xtesting-pull-dep-images:
384 name: 'xtesting-{repo}-{tag}-dep-pull'
387 - 'xtesting-{repo}-{tag}-dep-pull'
390 name: 'xtesting-{repo}-{tag}-dep-rmi'
395 - xtesting-remove-dep-images:
399 name: 'xtesting-{repo}-{tag}-dep-rmi'
402 - 'xtesting-{repo}-{tag}-dep-rmi'
409 sudo apt-get update && sudo apt-get install software-properties-common gpg -y
410 sudo add-apt-repository -y ppa:deadsnakes/ppa
411 sudo apt-get update && sudo apt-get install python3.8 python3.8-dev \
412 python3.8-distutils \
413 python3.7 python3.7-dev python3.6 python3.6-dev \
414 python python-dev python3-pip enchant -y
415 sudo pip3 install tox tox-pip-version
419 name: 'xtesting-{tag}-tox'
424 - xtesting-patchset-created:
436 - 'xtesting-{tag}-tox'
439 name: xtesting-opnfv-xtesting-{tag}-gate
445 - 'xtesting-{repo}-{container}-{tag}-gate'
448 name: xtesting-opnfv-xtesting-mts-{tag}-gate
450 container: xtesting-mts
454 - 'xtesting-{repo}-{container}-{tag}-gate'
458 name: 'xtesting-{repo}-{container}-{tag}-gate'
466 - xtesting-build-containers:
467 <<: *xtesting-build-containers
471 name: xtesting-patchset-created
475 - patchset-created-event
476 - comment-added-contains-event:
477 comment-contains-value: 'recheck'
478 - comment-added-contains-event:
479 comment-contains-value: 'reverify'
481 - project-compare-type: 'ANT'
482 project-pattern: 'functest-xtesting'
484 - branch-compare-type: 'ANT'
485 branch-pattern: '**/{branch}'
488 name: 'xtesting-{tag}-review'
489 project-type: multijob
491 - xtesting-patchset-created:
496 - xtesting-build_tag:
500 use-build-blocker: true
501 blocking-level: 'NODE'
503 - '^xtesting-{tag}-(daily|docker|review)$'
506 name: remove former images
508 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
510 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
513 name: remove dependency
515 - name: 'xtesting-{repo}-{tag}-dep-rmi'
518 name: pull dependency
520 - name: 'xtesting-{repo}-{tag}-dep-pull'
525 - name: 'xtesting-opnfv-xtesting-{tag}-gate'
528 name: opnfv/xtesting-mts
530 - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
533 name: opnfv/xtesting:{tag}
535 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
537 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
539 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
541 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
543 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
545 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
548 name: opnfv/xtesting-mts:{tag}
550 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
554 name: xtesting-push-containers
558 if [ "{repo}" = "_" ]; then
559 image={container}:{tag}
560 elif [ "{port}" = "None" ]; then
561 image={repo}/{container}:{tag}
563 image={repo}:{port}/{container}:{tag}
565 sudo docker push $image
568 name: xtesting-commit
574 name: 'xtesting-{repo}-{container}-{tag}-build'
582 - xtesting-build-containers:
583 <<: *xtesting-build-containers
585 - xtesting-push-containers:
586 <<: *xtesting-build-containers
590 name: xtesting-opnfv-xtesting-{tag}-build
596 - 'xtesting-{repo}-{container}-{tag}-build'
599 name: xtesting-opnfv-xtesting-mts-{tag}-build
601 container: xtesting-mts
605 - 'xtesting-{repo}-{container}-{tag}-build'
609 name: 'xtesting-{tag}-docker'
610 project-type: multijob
621 use-build-blocker: true
622 blocking-level: 'NODE'
624 - '^xtesting-{tag}-(daily|docker|review)$'
627 name: remove dependency
629 - name: 'xtesting-{repo}-{tag}-dep-rmi'
632 name: pull dependency
634 - name: 'xtesting-{repo}-{tag}-dep-pull'
639 - name: 'xtesting-opnfv-xtesting-{tag}-build'
642 name: opnfv/xtesting-mts
644 - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
651 sudo apt-get update && sudo apt-get install curl -y
652 curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
653 if [ "{repo}" = "_" ]; then
654 image={container}:{tag}
655 elif [ "{port}" = "None" ]; then
656 image={repo}/{container}:{tag}
658 image={repo}:{port}/{container}:{tag}
660 ./trivy --exit-code 1 $image
663 name: 'xtesting-{repo}-{container}-{tag}-trivy'
671 <<: *xtesting-containers
674 name: 'xtesting-opnfv-xtesting-trivy'
676 container: 'xtesting'
678 - 'xtesting-{repo}-{container}-{tag}-trivy'
680 name: 'xtesting-opnfv-xtesting-mts-trivy'
682 container: 'xtesting-mts'
684 - 'xtesting-{repo}-{container}-{tag}-trivy'
690 - 'xtesting-{tag}-daily'
691 - 'xtesting-{tag}-review'
692 - 'xtesting-{tag}-docker'
705 regex: ^xtesting-[a-z]+-daily$
708 name: xtesting-review
717 regex: ^xtesting-[a-z]+-review$
729 regex: ^xtesting-[a-z]+-tox$
732 name: xtesting-docker
741 regex: ^xtesting-[a-z]+-docker$
753 regex: ^xtesting-[a-z-]+-trivy$