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'
340 name: 'xtesting-daily'
343 - 'xtesting-{tag}-daily'
355 regex: ^xtesting-[a-z0-9]+-daily$
357 - xtesting-dep: &xtesting-dep
358 name: 'xtesting-containers'
362 dependency: '{dependency}'
365 name: xtesting-pull-dep-images
369 if [ "_" = "_" ]; then
370 image=alpine:{dependency}
371 elif [ "_" = "None" ]; then
372 image=_/alpine:{dependency}
374 image=_:/alpine{dependency}
376 sudo docker pull $image || true
379 name: xtesting-remove-dep-images
383 if [ "_" = "_" ]; then
384 image=alpine:{dependency}
385 elif [ "_" = "None" ]; then
386 image=_/alpine:{dependency}
388 image=_:/alpine{dependency}
390 sudo docker rmi $image || true
393 name: 'xtesting-{repo}-{tag}-dep-pull'
398 - xtesting-pull-dep-images:
402 name: 'xtesting-{repo}-{tag}-dep-pull'
405 - 'xtesting-{repo}-{tag}-dep-pull'
408 name: 'xtesting-{repo}-{tag}-dep-rmi'
413 - xtesting-remove-dep-images:
417 name: 'xtesting-{repo}-{tag}-dep-rmi'
420 - 'xtesting-{repo}-{tag}-dep-rmi'
427 sudo apt-get update && sudo apt-get install software-properties-common gpg -y
428 sudo add-apt-repository -y ppa:deadsnakes/ppa
429 sudo apt-get update && sudo apt-get install python3.8 python3.8-dev \
430 python3.8-distutils \
431 python3.7 python3.7-dev python3.6 python3.6-dev \
432 python python-dev python3-pip enchant -y
433 sudo pip3 install tox tox-pip-version
437 name: 'xtesting-{tag}-tox'
442 - xtesting-patchset-created:
454 - 'xtesting-{tag}-tox'
457 name: xtesting-opnfv-xtesting-{tag}-gate
463 - 'xtesting-{repo}-{container}-{tag}-gate'
466 name: xtesting-opnfv-xtesting-mts-{tag}-gate
468 container: xtesting-mts
472 - 'xtesting-{repo}-{container}-{tag}-gate'
476 name: 'xtesting-{repo}-{container}-{tag}-gate'
484 - xtesting-build-containers:
485 <<: *xtesting-build-containers
489 name: xtesting-patchset-created
493 - patchset-created-event
494 - comment-added-contains-event:
495 comment-contains-value: 'recheck'
496 - comment-added-contains-event:
497 comment-contains-value: 'reverify'
499 - project-compare-type: 'ANT'
500 project-pattern: 'functest-xtesting'
502 - branch-compare-type: 'ANT'
503 branch-pattern: '**/{branch}'
506 name: 'xtesting-{tag}-review'
507 project-type: multijob
509 - xtesting-patchset-created:
514 - xtesting-build_tag:
518 use-build-blocker: true
519 blocking-level: 'NODE'
521 - '^xtesting-{tag}-(daily|docker|review)$'
524 name: remove former images
526 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
528 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
531 name: remove dependency
533 - name: 'xtesting-{repo}-{tag}-dep-rmi'
536 name: pull dependency
538 - name: 'xtesting-{repo}-{tag}-dep-pull'
543 - name: 'xtesting-opnfv-xtesting-{tag}-gate'
546 name: opnfv/xtesting-mts
548 - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
551 name: opnfv/xtesting:{tag}
553 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
555 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
557 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
559 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
561 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
563 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
566 name: opnfv/xtesting-mts:{tag}
568 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
572 name: 'xtesting-review'
575 - 'xtesting-{tag}-review'
578 name: xtesting-review
587 regex: ^xtesting-[a-z0-9]+-review$
599 regex: ^xtesting-[a-z0-9]+-tox$
602 name: xtesting-push-containers
606 if [ "{repo}" = "_" ]; then
607 image={container}:{tag}
608 elif [ "{port}" = "None" ]; then
609 image={repo}/{container}:{tag}
611 image={repo}:{port}/{container}:{tag}
613 sudo docker push $image
616 name: xtesting-commit
622 name: 'xtesting-{repo}-{container}-{tag}-build'
630 - xtesting-build-containers:
631 <<: *xtesting-build-containers
633 - xtesting-push-containers:
634 <<: *xtesting-build-containers
638 name: xtesting-opnfv-xtesting-{tag}-build
644 - 'xtesting-{repo}-{container}-{tag}-build'
647 name: xtesting-opnfv-xtesting-mts-{tag}-build
649 container: xtesting-mts
653 - 'xtesting-{repo}-{container}-{tag}-build'
657 name: 'xtesting-{tag}-docker'
658 project-type: multijob
669 use-build-blocker: true
670 blocking-level: 'NODE'
672 - '^xtesting-{tag}-(daily|docker|review)$'
675 name: remove dependency
677 - name: 'xtesting-{repo}-{tag}-dep-rmi'
680 name: pull dependency
682 - name: 'xtesting-{repo}-{tag}-dep-pull'
687 - name: 'xtesting-opnfv-xtesting-{tag}-build'
690 name: opnfv/xtesting-mts
692 - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
699 sudo apt-get update && sudo apt-get install curl -y
700 curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
701 if [ "{repo}" = "_" ]; then
702 image={container}:{tag}
703 elif [ "{port}" = "None" ]; then
704 image={repo}/{container}:{tag}
706 image={repo}:{port}/{container}:{tag}
708 ./trivy --exit-code 1 $image
711 name: 'xtesting-{repo}-{container}-{tag}-trivy'
719 <<: *xtesting-containers
722 name: 'xtesting-opnfv-xtesting-trivy'
724 container: 'xtesting'
726 - 'xtesting-{repo}-{container}-{tag}-trivy'
728 name: 'xtesting-opnfv-xtesting-mts-trivy'
730 container: 'xtesting-mts'
732 - 'xtesting-{repo}-{container}-{tag}-trivy'
738 - 'xtesting-{tag}-docker'
741 name: xtesting-docker
750 regex: ^xtesting-[a-z0-9]+-docker$
762 regex: (?!xtesting-pi)^xtesting-[a-z-0-9]+-trivy$