Close Functest and Xtesting Hunter and Iruya jjbs
[releng.git] / jjb / functest / xtesting.yaml
1 ---
2 - xtesting-containers: &xtesting-containers
3     name: 'xtesting-containers'
4     repo: '{repo}'
5     port: '{port}'
6     container: '{container}'
7     tag: '{tag}'
8
9 - xtesting-params: &xtesting-params
10     name: 'xtesting-params'
11     repo: 'opnfv'
12     port:
13     tag:
14       - latest:
15           from:
16           buildargs:
17           branch: master
18           slave: lf-virtual1
19           dependency: 3.13
20       - wallaby:
21           from:
22           buildargs:
23           branch: stable/wallaby
24           slave: lf-virtual1
25           dependency: 3.13
26       - leguer:
27           from:
28           buildargs:
29           branch: stable/leguer
30           slave: lf-virtual1
31           dependency: 3.12
32       - kali:
33           from:
34           buildargs:
35           branch: stable/kali
36           slave: lf-virtual1
37           dependency: 3.11
38       - jerma:
39           from:
40           buildargs:
41           branch: stable/jerma
42           slave: lf-virtual1
43           dependency: 3.10
44
45 - xtesting-jobs: &xtesting-jobs
46     name: 'xtesting-jobs'
47     current-parameters: true
48
49 - parameter:
50     name: xtesting-slave
51     parameters:
52       - label:
53           name: slave
54           default: '{slave}'
55
56 - parameter:
57     name: xtesting-build_tag
58     parameters:
59       - random-string:
60           name: build_tag
61
62
63 - xtesting-run-containers: &xtesting-run-containers
64     name: 'xtesting-run-containers'
65     <<: *xtesting-containers
66     test: '{test}'
67     privileged: '{privileged}'
68     network: '{network}'
69
70 - builder:
71     name: xtesting-pull-containers
72     builders:
73       - shell: |
74           set +x
75           if [ "{repo}" = "_" ]; then
76             image={container}:{tag}
77           elif [ "{port}" = "None" ]; then
78             image={repo}/{container}:{tag}
79           else
80             image={repo}:{port}/{container}:{tag}
81           fi
82           sudo docker pull $image
83
84 - builder:
85     name: xtesting-run-containers
86     builders:
87       - shell: |
88           set +x
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}
94           else
95             image={repo}:{port}/{container}:{tag}
96           fi
97           sudo docker run --rm \
98             --privileged={privileged} \
99             --network={network} \
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
110
111 - builder:
112     name: xtesting-remove-images
113     builders:
114       - shell: |
115           set +x
116           if [ "{repo}" = "_" ]; then
117             image={container}:{tag}
118           elif [ "{port}" = "None" ]; then
119             image={repo}/{container}:{tag}
120           else
121             image={repo}:{port}/{container}:{tag}
122           fi
123           sudo docker rmi $image || true
124
125 - job-template:
126     name: 'xtesting-{repo}-{container}-{tag}-pull'
127     parameters:
128       - xtesting-slave:
129           slave: '{slave}'
130     builders:
131       - xtesting-pull-containers:
132           <<: *xtesting-containers
133
134 - project:
135     name: 'xtesting-opnfv-xtesting-pull'
136     <<: *xtesting-params
137     container: 'xtesting'
138     jobs:
139       - 'xtesting-{repo}-{container}-{tag}-pull'
140
141 - project:
142     name: 'xtesting-opnfv-xtesting-mts-pull'
143     <<: *xtesting-params
144     container: 'xtesting-mts'
145     jobs:
146       - 'xtesting-{repo}-{container}-{tag}-pull'
147
148 - job-template:
149     name: 'xtesting-{repo}-{container}-{tag}-rmi'
150     parameters:
151       - xtesting-slave:
152           slave: '{slave}'
153     builders:
154       - xtesting-remove-images:
155           <<: *xtesting-containers
156
157 - project:
158     name: 'xtesting-opnfv-xtesting-rmi'
159     <<: *xtesting-params
160     container: 'xtesting'
161     jobs:
162       - 'xtesting-{repo}-{container}-{tag}-rmi'
163
164 - project:
165     name: 'xtesting-opnfv-xtesting-mts-rmi'
166     <<: *xtesting-params
167     container: 'xtesting-mts'
168     jobs:
169       - 'xtesting-{repo}-{container}-{tag}-rmi'
170
171 - job-template:
172     name: 'xtesting-{repo}-{container}-{tag}-{test}-run'
173     parameters:
174       - xtesting-slave:
175           slave: '{slave}'
176       - xtesting-build_tag:
177           build_tag: ''
178     builders:
179       - xtesting-run-containers:
180           <<: *xtesting-run-containers
181
182 - project:
183     name: 'xtesting-opnfv-xtesting'
184     <<: *xtesting-params
185     container: 'xtesting'
186     test:
187       - first
188       - second
189       - third
190       - fourth
191       - fifth
192       - sixth
193       - eighth
194     privileged: 'false'
195     network: bridge
196     exclude:
197       - {'tag': 'leguer', 'test': 'eighth'}
198       - {'tag': 'kali', 'test': 'eighth'}
199       - {'tag': 'jerma', 'test': 'eighth'}
200     jobs:
201       - 'xtesting-{repo}-{container}-{tag}-{test}-run'
202
203 - project:
204     name: 'xtesting-opnfv-xtesting-mts'
205     <<: *xtesting-params
206     container: 'xtesting-mts'
207     test:
208       - seventh
209     privileged: 'false'
210     network: bridge
211     jobs:
212       - 'xtesting-{repo}-{container}-{tag}-{test}-run'
213
214
215 - builder:
216     name: xtesting-zip
217     builders:
218       - shell: |
219           set +x
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}
225           else
226             image={repo}:{port}/{container}:{tag}
227           fi
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 \
237             $image zip_campaign
238
239 - job-template:
240     name: 'xtesting-{tag}-zip'
241     parameters:
242       - xtesting-slave:
243           slave: '{slave}'
244       - xtesting-build_tag:
245           build_tag: ''
246     builders:
247       - xtesting-zip:
248           <<: *xtesting-containers
249
250 - project:
251     name: 'xtesting-{tag}-zip'
252     <<: *xtesting-params
253     container: 'xtesting'
254     jobs:
255       - 'xtesting-{tag}-zip'
256
257 - job-template:
258     name: 'xtesting-{tag}-daily'
259     project-type: multijob
260     triggers:
261       - timed: '@daily'
262     parameters:
263       - xtesting-slave:
264           slave: '{slave}'
265       - xtesting-build_tag:
266           build_tag: ''
267     properties:
268       - build-blocker:
269           use-build-blocker: true
270           blocking-level: 'NODE'
271           blocking-jobs:
272             - '^xtesting-{tag}-(daily|docker|review)$'
273     builders:
274       - multijob:
275           name: remove former images
276           projects:
277             - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
278               <<: *xtesting-jobs
279             - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
280               <<: *xtesting-jobs
281       - multijob:
282           name: pull containers
283           projects:
284             - name: 'xtesting-opnfv-xtesting-{tag}-pull'
285               <<: *xtesting-jobs
286             - name: 'xtesting-opnfv-xtesting-mts-{tag}-pull'
287               <<: *xtesting-jobs
288       - multijob:
289           name: opnfv/xtesting:{tag}
290           projects:
291             - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
292               <<: *xtesting-jobs
293             - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
294               <<: *xtesting-jobs
295             - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
296               <<: *xtesting-jobs
297             - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
298               <<: *xtesting-jobs
299             - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
300               <<: *xtesting-jobs
301             - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
302               <<: *xtesting-jobs
303             - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
304               <<: *xtesting-jobs
305       - multijob:
306           name: opnfv/xtesting-mts:{tag}
307           projects:
308             - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
309               <<: *xtesting-jobs
310       - multijob:
311           name: dump all campaign data
312           projects:
313             - name: 'xtesting-{tag}-zip'
314               <<: *xtesting-jobs
315
316 - project:
317     name: 'xtesting-daily'
318     <<: *xtesting-params
319     jobs:
320       - 'xtesting-{tag}-daily'
321
322 - view:
323     name: xtesting
324     view-type: list
325     columns:
326       - status
327       - weather
328       - job
329       - last-success
330       - last-failure
331       - last-duration
332     regex: ^xtesting-[a-z0-9.]+-daily$
333
334 - xtesting-build-containers: &xtesting-build-containers
335     name: 'xtesting-build-containers'
336     <<: *xtesting-containers
337     ref_arg: '{ref_arg}'
338     path: '{path}'
339     buildargs: '{buildargs}'
340     from: '{from}'
341
342 - builder:
343     name: xtesting-build-containers
344     builders:
345       - shell: |
346           set +x
347           if [ "{repo}" = "_" ]; then
348             image={container}:{tag}
349           elif [ "{port}" = "None" ]; then
350             image={repo}/{container}:{tag}
351           else
352             image={repo}:{port}/{container}:{tag}
353           fi
354           build_args=""
355           if [ "{buildargs}" != "None" ]; then
356             build_args="{buildargs}"
357           fi
358           if [ "{ref_arg}" != "None" ]; then
359             build_args="$build_args --build-arg {ref_arg}={ref}"
360           fi
361           cd {path}
362           if [ "{from}" != "None" ]; then
363               sed -i {from} Dockerfile
364           fi
365           sudo docker build $build_args \
366             --pull=false --no-cache --force-rm=true \
367             -t $image .
368
369 - scm:
370     name: xtesting-scm
371     scm:
372       - git:
373           url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
374           refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
375           branches:
376             - '{ref}'
377
378 - xtesting-dep: &xtesting-dep
379     name: 'xtesting-containers'
380     repo: '{repo}'
381     port: '{port}'
382     tag: '{tag}'
383     dependency: '{dependency}'
384
385 - builder:
386     name: xtesting-pull-dep-images
387     builders:
388       - shell: |
389           set +x
390           if [ "_" = "_" ]; then
391             image=alpine:{dependency}
392           elif [ "" = "None" ]; then
393             image=_/alpine:{dependency}
394           else
395             image=_:/alpine:{dependency}
396           fi
397           sudo docker pull $image || true
398
399 - builder:
400     name: xtesting-remove-dep-images
401     builders:
402       - shell: |
403           set +x
404           if [ "_" = "_" ]; then
405             image=alpine:{dependency}
406           elif [ "" = "None" ]; then
407             image=_/alpine:{dependency}
408           else
409             image=_:/alpine:{dependency}
410           fi
411           sudo docker rmi $image || true
412
413 - job-template:
414     name: 'xtesting-{repo}-{tag}-dep-pull'
415     parameters:
416       - xtesting-slave:
417           slave: '{slave}'
418     builders:
419       - xtesting-pull-dep-images:
420           <<: *xtesting-dep
421
422 - project:
423     name: 'xtesting-{repo}-{tag}-dep-pull'
424     <<: *xtesting-params
425     jobs:
426       - 'xtesting-{repo}-{tag}-dep-pull'
427
428 - job-template:
429     name: 'xtesting-{repo}-{tag}-dep-rmi'
430     parameters:
431       - xtesting-slave:
432           slave: '{slave}'
433     builders:
434       - xtesting-remove-dep-images:
435           <<: *xtesting-dep
436
437 - project:
438     name: 'xtesting-{repo}-{tag}-dep-rmi'
439     <<: *xtesting-params
440     jobs:
441       - 'xtesting-{repo}-{tag}-dep-rmi'
442
443 - builder:
444     name: xtesting-tox
445     builders:
446       - shell: |
447           set +x
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
456
457           tox
458
459 - job-template:
460     name: 'xtesting-{tag}-tox'
461     scm:
462       - xtesting-scm:
463           ref: $GERRIT_REFSPEC
464     triggers:
465       - xtesting-patchset-created:
466           branch: '{branch}'
467     parameters:
468       - xtesting-slave:
469           slave: '{slave}'
470     builders:
471       - xtesting-tox:
472
473 - project:
474     name: xtesting-tox
475     <<: *xtesting-params
476     jobs:
477       - 'xtesting-{tag}-tox'
478
479 - job-template:
480     name: 'xtesting-{repo}-{container}-{tag}-gate'
481     parameters:
482       - xtesting-slave:
483           slave: '{slave}'
484     scm:
485       - xtesting-scm:
486           ref: $GERRIT_REFSPEC
487     builders:
488       - xtesting-build-containers:
489           <<: *xtesting-build-containers
490           ref: $GERRIT_REFSPEC
491           buildargs: '{buildargs}'
492
493 - project:
494     name: xtesting-opnfv-xtesting-{tag}-gate
495     <<: *xtesting-params
496     container: xtesting
497     ref_arg: BRANCH
498     path: docker/core
499     jobs:
500       - 'xtesting-{repo}-{container}-{tag}-gate'
501
502 - project:
503     name: xtesting-opnfv-xtesting-mts-{tag}-gate
504     <<: *xtesting-params
505     container: xtesting-mts
506     ref_arg: BRANCH
507     path: docker/mts
508     jobs:
509       - 'xtesting-{repo}-{container}-{tag}-gate'
510
511
512 - trigger:
513     name: xtesting-patchset-created
514     triggers:
515       - gerrit:
516           trigger-on:
517             - patchset-created-event
518             - comment-added-contains-event:
519                 comment-contains-value: 'recheck'
520             - comment-added-contains-event:
521                 comment-contains-value: 'reverify'
522           projects:
523             - project-compare-type: 'ANT'
524               project-pattern: 'functest-xtesting'
525               branches:
526                 - branch-compare-type: 'ANT'
527                   branch-pattern: '**/{branch}'
528
529 - job-template:
530     name: 'xtesting-{tag}-review'
531     project-type: multijob
532     triggers:
533       - xtesting-patchset-created:
534           branch: '{branch}'
535     parameters:
536       - xtesting-slave:
537           slave: '{slave}'
538       - xtesting-build_tag:
539           build_tag: ''
540     properties:
541       - build-blocker:
542           use-build-blocker: true
543           blocking-level: 'NODE'
544           blocking-jobs:
545             - '^xtesting-{tag}-(daily|docker|review)$'
546     builders:
547       - multijob:
548           name: remove former images
549           projects:
550             - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
551               <<: *xtesting-jobs
552             - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
553               <<: *xtesting-jobs
554       - multijob:
555           name: remove dependency
556           projects:
557             - name: 'xtesting-{repo}-{tag}-dep-rmi'
558               <<: *xtesting-jobs
559       - multijob:
560           name: pull dependency
561           projects:
562             - name: 'xtesting-{repo}-{tag}-dep-pull'
563               <<: *xtesting-jobs
564       - multijob:
565           name: opnfv/xtesting
566           projects:
567             - name: 'xtesting-opnfv-xtesting-{tag}-gate'
568               <<: *xtesting-jobs
569       - multijob:
570           name: opnfv/xtesting-mts
571           projects:
572             - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
573               <<: *xtesting-jobs
574       - multijob:
575           name: opnfv/xtesting:{tag}
576           projects:
577             - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
578               <<: *xtesting-jobs
579             - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
580               <<: *xtesting-jobs
581             - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
582               <<: *xtesting-jobs
583             - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
584               <<: *xtesting-jobs
585             - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
586               <<: *xtesting-jobs
587             - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
588               <<: *xtesting-jobs
589             - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
590               <<: *xtesting-jobs
591       - multijob:
592           name: opnfv/xtesting-mts:{tag}
593           projects:
594             - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
595               <<: *xtesting-jobs
596
597 - project:
598     name: 'xtesting-review'
599     <<: *xtesting-params
600     jobs:
601       - 'xtesting-{tag}-review'
602
603 - view:
604     name: xtesting-review
605     view-type: list
606     columns:
607       - status
608       - weather
609       - job
610       - last-success
611       - last-failure
612       - last-duration
613     regex: ^xtesting-[a-z0-9.]+-review$
614
615 - view:
616     name: xtesting-tox
617     view-type: list
618     columns:
619       - status
620       - weather
621       - job
622       - last-success
623       - last-failure
624       - last-duration
625     regex: ^xtesting-[a-z0-9.]+-tox$
626
627 - builder:
628     name: xtesting-push-containers
629     builders:
630       - shell: |
631           set +x
632           if [ "{repo}" = "_" ]; then
633             image={container}:{tag}
634           elif [ "{port}" = "None" ]; then
635             image={repo}/{container}:{tag}
636           else
637             image={repo}:{port}/{container}:{tag}
638           fi
639           sudo docker push $image
640
641 - trigger:
642     name: xtesting-commit
643     triggers:
644       - pollscm:
645           cron: "*/30 * * * *"
646
647 - job-template:
648     name: 'xtesting-{repo}-{container}-{tag}-build'
649     parameters:
650       - xtesting-slave:
651           slave: '{slave}'
652     scm:
653       - xtesting-scm:
654           ref: '{branch}'
655     builders:
656       - xtesting-build-containers:
657           <<: *xtesting-build-containers
658           ref: '{branch}'
659           buildargs: '{buildargs}'
660       - xtesting-push-containers:
661           <<: *xtesting-build-containers
662           ref: '{branch}'
663
664 - project:
665     name: xtesting-opnfv-xtesting-{tag}-build
666     <<: *xtesting-params
667     container: xtesting
668     ref_arg: BRANCH
669     path: docker/core
670     jobs:
671       - 'xtesting-{repo}-{container}-{tag}-build'
672
673 - project:
674     name: xtesting-opnfv-xtesting-mts-{tag}-build
675     <<: *xtesting-params
676     container: xtesting-mts
677     ref_arg: BRANCH
678     path: docker/mts
679     jobs:
680       - 'xtesting-{repo}-{container}-{tag}-build'
681
682
683 - job-template:
684     name: 'xtesting-{tag}-docker'
685     project-type: multijob
686     triggers:
687       - xtesting-commit
688     scm:
689       - xtesting-scm:
690           ref: '{branch}'
691     parameters:
692       - xtesting-slave:
693           slave: '{slave}'
694     properties:
695       - build-blocker:
696           use-build-blocker: true
697           blocking-level: 'NODE'
698           blocking-jobs:
699             - '^xtesting-{tag}-(daily|docker|review)$'
700     builders:
701       - multijob:
702           name: remove dependency
703           projects:
704             - name: 'xtesting-{repo}-{tag}-dep-rmi'
705               <<: *xtesting-jobs
706       - multijob:
707           name: pull dependency
708           projects:
709             - name: 'xtesting-{repo}-{tag}-dep-pull'
710               <<: *xtesting-jobs
711       - multijob:
712           name: opnfv/xtesting
713           projects:
714             - name: 'xtesting-opnfv-xtesting-{tag}-build'
715               <<: *xtesting-jobs
716       - multijob:
717           name: opnfv/xtesting-mts
718           projects:
719             - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
720               <<: *xtesting-jobs
721
722 - builder:
723     name: xtesting-trivy
724     builders:
725       - shell: |
726           sudo apt-get update && sudo apt-get install curl -y
727
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}
733           else
734             image={repo}:{port}/{container}:{tag}
735           fi
736           ./trivy --exit-code 1 $image
737
738 - job-template:
739     name: 'xtesting-{repo}-{container}-{tag}-trivy'
740     triggers:
741       - timed: '@daily'
742     parameters:
743       - xtesting-slave:
744           slave: '{slave}'
745     builders:
746       - xtesting-trivy:
747           <<: *xtesting-containers
748
749 - project:
750     name: 'xtesting-opnfv-xtesting-trivy'
751     <<: *xtesting-params
752     container: 'xtesting'
753     jobs:
754       - 'xtesting-{repo}-{container}-{tag}-trivy'
755
756 - project:
757     name: 'xtesting-opnfv-xtesting-mts-trivy'
758     <<: *xtesting-params
759     container: 'xtesting-mts'
760     jobs:
761       - 'xtesting-{repo}-{container}-{tag}-trivy'
762
763 - project:
764     name: 'xtesting'
765     <<: *xtesting-params
766     jobs:
767       - 'xtesting-{tag}-docker'
768
769 - view:
770     name: xtesting-docker
771     view-type: list
772     columns:
773       - status
774       - weather
775       - job
776       - last-success
777       - last-failure
778       - last-duration
779     regex: ^xtesting-[a-z0-9.]+-docker$
780
781 - view:
782     name: xtesting-trivy
783     view-type: list
784     columns:
785       - status
786       - weather
787       - job
788       - last-success
789       - last-failure
790       - last-duration
791     regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$