2c584b309036f84eebc55b95df0ceba5d0627398
[releng.git] / jjb / functest / functest-kubernetes.yaml
1 ---
2 - functest-kubernetes-containers: &functest-kubernetes-containers
3     name: 'functest-kubernetes-containers'
4     repo: '{repo}'
5     port: '{port}'
6     container: '{container}'
7     tag: '{tag}'
8
9 - functest-kubernetes-params: &functest-kubernetes-params
10     name: 'functest-kubernetes-params'
11     repo: 'opnfv'
12     port:
13     tag:
14       - latest:
15           from:
16           buildargs:
17           branch: master
18           slave: lf-virtual1-6
19           dependency: 3.13
20       - leguer:
21           from:
22           buildargs:
23           branch: stable/leguer
24           slave: lf-virtual1-5
25           dependency: 3.12
26       - kali:
27           from:
28           buildargs:
29           branch: stable/kali
30           slave: lf-virtual1-4
31           dependency: 3.11
32       - jerma:
33           from:
34           buildargs:
35           branch: stable/jerma
36           slave: lf-virtual1-3
37           dependency: 3.10
38       - iruya:
39           from:
40           buildargs:
41           branch: stable/iruya
42           slave: lf-virtual1-2
43           dependency: 3.9
44       - hunter:
45           from:
46           buildargs:
47           branch: stable/hunter
48           slave: lf-virtual1-1
49           dependency: 3.9
50
51 - functest-kubernetes-jobs: &functest-kubernetes-jobs
52     name: 'functest-kubernetes-jobs'
53     current-parameters: true
54
55 - parameter:
56     name: functest-kubernetes-slave
57     parameters:
58       - label:
59           name: slave
60           default: '{slave}'
61
62 - parameter:
63     name: functest-kubernetes-build_tag
64     parameters:
65       - random-string:
66           name: build_tag
67
68 - parameter:
69     name: functest-kubernetes-DEPLOY_SCENARIO
70     parameters:
71       - string:
72           name: DEPLOY_SCENARIO
73           default: k8-nosdn-nofeature-noha
74
75 - functest-kubernetes-run-containers: &functest-kubernetes-run-containers
76     name: 'functest-kubernetes-run-containers'
77     <<: *functest-kubernetes-containers
78     test: '{test}'
79     privileged: '{privileged}'
80     network: '{network}'
81
82 - builder:
83     name: functest-kubernetes-pull-containers
84     builders:
85       - shell: |
86           set +x
87           if [ "{repo}" = "_" ]; then
88             image={container}:{tag}
89           elif [ "{port}" = "None" ]; then
90             image={repo}/{container}:{tag}
91           else
92             image={repo}:{port}/{container}:{tag}
93           fi
94           docker pull $image
95
96 - builder:
97     name: functest-kubernetes-run-containers
98     builders:
99       - shell: |
100           set +x
101           [ ! -z "$WORKSPACE" ] && rm -rf $WORKSPACE/results || true
102           if [ "{repo}" = "_" ]; then
103             image={container}:{tag}
104           elif [ "{port}" = "None" ]; then
105             image={repo}/{container}:{tag}
106           else
107             image={repo}:{port}/{container}:{tag}
108           fi
109           docker run --rm \
110             --privileged={privileged} \
111             --network={network} \
112             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
113             -e S3_DST_URL=s3://artifacts.opnfv.org/functest-kubernetes/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
114             -e HTTP_DST_URL=http://artifacts.opnfv.org/functest-kubernetes/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
115             -v /home/opnfv/functest-kubernetes/.boto:/root/.boto \
116             -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
117             -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
118             -e NODE_NAME=$slave \
119             -e BUILD_TAG=$BUILD_TAG \
120             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
121             -e DEPLOY_SCENARIO=$DEPLOY_SCENARIO \
122             -v /home/opnfv/functest-kubernetes/config.{tag}:/root/.kube/config \
123             $image run_tests -t {test} -p -r
124
125 - builder:
126     name: functest-kubernetes-remove-images
127     builders:
128       - shell: |
129           set +x
130           if [ "{repo}" = "_" ]; then
131             image={container}:{tag}
132           elif [ "{port}" = "None" ]; then
133             image={repo}/{container}:{tag}
134           else
135             image={repo}:{port}/{container}:{tag}
136           fi
137           docker rmi $image || true
138
139 - job-template:
140     name: 'functest-kubernetes-{repo}-{container}-{tag}-pull'
141     parameters:
142       - functest-kubernetes-slave:
143           slave: '{slave}'
144     builders:
145       - functest-kubernetes-pull-containers:
146           <<: *functest-kubernetes-containers
147
148 - project:
149     name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-pull'
150     <<: *functest-kubernetes-params
151     container: 'functest-kubernetes-healthcheck'
152     jobs:
153       - 'functest-kubernetes-{repo}-{container}-{tag}-pull'
154
155 - project:
156     name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-pull'
157     <<: *functest-kubernetes-params
158     container: 'functest-kubernetes-smoke'
159     jobs:
160       - 'functest-kubernetes-{repo}-{container}-{tag}-pull'
161
162 - project:
163     name: 'functest-kubernetes-opnfv-functest-kubernetes-security-pull'
164     <<: *functest-kubernetes-params
165     container: 'functest-kubernetes-security'
166     jobs:
167       - 'functest-kubernetes-{repo}-{container}-{tag}-pull'
168
169 - project:
170     name: 'functest-kubernetes-opnfv-functest-kubernetes-benchmarking-pull'
171     <<: *functest-kubernetes-params
172     container: 'functest-kubernetes-benchmarking'
173     jobs:
174       - 'functest-kubernetes-{repo}-{container}-{tag}-pull'
175
176 - project:
177     name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf-pull'
178     <<: *functest-kubernetes-params
179     container: 'functest-kubernetes-cnf'
180     jobs:
181       - 'functest-kubernetes-{repo}-{container}-{tag}-pull'
182
183 - job-template:
184     name: 'functest-kubernetes-{repo}-{container}-{tag}-rmi'
185     parameters:
186       - functest-kubernetes-slave:
187           slave: '{slave}'
188     builders:
189       - functest-kubernetes-remove-images:
190           <<: *functest-kubernetes-containers
191
192 - project:
193     name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-rmi'
194     <<: *functest-kubernetes-params
195     container: 'functest-kubernetes-healthcheck'
196     jobs:
197       - 'functest-kubernetes-{repo}-{container}-{tag}-rmi'
198
199 - project:
200     name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-rmi'
201     <<: *functest-kubernetes-params
202     container: 'functest-kubernetes-smoke'
203     jobs:
204       - 'functest-kubernetes-{repo}-{container}-{tag}-rmi'
205
206 - project:
207     name: 'functest-kubernetes-opnfv-functest-kubernetes-security-rmi'
208     <<: *functest-kubernetes-params
209     container: 'functest-kubernetes-security'
210     jobs:
211       - 'functest-kubernetes-{repo}-{container}-{tag}-rmi'
212
213 - project:
214     name: 'functest-kubernetes-opnfv-functest-kubernetes-benchmarking-rmi'
215     <<: *functest-kubernetes-params
216     container: 'functest-kubernetes-benchmarking'
217     jobs:
218       - 'functest-kubernetes-{repo}-{container}-{tag}-rmi'
219
220 - project:
221     name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf-rmi'
222     <<: *functest-kubernetes-params
223     container: 'functest-kubernetes-cnf'
224     jobs:
225       - 'functest-kubernetes-{repo}-{container}-{tag}-rmi'
226
227 - job-template:
228     name: 'functest-kubernetes-{repo}-{container}-{tag}-{test}-run'
229     parameters:
230       - functest-kubernetes-slave:
231           slave: '{slave}'
232       - functest-kubernetes-build_tag:
233           build_tag: ''
234       - functest-kubernetes-DEPLOY_SCENARIO:
235           DEPLOY_SCENARIO: k8-nosdn-nofeature-noha
236     builders:
237       - functest-kubernetes-run-containers:
238           <<: *functest-kubernetes-run-containers
239
240 - project:
241     name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck'
242     <<: *functest-kubernetes-params
243     container: 'functest-kubernetes-healthcheck'
244     test:
245       - k8s_quick
246       - k8s_smoke
247     privileged: 'false'
248     network: bridge
249     jobs:
250       - 'functest-kubernetes-{repo}-{container}-{tag}-{test}-run'
251
252 - project:
253     name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke'
254     <<: *functest-kubernetes-params
255     container: 'functest-kubernetes-smoke'
256     test:
257       - xrally_kubernetes
258       - k8s_conformance
259       - sig_network
260       - sig_network_features
261       - sig_storage
262     privileged: 'false'
263     network: bridge
264     exclude:
265       - {'tag': 'leguer', 'test': 'sig_network'}
266       - {'tag': 'leguer', 'test': 'sig_network_features'}
267       - {'tag': 'leguer', 'test': 'sig_storage'}
268       - {'tag': 'kali', 'test': 'sig_network'}
269       - {'tag': 'kali', 'test': 'sig_network_features'}
270       - {'tag': 'kali', 'test': 'sig_storage'}
271       - {'tag': 'jerma', 'test': 'sig_network'}
272       - {'tag': 'jerma', 'test': 'sig_network_features'}
273       - {'tag': 'jerma', 'test': 'sig_storage'}
274       - {'tag': 'iruya', 'test': 'sig_network'}
275       - {'tag': 'iruya', 'test': 'sig_network_features'}
276       - {'tag': 'iruya', 'test': 'sig_storage'}
277       - {'tag': 'hunter', 'test': 'sig_network'}
278       - {'tag': 'hunter', 'test': 'sig_network_features'}
279       - {'tag': 'hunter', 'test': 'sig_storage'}
280     jobs:
281       - 'functest-kubernetes-{repo}-{container}-{tag}-{test}-run'
282
283 - project:
284     name: 'functest-kubernetes-opnfv-functest-kubernetes-security'
285     <<: *functest-kubernetes-params
286     container: 'functest-kubernetes-security'
287     test:
288       - kube_hunter
289       - kube_bench_master
290       - kube_bench_node
291     privileged: 'false'
292     network: bridge
293     jobs:
294       - 'functest-kubernetes-{repo}-{container}-{tag}-{test}-run'
295
296 - project:
297     name: 'functest-kubernetes-opnfv-functest-kubernetes-benchmarking'
298     <<: *functest-kubernetes-params
299     container: 'functest-kubernetes-benchmarking'
300     test:
301       - xrally_kubernetes_full
302     privileged: 'false'
303     network: bridge
304     jobs:
305       - 'functest-kubernetes-{repo}-{container}-{tag}-{test}-run'
306
307 - project:
308     name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf'
309     <<: *functest-kubernetes-params
310     container: 'functest-kubernetes-cnf'
311     test:
312       - k8s_vims
313       - helm_vims
314       - cnf_conformance
315     privileged: 'false'
316     network: bridge
317     jobs:
318       - 'functest-kubernetes-{repo}-{container}-{tag}-{test}-run'
319
320
321 - builder:
322     name: functest-kubernetes-zip
323     builders:
324       - shell: |
325           set +x
326           [ ! -z "$WORKSPACE" ] && rm -rf $WORKSPACE/results || true
327           if [ "{repo}" = "_" ]; then
328             image={container}:{tag}
329           elif [ "{port}" = "None" ]; then
330             image={repo}/{container}:{tag}
331           else
332             image={repo}:{port}/{container}:{tag}
333           fi
334           docker run --rm \
335             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
336             -e S3_DST_URL=s3://artifacts.opnfv.org/functest-kubernetes \
337             -e HTTP_DST_URL=http://artifacts.opnfv.org/functest-kubernetes \
338             -v /home/opnfv/functest-kubernetes/.boto:/root/.boto \
339             -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
340             -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
341             -e BUILD_TAG=$BUILD_TAG \
342             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
343             -e DEPLOY_SCENARIO=$DEPLOY_SCENARIO \
344             -v /home/opnfv/functest-kubernetes/config.{tag}:/root/.kube/config \
345             $image zip_campaign
346
347 - job-template:
348     name: 'functest-kubernetes-{tag}-zip'
349     parameters:
350       - functest-kubernetes-slave:
351           slave: '{slave}'
352       - functest-kubernetes-build_tag:
353           build_tag: ''
354       - functest-kubernetes-DEPLOY_SCENARIO:
355           DEPLOY_SCENARIO: k8-nosdn-nofeature-noha
356     builders:
357       - functest-kubernetes-zip:
358           <<: *functest-kubernetes-containers
359
360 - project:
361     name: 'functest-kubernetes-{tag}-zip'
362     <<: *functest-kubernetes-params
363     container: 'functest-kubernetes-healthcheck'
364     jobs:
365       - 'functest-kubernetes-{tag}-zip'
366
367 - job-template:
368     name: 'functest-kubernetes-{tag}-daily'
369     project-type: multijob
370     triggers:
371       - timed: '@weekly'
372     parameters:
373       - functest-kubernetes-slave:
374           slave: '{slave}'
375       - functest-kubernetes-build_tag:
376           build_tag: ''
377       - functest-kubernetes-DEPLOY_SCENARIO:
378           DEPLOY_SCENARIO: k8-nosdn-nofeature-noha
379     properties:
380       - build-blocker:
381           use-build-blocker: true
382           blocking-level: 'NODE'
383           blocking-jobs:
384             - '^functest-kubernetes-{tag}-(daily|docker|review)$'
385     builders:
386       - multijob:
387           name: remove former images
388           projects:
389             - name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-rmi'
390               <<: *functest-kubernetes-jobs
391             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-rmi'
392               <<: *functest-kubernetes-jobs
393             - name: 'functest-kubernetes-opnfv-functest-kubernetes-security-{tag}-rmi'
394               <<: *functest-kubernetes-jobs
395             - name: 'functest-kubernetes-opnfv-functest-kubernetes-benchmarking-{tag}-rmi'
396               <<: *functest-kubernetes-jobs
397             - name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf-{tag}-rmi'
398               <<: *functest-kubernetes-jobs
399       - multijob:
400           name: pull containers
401           projects:
402             - name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-pull'
403               <<: *functest-kubernetes-jobs
404             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-pull'
405               <<: *functest-kubernetes-jobs
406             - name: 'functest-kubernetes-opnfv-functest-kubernetes-security-{tag}-pull'
407               <<: *functest-kubernetes-jobs
408             - name: 'functest-kubernetes-opnfv-functest-kubernetes-benchmarking-{tag}-pull'
409               <<: *functest-kubernetes-jobs
410             - name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf-{tag}-pull'
411               <<: *functest-kubernetes-jobs
412       - multijob:
413           name: opnfv/functest-kubernetes-healthcheck:{tag}
414           projects:
415             - name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-k8s_quick-run'
416               <<: *functest-kubernetes-jobs
417             - name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-k8s_smoke-run'
418               <<: *functest-kubernetes-jobs
419       - multijob:
420           name: opnfv/functest-kubernetes-smoke:{tag}
421           projects:
422             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-xrally_kubernetes-run'
423               <<: *functest-kubernetes-jobs
424             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-k8s_conformance-run'
425               <<: *functest-kubernetes-jobs
426             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-sig_network-run'
427               <<: *functest-kubernetes-jobs
428             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-sig_network_features-run'
429               <<: *functest-kubernetes-jobs
430             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-sig_storage-run'
431               <<: *functest-kubernetes-jobs
432       - multijob:
433           name: opnfv/functest-kubernetes-security:{tag}
434           projects:
435             - name: 'functest-kubernetes-opnfv-functest-kubernetes-security-{tag}-kube_hunter-run'
436               <<: *functest-kubernetes-jobs
437             - name: 'functest-kubernetes-opnfv-functest-kubernetes-security-{tag}-kube_bench_master-run'
438               <<: *functest-kubernetes-jobs
439             - name: 'functest-kubernetes-opnfv-functest-kubernetes-security-{tag}-kube_bench_node-run'
440               <<: *functest-kubernetes-jobs
441       - multijob:
442           name: opnfv/functest-kubernetes-benchmarking:{tag}
443           projects:
444             - name: 'functest-kubernetes-opnfv-functest-kubernetes-benchmarking-{tag}-xrally_kubernetes_full-run'
445               <<: *functest-kubernetes-jobs
446       - multijob:
447           name: opnfv/functest-kubernetes-cnf:{tag}
448           projects:
449             - name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf-{tag}-k8s_vims-run'
450               <<: *functest-kubernetes-jobs
451             - name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf-{tag}-helm_vims-run'
452               <<: *functest-kubernetes-jobs
453             - name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf-{tag}-cnf_conformance-run'
454               <<: *functest-kubernetes-jobs
455       - multijob:
456           name: dump all campaign data
457           projects:
458             - name: 'functest-kubernetes-{tag}-zip'
459               <<: *functest-kubernetes-jobs
460
461 - project:
462     name: 'functest-kubernetes-daily'
463     <<: *functest-kubernetes-params
464     jobs:
465       - 'functest-kubernetes-{tag}-daily'
466
467 - view:
468     name: functest-kubernetes
469     view-type: list
470     columns:
471       - status
472       - weather
473       - job
474       - last-success
475       - last-failure
476       - last-duration
477     regex: ^functest-kubernetes-[a-z0-9.]+-daily$
478
479 - functest-kubernetes-build-containers: &functest-kubernetes-build-containers
480     name: 'functest-kubernetes-build-containers'
481     <<: *functest-kubernetes-containers
482     ref_arg: '{ref_arg}'
483     path: '{path}'
484     buildargs: '{buildargs}'
485     from: '{from}'
486
487 - builder:
488     name: functest-kubernetes-build-containers
489     builders:
490       - shell: |
491           set +x
492           if [ "{repo}" = "_" ]; then
493             image={container}:{tag}
494           elif [ "{port}" = "None" ]; then
495             image={repo}/{container}:{tag}
496           else
497             image={repo}:{port}/{container}:{tag}
498           fi
499           build_args=""
500           if [ "{buildargs}" != "None" ]; then
501             build_args="{buildargs}"
502           fi
503           if [ "{ref_arg}" != "None" ]; then
504             build_args="$build_args --build-arg {ref_arg}={ref}"
505           fi
506           cd {path}
507           if [ "{from}" != "None" ]; then
508               sed -i {from} Dockerfile
509           fi
510           docker build $build_args \
511             --pull=false --no-cache --force-rm=true \
512             -t $image .
513
514 - scm:
515     name: functest-kubernetes-scm
516     scm:
517       - git:
518           url: 'https://gerrit.opnfv.org/gerrit/functest-kubernetes'
519           refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
520           branches:
521             - '{ref}'
522
523 - functest-kubernetes-dep: &functest-kubernetes-dep
524     name: 'functest-kubernetes-containers'
525     repo: '{repo}'
526     port: '{port}'
527     tag: '{tag}'
528     dependency: '{dependency}'
529
530 - builder:
531     name: functest-kubernetes-pull-dep-images
532     builders:
533       - shell: |
534           set +x
535           if [ "_" = "_" ]; then
536             image=alpine:{dependency}
537           elif [ "_" = "None" ]; then
538             image=_/alpine:{dependency}
539           else
540             image=_:/alpine{dependency}
541           fi
542           docker pull $image || true
543
544 - builder:
545     name: functest-kubernetes-remove-dep-images
546     builders:
547       - shell: |
548           set +x
549           if [ "_" = "_" ]; then
550             image=alpine:{dependency}
551           elif [ "_" = "None" ]; then
552             image=_/alpine:{dependency}
553           else
554             image=_:/alpine{dependency}
555           fi
556           docker rmi $image || true
557
558 - job-template:
559     name: 'functest-kubernetes-{repo}-{tag}-dep-pull'
560     parameters:
561       - functest-kubernetes-slave:
562           slave: '{slave}'
563     builders:
564       - functest-kubernetes-pull-dep-images:
565           <<: *functest-kubernetes-dep
566
567 - project:
568     name: 'functest-kubernetes-{repo}-{tag}-dep-pull'
569     <<: *functest-kubernetes-params
570     jobs:
571       - 'functest-kubernetes-{repo}-{tag}-dep-pull'
572
573 - job-template:
574     name: 'functest-kubernetes-{repo}-{tag}-dep-rmi'
575     parameters:
576       - functest-kubernetes-slave:
577           slave: '{slave}'
578     builders:
579       - functest-kubernetes-remove-dep-images:
580           <<: *functest-kubernetes-dep
581
582 - project:
583     name: 'functest-kubernetes-{repo}-{tag}-dep-rmi'
584     <<: *functest-kubernetes-params
585     jobs:
586       - 'functest-kubernetes-{repo}-{tag}-dep-rmi'
587
588 - builder:
589     name: functest-kubernetes-tox
590     builders:
591       - shell: |
592           set +x
593           apt-get update && apt-get install software-properties-common gpg -y
594           add-apt-repository -y ppa:deadsnakes/ppa
595           apt-get update && apt-get install python3.8 python3.8-dev \
596             python3.8-distutils \
597             python3.7 python3.7-dev python3.6 python3.6-dev \
598             python python-dev python3-pip enchant -y
599           pip3 install tox tox-pip-version
600           tox
601
602 - job-template:
603     name: 'functest-kubernetes-{tag}-tox'
604     scm:
605       - functest-kubernetes-scm:
606           ref: $GERRIT_REFSPEC
607     triggers:
608       - functest-kubernetes-patchset-created:
609           branch: '{branch}'
610     parameters:
611       - functest-kubernetes-slave:
612           slave: '{slave}'
613     builders:
614       - functest-kubernetes-tox:
615
616 - project:
617     name: functest-kubernetes-tox
618     <<: *functest-kubernetes-params
619     jobs:
620       - 'functest-kubernetes-{tag}-tox'
621
622 - job-template:
623     name: 'functest-kubernetes-{repo}-{container}-{tag}-gate'
624     parameters:
625       - functest-kubernetes-slave:
626           slave: '{slave}'
627     scm:
628       - functest-kubernetes-scm:
629           ref: $GERRIT_REFSPEC
630     builders:
631       - functest-kubernetes-build-containers:
632           <<: *functest-kubernetes-build-containers
633           ref: $GERRIT_REFSPEC
634           buildargs: '{buildargs}'
635
636 - project:
637     name: functest-kubernetes-opnfv-functest-kubernetes-core-{tag}-gate
638     <<: *functest-kubernetes-params
639     container: functest-kubernetes-core
640     ref_arg: BRANCH
641     path: docker/core
642     jobs:
643       - 'functest-kubernetes-{repo}-{container}-{tag}-gate'
644
645 - project:
646     name: functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-gate
647     <<: *functest-kubernetes-params
648     container: functest-kubernetes-healthcheck
649     ref_arg:
650     path: docker/healthcheck
651     jobs:
652       - 'functest-kubernetes-{repo}-{container}-{tag}-gate'
653
654 - project:
655     name: functest-kubernetes-opnfv-functest-kubernetes-cnf-{tag}-gate
656     <<: *functest-kubernetes-params
657     container: functest-kubernetes-cnf
658     ref_arg: BRANCH
659     path: docker/cnf
660     jobs:
661       - 'functest-kubernetes-{repo}-{container}-{tag}-gate'
662
663 - project:
664     name: functest-kubernetes-opnfv-functest-kubernetes-security-{tag}-gate
665     <<: *functest-kubernetes-params
666     container: functest-kubernetes-security
667     ref_arg: BRANCH
668     path: docker/security
669     jobs:
670       - 'functest-kubernetes-{repo}-{container}-{tag}-gate'
671
672 - project:
673     name: functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-gate
674     <<: *functest-kubernetes-params
675     container: functest-kubernetes-smoke
676     ref_arg:
677     path: docker/smoke
678     jobs:
679       - 'functest-kubernetes-{repo}-{container}-{tag}-gate'
680
681 - project:
682     name: functest-kubernetes-opnfv-functest-kubernetes-benchmarking-{tag}-gate
683     <<: *functest-kubernetes-params
684     container: functest-kubernetes-benchmarking
685     ref_arg:
686     path: docker/benchmarking
687     jobs:
688       - 'functest-kubernetes-{repo}-{container}-{tag}-gate'
689
690
691 - trigger:
692     name: functest-kubernetes-patchset-created
693     triggers:
694       - gerrit:
695           trigger-on:
696             - patchset-created-event
697             - comment-added-contains-event:
698                 comment-contains-value: 'recheck'
699             - comment-added-contains-event:
700                 comment-contains-value: 'reverify'
701           projects:
702             - project-compare-type: 'ANT'
703               project-pattern: 'functest-kubernetes'
704               branches:
705                 - branch-compare-type: 'ANT'
706                   branch-pattern: '**/{branch}'
707
708 - job-template:
709     name: 'functest-kubernetes-{tag}-review'
710     project-type: multijob
711     triggers:
712       - functest-kubernetes-patchset-created:
713           branch: '{branch}'
714     parameters:
715       - functest-kubernetes-slave:
716           slave: '{slave}'
717       - functest-kubernetes-build_tag:
718           build_tag: ''
719       - functest-kubernetes-DEPLOY_SCENARIO:
720           DEPLOY_SCENARIO: k8-nosdn-nofeature-noha
721     properties:
722       - build-blocker:
723           use-build-blocker: true
724           blocking-level: 'NODE'
725           blocking-jobs:
726             - '^functest-kubernetes-{tag}-(daily|docker|review)$'
727     builders:
728       - multijob:
729           name: remove former images
730           projects:
731             - name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-rmi'
732               <<: *functest-kubernetes-jobs
733             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-rmi'
734               <<: *functest-kubernetes-jobs
735             - name: 'functest-kubernetes-opnfv-functest-kubernetes-security-{tag}-rmi'
736               <<: *functest-kubernetes-jobs
737             - name: 'functest-kubernetes-opnfv-functest-kubernetes-benchmarking-{tag}-rmi'
738               <<: *functest-kubernetes-jobs
739             - name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf-{tag}-rmi'
740               <<: *functest-kubernetes-jobs
741       - multijob:
742           name: remove dependency
743           projects:
744             - name: 'functest-kubernetes-{repo}-{tag}-dep-rmi'
745               <<: *functest-kubernetes-jobs
746       - multijob:
747           name: pull dependency
748           projects:
749             - name: 'functest-kubernetes-{repo}-{tag}-dep-pull'
750               <<: *functest-kubernetes-jobs
751       - multijob:
752           name: build opnfv/functest-kubernetes-core
753           projects:
754             - name: 'functest-kubernetes-opnfv-functest-kubernetes-core-{tag}-gate'
755               <<: *functest-kubernetes-jobs
756       - multijob:
757           name: build containers
758           projects:
759             - name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-gate'
760               <<: *functest-kubernetes-jobs
761             - name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf-{tag}-gate'
762               <<: *functest-kubernetes-jobs
763             - name: 'functest-kubernetes-opnfv-functest-kubernetes-security-{tag}-gate'
764               <<: *functest-kubernetes-jobs
765       - multijob:
766           name: build opnfv/functest-kubernetes-smoke
767           projects:
768             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-gate'
769               <<: *functest-kubernetes-jobs
770       - multijob:
771           name: build opnfv/functest-kubernetes-benchmarking
772           projects:
773             - name: 'functest-kubernetes-opnfv-functest-kubernetes-benchmarking-{tag}-gate'
774               <<: *functest-kubernetes-jobs
775       - multijob:
776           name: opnfv/functest-kubernetes-healthcheck:{tag}
777           projects:
778             - name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-k8s_quick-run'
779               <<: *functest-kubernetes-jobs
780             - name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-k8s_smoke-run'
781               <<: *functest-kubernetes-jobs
782       - multijob:
783           name: opnfv/functest-kubernetes-smoke:{tag}
784           projects:
785             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-xrally_kubernetes-run'
786               <<: *functest-kubernetes-jobs
787             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-k8s_conformance-run'
788               <<: *functest-kubernetes-jobs
789             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-sig_network-run'
790               <<: *functest-kubernetes-jobs
791             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-sig_network_features-run'
792               <<: *functest-kubernetes-jobs
793             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-sig_storage-run'
794               <<: *functest-kubernetes-jobs
795       - multijob:
796           name: opnfv/functest-kubernetes-security:{tag}
797           projects:
798             - name: 'functest-kubernetes-opnfv-functest-kubernetes-security-{tag}-kube_hunter-run'
799               <<: *functest-kubernetes-jobs
800             - name: 'functest-kubernetes-opnfv-functest-kubernetes-security-{tag}-kube_bench_master-run'
801               <<: *functest-kubernetes-jobs
802             - name: 'functest-kubernetes-opnfv-functest-kubernetes-security-{tag}-kube_bench_node-run'
803               <<: *functest-kubernetes-jobs
804       - multijob:
805           name: opnfv/functest-kubernetes-benchmarking:{tag}
806           projects:
807             - name: 'functest-kubernetes-opnfv-functest-kubernetes-benchmarking-{tag}-xrally_kubernetes_full-run'
808               <<: *functest-kubernetes-jobs
809       - multijob:
810           name: opnfv/functest-kubernetes-cnf:{tag}
811           projects:
812             - name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf-{tag}-k8s_vims-run'
813               <<: *functest-kubernetes-jobs
814             - name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf-{tag}-helm_vims-run'
815               <<: *functest-kubernetes-jobs
816             - name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf-{tag}-cnf_conformance-run'
817               <<: *functest-kubernetes-jobs
818
819 - project:
820     name: 'functest-kubernetes-review'
821     <<: *functest-kubernetes-params
822     jobs:
823       - 'functest-kubernetes-{tag}-review'
824
825 - view:
826     name: functest-kubernetes-review
827     view-type: list
828     columns:
829       - status
830       - weather
831       - job
832       - last-success
833       - last-failure
834       - last-duration
835     regex: ^functest-kubernetes-[a-z0-9.]+-review$
836
837 - view:
838     name: functest-kubernetes-tox
839     view-type: list
840     columns:
841       - status
842       - weather
843       - job
844       - last-success
845       - last-failure
846       - last-duration
847     regex: ^functest-kubernetes-[a-z0-9.]+-tox$
848
849 - builder:
850     name: functest-kubernetes-push-containers
851     builders:
852       - shell: |
853           set +x
854           if [ "{repo}" = "_" ]; then
855             image={container}:{tag}
856           elif [ "{port}" = "None" ]; then
857             image={repo}/{container}:{tag}
858           else
859             image={repo}:{port}/{container}:{tag}
860           fi
861           docker push $image
862
863 - trigger:
864     name: functest-kubernetes-commit
865     triggers:
866       - pollscm:
867           cron: "*/30 * * * *"
868
869 - job-template:
870     name: 'functest-kubernetes-{repo}-{container}-{tag}-build'
871     parameters:
872       - functest-kubernetes-slave:
873           slave: '{slave}'
874     scm:
875       - functest-kubernetes-scm:
876           ref: '{branch}'
877     builders:
878       - functest-kubernetes-build-containers:
879           <<: *functest-kubernetes-build-containers
880           ref: '{branch}'
881           buildargs: '{buildargs}'
882       - functest-kubernetes-push-containers:
883           <<: *functest-kubernetes-build-containers
884           ref: '{branch}'
885
886 - project:
887     name: functest-kubernetes-opnfv-functest-kubernetes-core-{tag}-build
888     <<: *functest-kubernetes-params
889     container: functest-kubernetes-core
890     ref_arg: BRANCH
891     path: docker/core
892     jobs:
893       - 'functest-kubernetes-{repo}-{container}-{tag}-build'
894
895 - project:
896     name: functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-build
897     <<: *functest-kubernetes-params
898     container: functest-kubernetes-healthcheck
899     ref_arg:
900     path: docker/healthcheck
901     jobs:
902       - 'functest-kubernetes-{repo}-{container}-{tag}-build'
903
904 - project:
905     name: functest-kubernetes-opnfv-functest-kubernetes-cnf-{tag}-build
906     <<: *functest-kubernetes-params
907     container: functest-kubernetes-cnf
908     ref_arg: BRANCH
909     path: docker/cnf
910     jobs:
911       - 'functest-kubernetes-{repo}-{container}-{tag}-build'
912
913 - project:
914     name: functest-kubernetes-opnfv-functest-kubernetes-security-{tag}-build
915     <<: *functest-kubernetes-params
916     container: functest-kubernetes-security
917     ref_arg: BRANCH
918     path: docker/security
919     jobs:
920       - 'functest-kubernetes-{repo}-{container}-{tag}-build'
921
922 - project:
923     name: functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-build
924     <<: *functest-kubernetes-params
925     container: functest-kubernetes-smoke
926     ref_arg:
927     path: docker/smoke
928     jobs:
929       - 'functest-kubernetes-{repo}-{container}-{tag}-build'
930
931 - project:
932     name: functest-kubernetes-opnfv-functest-kubernetes-benchmarking-{tag}-build
933     <<: *functest-kubernetes-params
934     container: functest-kubernetes-benchmarking
935     ref_arg:
936     path: docker/benchmarking
937     jobs:
938       - 'functest-kubernetes-{repo}-{container}-{tag}-build'
939
940
941 - job-template:
942     name: 'functest-kubernetes-{tag}-docker'
943     project-type: multijob
944     triggers:
945       - functest-kubernetes-commit
946     scm:
947       - functest-kubernetes-scm:
948           ref: '{branch}'
949     parameters:
950       - functest-kubernetes-slave:
951           slave: '{slave}'
952     properties:
953       - build-blocker:
954           use-build-blocker: true
955           blocking-level: 'NODE'
956           blocking-jobs:
957             - '^functest-kubernetes-{tag}-(daily|docker|review)$'
958     builders:
959       - multijob:
960           name: remove dependency
961           projects:
962             - name: 'functest-kubernetes-{repo}-{tag}-dep-rmi'
963               <<: *functest-kubernetes-jobs
964       - multijob:
965           name: pull dependency
966           projects:
967             - name: 'functest-kubernetes-{repo}-{tag}-dep-pull'
968               <<: *functest-kubernetes-jobs
969       - multijob:
970           name: build opnfv/functest-kubernetes-core
971           projects:
972             - name: 'functest-kubernetes-opnfv-functest-kubernetes-core-{tag}-build'
973               <<: *functest-kubernetes-jobs
974       - multijob:
975           name: build containers
976           projects:
977             - name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-build'
978               <<: *functest-kubernetes-jobs
979             - name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf-{tag}-build'
980               <<: *functest-kubernetes-jobs
981             - name: 'functest-kubernetes-opnfv-functest-kubernetes-security-{tag}-build'
982               <<: *functest-kubernetes-jobs
983       - multijob:
984           name: build opnfv/functest-kubernetes-smoke
985           projects:
986             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-build'
987               <<: *functest-kubernetes-jobs
988       - multijob:
989           name: build opnfv/functest-kubernetes-benchmarking
990           projects:
991             - name: 'functest-kubernetes-opnfv-functest-kubernetes-benchmarking-{tag}-build'
992               <<: *functest-kubernetes-jobs
993
994 - builder:
995     name: functest-kubernetes-trivy
996     builders:
997       - shell: |
998           apt-get update && apt-get install curl -y
999           curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b .
1000           if [ "{repo}" = "_" ]; then
1001             image={container}:{tag}
1002           elif [ "{port}" = "None" ]; then
1003             image={repo}/{container}:{tag}
1004           else
1005             image={repo}:{port}/{container}:{tag}
1006           fi
1007           ./trivy --exit-code 1 $image
1008
1009 - job-template:
1010     name: 'functest-kubernetes-{repo}-{container}-{tag}-trivy'
1011     triggers:
1012       - timed: '@weekly'
1013     parameters:
1014       - functest-kubernetes-slave:
1015           slave: '{slave}'
1016     builders:
1017       - functest-kubernetes-trivy:
1018           <<: *functest-kubernetes-containers
1019
1020 - project:
1021     name: 'functest-kubernetes-opnfv-functest-kubernetes-core-trivy'
1022     <<: *functest-kubernetes-params
1023     container: 'functest-kubernetes-core'
1024     jobs:
1025       - 'functest-kubernetes-{repo}-{container}-{tag}-trivy'
1026
1027 - project:
1028     name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-trivy'
1029     <<: *functest-kubernetes-params
1030     container: 'functest-kubernetes-healthcheck'
1031     jobs:
1032       - 'functest-kubernetes-{repo}-{container}-{tag}-trivy'
1033
1034 - project:
1035     name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf-trivy'
1036     <<: *functest-kubernetes-params
1037     container: 'functest-kubernetes-cnf'
1038     jobs:
1039       - 'functest-kubernetes-{repo}-{container}-{tag}-trivy'
1040
1041 - project:
1042     name: 'functest-kubernetes-opnfv-functest-kubernetes-security-trivy'
1043     <<: *functest-kubernetes-params
1044     container: 'functest-kubernetes-security'
1045     jobs:
1046       - 'functest-kubernetes-{repo}-{container}-{tag}-trivy'
1047
1048 - project:
1049     name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-trivy'
1050     <<: *functest-kubernetes-params
1051     container: 'functest-kubernetes-smoke'
1052     jobs:
1053       - 'functest-kubernetes-{repo}-{container}-{tag}-trivy'
1054
1055 - project:
1056     name: 'functest-kubernetes-opnfv-functest-kubernetes-benchmarking-trivy'
1057     <<: *functest-kubernetes-params
1058     container: 'functest-kubernetes-benchmarking'
1059     jobs:
1060       - 'functest-kubernetes-{repo}-{container}-{tag}-trivy'
1061
1062 - project:
1063     name: 'functest-kubernetes'
1064     <<: *functest-kubernetes-params
1065     jobs:
1066       - 'functest-kubernetes-{tag}-docker'
1067
1068 - view:
1069     name: functest-kubernetes-docker
1070     view-type: list
1071     columns:
1072       - status
1073       - weather
1074       - job
1075       - last-success
1076       - last-failure
1077       - last-duration
1078     regex: ^functest-kubernetes-[a-z0-9.]+-docker$
1079
1080 - view:
1081     name: functest-kubernetes-trivy
1082     view-type: list
1083     columns:
1084       - status
1085       - weather
1086       - job
1087       - last-success
1088       - last-failure
1089       - last-duration
1090     regex: (?!functest-kubernetes-pi)(?!functest-kubernetes-ng)^functest-kubernetes-[a-z-0-9.]+-trivy$