Merge "Build all Xtesting VMs"
[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           build_args:
17           branch: master
18           node: lf-virtual1-9
19           dependency: 3.16
20       - v1.26:
21           from:
22           build_args:
23           branch: stable/v1.26
24           node: lf-virtual1-1
25           dependency: 3.16
26       - v1.25:
27           from:
28           build_args:
29           branch: stable/v1.25
30           node: lf-virtual1-8
31           dependency: 3.16
32       - v1.24:
33           from:
34           build_args:
35           branch: stable/v1.24
36           node: lf-virtual1-7
37           dependency: 3.16
38       - v1.23:
39           from:
40           build_args:
41           branch: stable/v1.23
42           node: lf-virtual1-6
43           dependency: 3.14
44       - v1.22:
45           from:
46           build_args:
47           branch: stable/v1.22
48           node: lf-virtual1-5
49           dependency: 3.14
50
51 - functest-kubernetes-jobs: &functest-kubernetes-jobs
52     name: 'functest-kubernetes-jobs'
53     current-parameters: true
54
55 - parameter:
56     name: functest-kubernetes-node
57     parameters:
58       - label:
59           name: node
60           default: '{node}'
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     volumes: '{volumes}'
81     env: '{env}'
82     network: '{network}'
83     uid: '{uid}'
84     gid: '{gid}'
85     published_ports: '{published_ports}'
86
87 - builder:
88     name: functest-kubernetes-pull-containers
89     builders:
90       - shell: |
91           set +x
92           if [ "{repo}" = "_" ]; then
93             image={container}:{tag}
94           elif [ "{port}" = "None" ]; then
95             image={repo}/{container}:{tag}
96           else
97             image={repo}:{port}/{container}:{tag}
98           fi
99           docker pull $image
100
101 - builder:
102     name: functest-kubernetes-run-containers
103     builders:
104       - shell: |
105           set +x
106           volumes=;
107           if [ "{volumes}" != "None" ]; then
108             for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
109               do volumes="-v $i $volumes"; done
110           fi
111           env=;
112           if [ "{env}" != "None" ]; then
113             for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
114               do env="-e $i $env"; done
115           fi
116           published_ports=;
117           if [ "{published_ports}" != "None" ]; then
118             for i in $(echo {published_ports} | tr -d '[]' |sed "s/, / /g" ); \
119               do published_ports="-p $i $published_ports"; done
120           fi
121           [ ! -z "$WORKSPACE" ] && rm -rf $WORKSPACE/results || true
122           if [ "{repo}" = "_" ]; then
123             image={container}:{tag}
124           elif [ "{port}" = "None" ]; then
125             image={repo}/{container}:{tag}
126           else
127             image={repo}:{port}/{container}:{tag}
128           fi
129           mkdir -p $WORKSPACE/results
130           chown {uid}:{gid} $WORKSPACE/results
131           docker run --rm \
132             --privileged={privileged} \
133             --network={network} \
134             $volumes \
135             $env \
136             $published_ports \
137             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
138             -e S3_DST_URL=s3://artifacts.opnfv.org/functest-kubernetes/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
139             -e HTTP_DST_URL=http://artifacts.opnfv.org/functest-kubernetes/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
140             -v /home/opnfv/functest-kubernetes/.boto:/etc/boto.cfg \
141             -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
142             -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
143             -e NODE_NAME=$node \
144             -e BUILD_TAG=$BUILD_TAG \
145             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
146             $image run_tests -t {test} -p -r
147
148 - builder:
149     name: functest-kubernetes-remove-images
150     builders:
151       - shell: |
152           set +x
153           if [ "{repo}" = "_" ]; then
154             image={container}:{tag}
155           elif [ "{port}" = "None" ]; then
156             image={repo}/{container}:{tag}
157           else
158             image={repo}:{port}/{container}:{tag}
159           fi
160           docker rmi $image || true
161
162 - job-template:
163     name: 'functest-kubernetes-{repo}-{container}-{tag}-pull'
164     parameters:
165       - functest-kubernetes-node:
166           node: '{node}'
167     builders:
168       - functest-kubernetes-pull-containers:
169           <<: *functest-kubernetes-containers
170
171 - project:
172     name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-pull'
173     <<: *functest-kubernetes-params
174     container: 'functest-kubernetes-healthcheck'
175     jobs:
176       - 'functest-kubernetes-{repo}-{container}-{tag}-pull'
177
178 - project:
179     name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-pull'
180     <<: *functest-kubernetes-params
181     container: 'functest-kubernetes-smoke'
182     jobs:
183       - 'functest-kubernetes-{repo}-{container}-{tag}-pull'
184
185 - project:
186     name: 'functest-kubernetes-opnfv-functest-kubernetes-security-pull'
187     <<: *functest-kubernetes-params
188     container: 'functest-kubernetes-security'
189     jobs:
190       - 'functest-kubernetes-{repo}-{container}-{tag}-pull'
191
192 - project:
193     name: 'functest-kubernetes-opnfv-functest-kubernetes-benchmarking-pull'
194     <<: *functest-kubernetes-params
195     container: 'functest-kubernetes-benchmarking'
196     jobs:
197       - 'functest-kubernetes-{repo}-{container}-{tag}-pull'
198
199 - project:
200     name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf-pull'
201     <<: *functest-kubernetes-params
202     container: 'functest-kubernetes-cnf'
203     jobs:
204       - 'functest-kubernetes-{repo}-{container}-{tag}-pull'
205
206 - job-template:
207     name: 'functest-kubernetes-{repo}-{container}-{tag}-rmi'
208     parameters:
209       - functest-kubernetes-node:
210           node: '{node}'
211     builders:
212       - functest-kubernetes-remove-images:
213           <<: *functest-kubernetes-containers
214
215 - project:
216     name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-rmi'
217     <<: *functest-kubernetes-params
218     container: 'functest-kubernetes-healthcheck'
219     jobs:
220       - 'functest-kubernetes-{repo}-{container}-{tag}-rmi'
221
222 - project:
223     name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-rmi'
224     <<: *functest-kubernetes-params
225     container: 'functest-kubernetes-smoke'
226     jobs:
227       - 'functest-kubernetes-{repo}-{container}-{tag}-rmi'
228
229 - project:
230     name: 'functest-kubernetes-opnfv-functest-kubernetes-security-rmi'
231     <<: *functest-kubernetes-params
232     container: 'functest-kubernetes-security'
233     jobs:
234       - 'functest-kubernetes-{repo}-{container}-{tag}-rmi'
235
236 - project:
237     name: 'functest-kubernetes-opnfv-functest-kubernetes-benchmarking-rmi'
238     <<: *functest-kubernetes-params
239     container: 'functest-kubernetes-benchmarking'
240     jobs:
241       - 'functest-kubernetes-{repo}-{container}-{tag}-rmi'
242
243 - project:
244     name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf-rmi'
245     <<: *functest-kubernetes-params
246     container: 'functest-kubernetes-cnf'
247     jobs:
248       - 'functest-kubernetes-{repo}-{container}-{tag}-rmi'
249
250 - job-template:
251     name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-{test}-run'
252     parameters:
253       - functest-kubernetes-node:
254           node: '{node}'
255       - functest-kubernetes-build_tag:
256           build_tag: ''
257       - functest-kubernetes-DEPLOY_SCENARIO:
258           DEPLOY_SCENARIO: k8-nosdn-nofeature-noha
259     builders:
260       - functest-kubernetes-run-containers:
261           <<: *functest-kubernetes-run-containers
262
263 - project:
264     name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck'
265     <<: *functest-kubernetes-params
266     volumes:
267       - /home/opnfv/functest-kubernetes/config.{tag}:/root/.kube/config
268       - /home/opnfv/functest-kubernetes/config.{tag}:/home/xtesting/.kube/config
269     env:
270       - DEPLOY_SCENARIO=$DEPLOY_SCENARIO
271     published_ports:
272     container: 'functest-kubernetes-healthcheck'
273     test:
274       - k8s_quick
275       - k8s_smoke
276     privileged: 'false'
277     network: bridge
278     uid: 1000
279     gid: 1000
280     jobs:
281       - 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-{test}-run'
282
283 - job-template:
284     name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-{test}-run'
285     parameters:
286       - functest-kubernetes-node:
287           node: '{node}'
288       - functest-kubernetes-build_tag:
289           build_tag: ''
290       - functest-kubernetes-DEPLOY_SCENARIO:
291           DEPLOY_SCENARIO: k8-nosdn-nofeature-noha
292     builders:
293       - functest-kubernetes-run-containers:
294           <<: *functest-kubernetes-run-containers
295
296 - project:
297     name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke'
298     <<: *functest-kubernetes-params
299     volumes:
300       - /home/opnfv/functest-kubernetes/config.{tag}:/root/.kube/config
301       - /home/opnfv/functest-kubernetes/config.{tag}:/home/xtesting/.kube/config
302     env:
303       - DEPLOY_SCENARIO=$DEPLOY_SCENARIO
304     published_ports:
305     container: 'functest-kubernetes-smoke'
306     test:
307       - xrally_kubernetes
308       - k8s_conformance
309       - k8s_conformance_serial
310       - sig_api_machinery
311       - sig_api_machinery_serial
312       - sig_apps
313       - sig_apps_serial
314       - sig_auth
315       - sig_cluster_lifecycle
316       - sig_instrumentation
317       - sig_network
318       - sig_node
319       - sig_scheduling_serial
320       - sig_storage
321       - sig_storage_serial
322     privileged: 'false'
323     network: bridge
324     uid: 1000
325     gid: 1000
326     jobs:
327       - 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-{test}-run'
328
329 - job-template:
330     name: 'functest-kubernetes-opnfv-functest-kubernetes-security-{tag}-{test}-run'
331     parameters:
332       - functest-kubernetes-node:
333           node: '{node}'
334       - functest-kubernetes-build_tag:
335           build_tag: ''
336       - functest-kubernetes-DEPLOY_SCENARIO:
337           DEPLOY_SCENARIO: k8-nosdn-nofeature-noha
338     builders:
339       - functest-kubernetes-run-containers:
340           <<: *functest-kubernetes-run-containers
341
342 - project:
343     name: 'functest-kubernetes-opnfv-functest-kubernetes-security'
344     <<: *functest-kubernetes-params
345     volumes:
346       - /home/opnfv/functest-kubernetes/config.{tag}:/root/.kube/config
347       - /home/opnfv/functest-kubernetes/config.{tag}:/home/xtesting/.kube/config
348     env:
349       - DEPLOY_SCENARIO=$DEPLOY_SCENARIO
350     published_ports:
351     container: 'functest-kubernetes-security'
352     test:
353       - kube_hunter
354       - kube_bench_master
355       - kube_bench_node
356     privileged: 'false'
357     network: bridge
358     uid: 1000
359     gid: 1000
360     jobs:
361       - 'functest-kubernetes-opnfv-functest-kubernetes-security-{tag}-{test}-run'
362
363 - job-template:
364     name: 'functest-kubernetes-opnfv-functest-kubernetes-benchmarking-{tag}-{test}-run'
365     parameters:
366       - functest-kubernetes-node:
367           node: '{node}'
368       - functest-kubernetes-build_tag:
369           build_tag: ''
370       - functest-kubernetes-DEPLOY_SCENARIO:
371           DEPLOY_SCENARIO: k8-nosdn-nofeature-noha
372     builders:
373       - functest-kubernetes-run-containers:
374           <<: *functest-kubernetes-run-containers
375
376 - project:
377     name: 'functest-kubernetes-opnfv-functest-kubernetes-benchmarking'
378     <<: *functest-kubernetes-params
379     volumes:
380       - /home/opnfv/functest-kubernetes/config.{tag}:/root/.kube/config
381       - /home/opnfv/functest-kubernetes/config.{tag}:/home/xtesting/.kube/config
382     env:
383       - DEPLOY_SCENARIO=$DEPLOY_SCENARIO
384     published_ports:
385     container: 'functest-kubernetes-benchmarking'
386     test:
387       - xrally_kubernetes_full
388       - netperf
389     privileged: 'false'
390     network: bridge
391     uid: 1000
392     gid: 1000
393     jobs:
394       - 'functest-kubernetes-opnfv-functest-kubernetes-benchmarking-{tag}-{test}-run'
395
396 - job-template:
397     name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf-{tag}-{test}-run'
398     parameters:
399       - functest-kubernetes-node:
400           node: '{node}'
401       - functest-kubernetes-build_tag:
402           build_tag: ''
403       - functest-kubernetes-DEPLOY_SCENARIO:
404           DEPLOY_SCENARIO: k8-nosdn-nofeature-noha
405     builders:
406       - functest-kubernetes-run-containers:
407           <<: *functest-kubernetes-run-containers
408
409 - project:
410     name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf'
411     <<: *functest-kubernetes-params
412     volumes:
413       - /home/opnfv/functest-kubernetes/config.{tag}:/root/.kube/config
414       - /home/opnfv/functest-kubernetes/config.{tag}:/home/xtesting/.kube/config
415     env:
416       - DEPLOY_SCENARIO=$DEPLOY_SCENARIO
417     published_ports:
418     container: 'functest-kubernetes-cnf'
419     test:
420       - k8s_vims
421       - helm_vims
422       - cnf_testsuite
423     privileged: 'false'
424     network: bridge
425     uid: 1000
426     gid: 1000
427     jobs:
428       - 'functest-kubernetes-opnfv-functest-kubernetes-cnf-{tag}-{test}-run'
429
430 - builder:
431     name: functest-kubernetes-zip
432     builders:
433       - shell: |
434           set +x
435           volumes=;
436           if [ "{volumes}" != "None" ]; then
437             for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
438               do volumes="-v $i $volumes"; done
439           fi
440           env=;
441           if [ "{env}" != "None" ]; then
442             for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
443               do env="-e $i $env"; done
444           fi
445           published_ports=;
446           if [ "{published_ports}" != "None" ]; then
447             for i in $(echo {published_ports} | tr -d '[]' |sed "s/, / /g" ); \
448               do published_ports="-p $i $published_ports"; done
449           fi
450           [ ! -z "$WORKSPACE" ] && rm -rf $WORKSPACE/results || true
451           if [ "{repo}" = "_" ]; then
452             image={container}:{tag}
453           elif [ "{port}" = "None" ]; then
454             image={repo}/{container}:{tag}
455           else
456             image={repo}:{port}/{container}:{tag}
457           fi
458           mkdir -p $WORKSPACE/results
459           chown {uid}:{gid} $WORKSPACE/results
460           docker run --rm \
461             $volumes \
462             $env \
463             $published_ports \
464             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
465             -e S3_DST_URL=s3://artifacts.opnfv.org/functest-kubernetes \
466             -e HTTP_DST_URL=http://artifacts.opnfv.org/functest-kubernetes \
467             -v /home/opnfv/functest-kubernetes/.boto:/etc/boto.cfg \
468             -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
469             -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
470             -e BUILD_TAG=$BUILD_TAG \
471             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
472             $image zip_campaign
473
474 - job-template:
475     name: 'functest-kubernetes-{tag}-zip'
476     parameters:
477       - functest-kubernetes-node:
478           node: '{node}'
479       - functest-kubernetes-build_tag:
480           build_tag: ''
481       - functest-kubernetes-DEPLOY_SCENARIO:
482           DEPLOY_SCENARIO: k8-nosdn-nofeature-noha
483     builders:
484       - functest-kubernetes-zip:
485           <<: *functest-kubernetes-containers
486           volumes: '{volumes}'
487           env: '{env}'
488           uid: '{uid}'
489           gid: '{gid}'
490           published_ports: '{published_ports}'
491
492 - project:
493     name: 'functest-kubernetes-{tag}-zip'
494     <<: *functest-kubernetes-params
495     volumes:
496       - /home/opnfv/functest-kubernetes/config.{tag}:/root/.kube/config
497       - /home/opnfv/functest-kubernetes/config.{tag}:/home/xtesting/.kube/config
498     env:
499       - DEPLOY_SCENARIO=$DEPLOY_SCENARIO
500     published_ports:
501     container: 'functest-kubernetes-healthcheck'
502     uid: 1000
503     gid: 1000
504     jobs:
505       - 'functest-kubernetes-{tag}-zip'
506
507 - job-template:
508     name: 'functest-kubernetes-{tag}-daily'
509     project-type: multijob
510     triggers:
511       - timed: '@weekly'
512     parameters:
513       - functest-kubernetes-node:
514           node: '{node}'
515       - functest-kubernetes-build_tag:
516           build_tag: ''
517       - functest-kubernetes-DEPLOY_SCENARIO:
518           DEPLOY_SCENARIO: k8-nosdn-nofeature-noha
519     # PyYAML and yamllint differ here
520     # see https://github.com/yaml/pyyaml/issues/234
521     # yamllint disable rule:indentation
522     properties:
523       - build-blocker:
524           blocking-jobs:
525           - ^functest-kubernetes-(pi-)*.*-(daily|review)$
526           - ^functest-kubernetes-(pi-)*{tag}-docker$
527     # yamllint enable rule:indentation
528     builders:
529       - multijob:
530           name: remove former images
531           projects:
532             - name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-rmi'
533               <<: *functest-kubernetes-jobs
534             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-rmi'
535               <<: *functest-kubernetes-jobs
536             - name: 'functest-kubernetes-opnfv-functest-kubernetes-security-{tag}-rmi'
537               <<: *functest-kubernetes-jobs
538             - name: 'functest-kubernetes-opnfv-functest-kubernetes-benchmarking-{tag}-rmi'
539               <<: *functest-kubernetes-jobs
540             - name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf-{tag}-rmi'
541               <<: *functest-kubernetes-jobs
542       - multijob:
543           name: pull containers
544           projects:
545             - name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-pull'
546               <<: *functest-kubernetes-jobs
547             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-pull'
548               <<: *functest-kubernetes-jobs
549             - name: 'functest-kubernetes-opnfv-functest-kubernetes-security-{tag}-pull'
550               <<: *functest-kubernetes-jobs
551             - name: 'functest-kubernetes-opnfv-functest-kubernetes-benchmarking-{tag}-pull'
552               <<: *functest-kubernetes-jobs
553             - name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf-{tag}-pull'
554               <<: *functest-kubernetes-jobs
555       - multijob:
556           name: opnfv/functest-kubernetes-healthcheck:{tag}
557           projects:
558             - name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-k8s_quick-run'
559               <<: *functest-kubernetes-jobs
560             - name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-k8s_smoke-run'
561               <<: *functest-kubernetes-jobs
562       - multijob:
563           name: opnfv/functest-kubernetes-smoke:{tag}
564           execution-type: SEQUENTIALLY
565           projects:
566             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-xrally_kubernetes-run'
567               <<: *functest-kubernetes-jobs
568             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-k8s_conformance-run'
569               <<: *functest-kubernetes-jobs
570             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-k8s_conformance_serial-run'
571               <<: *functest-kubernetes-jobs
572             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-sig_api_machinery-run'
573               <<: *functest-kubernetes-jobs
574             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-sig_api_machinery_serial-run'
575               <<: *functest-kubernetes-jobs
576             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-sig_apps-run'
577               <<: *functest-kubernetes-jobs
578             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-sig_apps_serial-run'
579               <<: *functest-kubernetes-jobs
580             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-sig_auth-run'
581               <<: *functest-kubernetes-jobs
582             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-sig_cluster_lifecycle-run'
583               <<: *functest-kubernetes-jobs
584             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-sig_instrumentation-run'
585               <<: *functest-kubernetes-jobs
586             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-sig_network-run'
587               <<: *functest-kubernetes-jobs
588             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-sig_node-run'
589               <<: *functest-kubernetes-jobs
590             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-sig_scheduling_serial-run'
591               <<: *functest-kubernetes-jobs
592             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-sig_storage-run'
593               <<: *functest-kubernetes-jobs
594             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-sig_storage_serial-run'
595               <<: *functest-kubernetes-jobs
596       - multijob:
597           name: opnfv/functest-kubernetes-security:{tag}
598           projects:
599             - name: 'functest-kubernetes-opnfv-functest-kubernetes-security-{tag}-kube_hunter-run'
600               <<: *functest-kubernetes-jobs
601             - name: 'functest-kubernetes-opnfv-functest-kubernetes-security-{tag}-kube_bench_master-run'
602               <<: *functest-kubernetes-jobs
603             - name: 'functest-kubernetes-opnfv-functest-kubernetes-security-{tag}-kube_bench_node-run'
604               <<: *functest-kubernetes-jobs
605       - multijob:
606           name: opnfv/functest-kubernetes-benchmarking:{tag}
607           projects:
608             - name: 'functest-kubernetes-opnfv-functest-kubernetes-benchmarking-{tag}-xrally_kubernetes_full-run'
609               <<: *functest-kubernetes-jobs
610             - name: 'functest-kubernetes-opnfv-functest-kubernetes-benchmarking-{tag}-netperf-run'
611               <<: *functest-kubernetes-jobs
612       - multijob:
613           name: opnfv/functest-kubernetes-cnf:{tag}
614           projects:
615             - name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf-{tag}-k8s_vims-run'
616               <<: *functest-kubernetes-jobs
617             - name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf-{tag}-helm_vims-run'
618               <<: *functest-kubernetes-jobs
619             - name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf-{tag}-cnf_testsuite-run'
620               <<: *functest-kubernetes-jobs
621       - multijob:
622           name: dump all campaign data
623           projects:
624             - name: 'functest-kubernetes-{tag}-zip'
625               <<: *functest-kubernetes-jobs
626     publishers:
627       - email-ext:
628           failure: false
629           first-failure: true
630           fixed: true
631           recipients: cedric.ollivier@orange.com
632
633 - project:
634     name: 'functest-kubernetes-daily'
635     <<: *functest-kubernetes-params
636     jobs:
637       - 'functest-kubernetes-{tag}-daily'
638
639 - view:
640     name: functest-kubernetes
641     view-type: list
642     columns:
643       - status
644       - weather
645       - job
646       - last-success
647       - last-failure
648       - last-duration
649     regex: ^functest-kubernetes-[a-z0-9.]+-daily$
650
651 - functest-kubernetes-build-containers: &functest-kubernetes-build-containers
652     name: 'functest-kubernetes-build-containers'
653     <<: *functest-kubernetes-containers
654     ref_arg: '{ref_arg}'
655     path: '{path}'
656     build_args: '{build_args}'
657     from: '{from}'
658
659 - builder:
660     name: functest-kubernetes-build-containers
661     builders:
662       - shell: |
663           set +x
664           if [ "{repo}" = "_" ]; then
665             image={container}:{tag}
666           elif [ "{port}" = "None" ]; then
667             image={repo}/{container}:{tag}
668           else
669             image={repo}:{port}/{container}:{tag}
670           fi
671           build_args=""
672           if [ "{build_args}" != "None" ]; then
673             for i in $(echo {build_args} | tr -d '[]' |sed "s/, / /g" ); \
674               do build_args="--build-arg $i $build_args"; done
675           fi
676           if [ "{ref_arg}" != "None" ]; then
677             build_args="$build_args --build-arg {ref_arg}={ref}"
678           fi
679           cd {path}
680           if [ "{from}" != "None" ]; then
681               sed -i {from} Dockerfile
682           fi
683           docker build $build_args \
684             --pull=false --no-cache --force-rm=true \
685             -t $image .
686
687 - scm:
688     name: functest-kubernetes-scm
689     scm:
690       - git:
691           url: 'https://gerrit.opnfv.org/gerrit/functest-kubernetes'
692           refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
693           branches:
694             - '{ref}'
695
696 - functest-kubernetes-dep: &functest-kubernetes-dep
697     name: 'functest-kubernetes-containers'
698     repo: '{repo}'
699     port: '{port}'
700     tag: '{tag}'
701     dependency: '{dependency}'
702
703 - builder:
704     name: functest-kubernetes-pull-dep-images
705     builders:
706       - shell: |
707           set +x
708           if [ "_" = "_" ]; then
709             image=alpine:{dependency}
710           elif [ "None" = "None" ]; then
711             image=_/alpine:{dependency}
712           else
713             image=_:/alpine:{dependency}
714           fi
715           docker pull $image || true
716
717 - builder:
718     name: functest-kubernetes-remove-dep-images
719     builders:
720       - shell: |
721           set +x
722           if [ "_" = "_" ]; then
723             image=alpine:{dependency}
724           elif [ "" = "None" ]; then
725             image=_/alpine:{dependency}
726           else
727             image=_:/alpine:{dependency}
728           fi
729           docker rmi $image || true
730
731 - job-template:
732     name: 'functest-kubernetes-{repo}-{tag}-dep-pull'
733     parameters:
734       - functest-kubernetes-node:
735           node: '{node}'
736     builders:
737       - functest-kubernetes-pull-dep-images:
738           <<: *functest-kubernetes-dep
739
740 - project:
741     name: 'functest-kubernetes-{repo}-{tag}-dep-pull'
742     <<: *functest-kubernetes-params
743     jobs:
744       - 'functest-kubernetes-{repo}-{tag}-dep-pull'
745
746 - job-template:
747     name: 'functest-kubernetes-{repo}-{tag}-dep-rmi'
748     parameters:
749       - functest-kubernetes-node:
750           node: '{node}'
751     builders:
752       - functest-kubernetes-remove-dep-images:
753           <<: *functest-kubernetes-dep
754
755 - project:
756     name: 'functest-kubernetes-{repo}-{tag}-dep-rmi'
757     <<: *functest-kubernetes-params
758     jobs:
759       - 'functest-kubernetes-{repo}-{tag}-dep-rmi'
760
761 - builder:
762     name: functest-kubernetes-tox
763     builders:
764       - shell: |
765           set +x
766           apt-get -o DPkg::Lock::Timeout=300 update && \
767           DEBIAN_FRONTEND=noninteractive apt-get \
768             -o DPkg::Lock::Timeout=300 dist-upgrade -y
769           DEBIAN_FRONTEND=noninteractive \
770           apt-get -o DPkg::Lock::Timeout=300 install software-properties-common gpg -y
771           add-apt-repository -y ppa:deadsnakes/ppa
772           apt-get -o DPkg::Lock::Timeout=300 update && \
773           DEBIAN_FRONTEND=noninteractive apt-get \
774             -o DPkg::Lock::Timeout=300 install \
775             libxml2-dev libxslt-dev libffi-dev libjpeg-dev \
776             python3.10 python3.10-dev python3.10-distutils \
777             python3.9 python3.9-dev python3.9-distutils \
778             python3.8 python3.8-dev python3.8-distutils \
779             python3-pip enchant-2 -y
780           pip3 install tox tox-pip-version
781
782           tox
783
784 - job-template:
785     name: 'functest-kubernetes-{tag}-tox'
786     scm:
787       - functest-kubernetes-scm:
788           ref: $GERRIT_REFSPEC
789     triggers:
790       - functest-kubernetes-patchset-created:
791           branch: '{branch}'
792     parameters:
793       - functest-kubernetes-node:
794           node: '{node}'
795     builders:
796       - functest-kubernetes-tox:
797
798 - project:
799     name: functest-kubernetes-tox
800     <<: *functest-kubernetes-params
801     jobs:
802       - 'functest-kubernetes-{tag}-tox'
803
804 - job-template:
805     name: 'functest-kubernetes-{repo}-{container}-{tag}-gate'
806     parameters:
807       - functest-kubernetes-node:
808           node: '{node}'
809     scm:
810       - functest-kubernetes-scm:
811           ref: $GERRIT_REFSPEC
812     builders:
813       - functest-kubernetes-build-containers:
814           <<: *functest-kubernetes-build-containers
815           ref: $GERRIT_REFSPEC
816           build_args: '{build_args}'
817
818 - project:
819     name: functest-kubernetes-opnfv-functest-kubernetes-core-{tag}-gate
820     <<: *functest-kubernetes-params
821     container: functest-kubernetes-core
822     ref_arg: BRANCH
823     path: docker/core
824     jobs:
825       - 'functest-kubernetes-{repo}-{container}-{tag}-gate'
826
827 - project:
828     name: functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-gate
829     <<: *functest-kubernetes-params
830     container: functest-kubernetes-healthcheck
831     ref_arg:
832     path: docker/healthcheck
833     jobs:
834       - 'functest-kubernetes-{repo}-{container}-{tag}-gate'
835
836 - project:
837     name: functest-kubernetes-opnfv-functest-kubernetes-cnf-{tag}-gate
838     <<: *functest-kubernetes-params
839     container: functest-kubernetes-cnf
840     ref_arg: BRANCH
841     path: docker/cnf
842     jobs:
843       - 'functest-kubernetes-{repo}-{container}-{tag}-gate'
844
845 - project:
846     name: functest-kubernetes-opnfv-functest-kubernetes-security-{tag}-gate
847     <<: *functest-kubernetes-params
848     container: functest-kubernetes-security
849     ref_arg: BRANCH
850     path: docker/security
851     jobs:
852       - 'functest-kubernetes-{repo}-{container}-{tag}-gate'
853
854 - project:
855     name: functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-gate
856     <<: *functest-kubernetes-params
857     container: functest-kubernetes-smoke
858     ref_arg:
859     path: docker/smoke
860     jobs:
861       - 'functest-kubernetes-{repo}-{container}-{tag}-gate'
862
863 - project:
864     name: functest-kubernetes-opnfv-functest-kubernetes-benchmarking-{tag}-gate
865     <<: *functest-kubernetes-params
866     container: functest-kubernetes-benchmarking
867     ref_arg:
868     path: docker/benchmarking
869     jobs:
870       - 'functest-kubernetes-{repo}-{container}-{tag}-gate'
871
872 - trigger:
873     name: functest-kubernetes-patchset-created
874     triggers:
875       - gerrit:
876           trigger-on:
877             - patchset-created-event
878             - comment-added-contains-event:
879                 comment-contains-value: 'recheck'
880             - comment-added-contains-event:
881                 comment-contains-value: 'reverify'
882           projects:
883             - project-compare-type: 'ANT'
884               project-pattern: 'functest-kubernetes'
885               branches:
886                 - branch-compare-type: 'ANT'
887                   branch-pattern: '**/{branch}'
888
889 - job-template:
890     name: 'functest-kubernetes-{tag}-review'
891     project-type: multijob
892     triggers:
893       - functest-kubernetes-patchset-created:
894           branch: '{branch}'
895     parameters:
896       - functest-kubernetes-node:
897           node: '{node}'
898       - functest-kubernetes-build_tag:
899           build_tag: ''
900       - functest-kubernetes-DEPLOY_SCENARIO:
901           DEPLOY_SCENARIO: k8-nosdn-nofeature-noha
902     # PyYAML and yamllint differ here
903     # see https://github.com/yaml/pyyaml/issues/234
904     # yamllint disable rule:indentation
905     properties:
906       - build-blocker:
907           blocking-jobs:
908           - ^functest-kubernetes-(pi-)*.*-(daily|review)$
909           - ^functest-kubernetes-(pi-)*{tag}-docker$
910     # yamllint enable rule:indentation
911     builders:
912       - multijob:
913           name: remove former images
914           projects:
915             - name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-rmi'
916               <<: *functest-kubernetes-jobs
917             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-rmi'
918               <<: *functest-kubernetes-jobs
919             - name: 'functest-kubernetes-opnfv-functest-kubernetes-security-{tag}-rmi'
920               <<: *functest-kubernetes-jobs
921             - name: 'functest-kubernetes-opnfv-functest-kubernetes-benchmarking-{tag}-rmi'
922               <<: *functest-kubernetes-jobs
923             - name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf-{tag}-rmi'
924               <<: *functest-kubernetes-jobs
925       - multijob:
926           name: remove dependency
927           projects:
928             - name: 'functest-kubernetes-{repo}-{tag}-dep-rmi'
929               <<: *functest-kubernetes-jobs
930       - multijob:
931           name: pull dependency
932           projects:
933             - name: 'functest-kubernetes-{repo}-{tag}-dep-pull'
934               <<: *functest-kubernetes-jobs
935       - multijob:
936           name: build opnfv/functest-kubernetes-core
937           projects:
938             - name: 'functest-kubernetes-opnfv-functest-kubernetes-core-{tag}-gate'
939               <<: *functest-kubernetes-jobs
940       - multijob:
941           name: build containers
942           projects:
943             - name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-gate'
944               <<: *functest-kubernetes-jobs
945             - name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf-{tag}-gate'
946               <<: *functest-kubernetes-jobs
947             - name: 'functest-kubernetes-opnfv-functest-kubernetes-security-{tag}-gate'
948               <<: *functest-kubernetes-jobs
949       - multijob:
950           name: build opnfv/functest-kubernetes-smoke
951           projects:
952             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-gate'
953               <<: *functest-kubernetes-jobs
954       - multijob:
955           name: build opnfv/functest-kubernetes-benchmarking
956           projects:
957             - name: 'functest-kubernetes-opnfv-functest-kubernetes-benchmarking-{tag}-gate'
958               <<: *functest-kubernetes-jobs
959       - multijob:
960           name: opnfv/functest-kubernetes-healthcheck:{tag}
961           projects:
962             - name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-k8s_quick-run'
963               <<: *functest-kubernetes-jobs
964             - name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-k8s_smoke-run'
965               <<: *functest-kubernetes-jobs
966       - multijob:
967           name: opnfv/functest-kubernetes-smoke:{tag}
968           execution-type: SEQUENTIALLY
969           projects:
970             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-xrally_kubernetes-run'
971               <<: *functest-kubernetes-jobs
972             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-k8s_conformance-run'
973               <<: *functest-kubernetes-jobs
974             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-k8s_conformance_serial-run'
975               <<: *functest-kubernetes-jobs
976             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-sig_api_machinery-run'
977               <<: *functest-kubernetes-jobs
978             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-sig_api_machinery_serial-run'
979               <<: *functest-kubernetes-jobs
980             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-sig_apps-run'
981               <<: *functest-kubernetes-jobs
982             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-sig_apps_serial-run'
983               <<: *functest-kubernetes-jobs
984             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-sig_auth-run'
985               <<: *functest-kubernetes-jobs
986             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-sig_cluster_lifecycle-run'
987               <<: *functest-kubernetes-jobs
988             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-sig_instrumentation-run'
989               <<: *functest-kubernetes-jobs
990             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-sig_network-run'
991               <<: *functest-kubernetes-jobs
992             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-sig_node-run'
993               <<: *functest-kubernetes-jobs
994             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-sig_scheduling_serial-run'
995               <<: *functest-kubernetes-jobs
996             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-sig_storage-run'
997               <<: *functest-kubernetes-jobs
998             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-sig_storage_serial-run'
999               <<: *functest-kubernetes-jobs
1000       - multijob:
1001           name: opnfv/functest-kubernetes-security:{tag}
1002           projects:
1003             - name: 'functest-kubernetes-opnfv-functest-kubernetes-security-{tag}-kube_hunter-run'
1004               <<: *functest-kubernetes-jobs
1005             - name: 'functest-kubernetes-opnfv-functest-kubernetes-security-{tag}-kube_bench_master-run'
1006               <<: *functest-kubernetes-jobs
1007             - name: 'functest-kubernetes-opnfv-functest-kubernetes-security-{tag}-kube_bench_node-run'
1008               <<: *functest-kubernetes-jobs
1009       - multijob:
1010           name: opnfv/functest-kubernetes-benchmarking:{tag}
1011           projects:
1012             - name: 'functest-kubernetes-opnfv-functest-kubernetes-benchmarking-{tag}-xrally_kubernetes_full-run'
1013               <<: *functest-kubernetes-jobs
1014             - name: 'functest-kubernetes-opnfv-functest-kubernetes-benchmarking-{tag}-netperf-run'
1015               <<: *functest-kubernetes-jobs
1016       - multijob:
1017           name: opnfv/functest-kubernetes-cnf:{tag}
1018           projects:
1019             - name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf-{tag}-k8s_vims-run'
1020               <<: *functest-kubernetes-jobs
1021             - name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf-{tag}-helm_vims-run'
1022               <<: *functest-kubernetes-jobs
1023             - name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf-{tag}-cnf_testsuite-run'
1024               <<: *functest-kubernetes-jobs
1025     publishers:
1026       - email-ext:
1027           failure: false
1028           first-failure: true
1029           fixed: true
1030           recipients: cedric.ollivier@orange.com
1031
1032 - project:
1033     name: 'functest-kubernetes-review'
1034     <<: *functest-kubernetes-params
1035     jobs:
1036       - 'functest-kubernetes-{tag}-review'
1037
1038 - view:
1039     name: functest-kubernetes-review
1040     view-type: list
1041     columns:
1042       - status
1043       - weather
1044       - job
1045       - last-success
1046       - last-failure
1047       - last-duration
1048     regex: ^functest-kubernetes-[a-z0-9.]+-review$
1049
1050 - view:
1051     name: functest-kubernetes-tox
1052     view-type: list
1053     columns:
1054       - status
1055       - weather
1056       - job
1057       - last-success
1058       - last-failure
1059       - last-duration
1060     regex: ^functest-kubernetes-[a-z0-9.]+-tox$
1061
1062 - builder:
1063     name: functest-kubernetes-push-containers
1064     builders:
1065       - shell: |
1066           set +x
1067           if [ "{repo}" = "_" ]; then
1068             image={container}:{tag}
1069           elif [ "{port}" = "None" ]; then
1070             image={repo}/{container}:{tag}
1071           else
1072             image={repo}:{port}/{container}:{tag}
1073           fi
1074           docker push $image
1075
1076 - trigger:
1077     name: functest-kubernetes-commit
1078     triggers:
1079       - pollscm:
1080           cron: "*/30 * * * *"
1081
1082 - job-template:
1083     name: 'functest-kubernetes-{repo}-{container}-{tag}-build'
1084     parameters:
1085       - functest-kubernetes-node:
1086           node: '{node}'
1087     scm:
1088       - functest-kubernetes-scm:
1089           ref: '{branch}'
1090     builders:
1091       - functest-kubernetes-build-containers:
1092           <<: *functest-kubernetes-build-containers
1093           ref: '{branch}'
1094           build_args: '{build_args}'
1095       - functest-kubernetes-push-containers:
1096           <<: *functest-kubernetes-build-containers
1097           ref: '{branch}'
1098
1099 - project:
1100     name: functest-kubernetes-opnfv-functest-kubernetes-core-{tag}-build
1101     <<: *functest-kubernetes-params
1102     container: functest-kubernetes-core
1103     ref_arg: BRANCH
1104     path: docker/core
1105     jobs:
1106       - 'functest-kubernetes-{repo}-{container}-{tag}-build'
1107
1108 - project:
1109     name: functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-build
1110     <<: *functest-kubernetes-params
1111     container: functest-kubernetes-healthcheck
1112     ref_arg:
1113     path: docker/healthcheck
1114     jobs:
1115       - 'functest-kubernetes-{repo}-{container}-{tag}-build'
1116
1117 - project:
1118     name: functest-kubernetes-opnfv-functest-kubernetes-cnf-{tag}-build
1119     <<: *functest-kubernetes-params
1120     container: functest-kubernetes-cnf
1121     ref_arg: BRANCH
1122     path: docker/cnf
1123     jobs:
1124       - 'functest-kubernetes-{repo}-{container}-{tag}-build'
1125
1126 - project:
1127     name: functest-kubernetes-opnfv-functest-kubernetes-security-{tag}-build
1128     <<: *functest-kubernetes-params
1129     container: functest-kubernetes-security
1130     ref_arg: BRANCH
1131     path: docker/security
1132     jobs:
1133       - 'functest-kubernetes-{repo}-{container}-{tag}-build'
1134
1135 - project:
1136     name: functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-build
1137     <<: *functest-kubernetes-params
1138     container: functest-kubernetes-smoke
1139     ref_arg:
1140     path: docker/smoke
1141     jobs:
1142       - 'functest-kubernetes-{repo}-{container}-{tag}-build'
1143
1144 - project:
1145     name: functest-kubernetes-opnfv-functest-kubernetes-benchmarking-{tag}-build
1146     <<: *functest-kubernetes-params
1147     container: functest-kubernetes-benchmarking
1148     ref_arg:
1149     path: docker/benchmarking
1150     jobs:
1151       - 'functest-kubernetes-{repo}-{container}-{tag}-build'
1152
1153 - job-template:
1154     name: 'functest-kubernetes-{tag}-docker'
1155     project-type: multijob
1156     triggers:
1157       - functest-kubernetes-commit
1158     scm:
1159       - functest-kubernetes-scm:
1160           ref: '{branch}'
1161     parameters:
1162       - functest-kubernetes-node:
1163           node: '{node}'
1164     # PyYAML and yamllint differ here
1165     # see https://github.com/yaml/pyyaml/issues/234
1166     # yamllint disable rule:indentation
1167     properties:
1168       - build-blocker:
1169           blocking-jobs:
1170           - ^functest-kubernetes-(pi-)*{tag}-(daily|review)$
1171     # yamllint enable rule:indentation
1172     builders:
1173       - multijob:
1174           name: remove dependency
1175           projects:
1176             - name: 'functest-kubernetes-{repo}-{tag}-dep-rmi'
1177               <<: *functest-kubernetes-jobs
1178       - multijob:
1179           name: pull dependency
1180           projects:
1181             - name: 'functest-kubernetes-{repo}-{tag}-dep-pull'
1182               <<: *functest-kubernetes-jobs
1183       - multijob:
1184           name: build opnfv/functest-kubernetes-core
1185           projects:
1186             - name: 'functest-kubernetes-opnfv-functest-kubernetes-core-{tag}-build'
1187               <<: *functest-kubernetes-jobs
1188       - multijob:
1189           name: build containers
1190           projects:
1191             - name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-build'
1192               <<: *functest-kubernetes-jobs
1193             - name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf-{tag}-build'
1194               <<: *functest-kubernetes-jobs
1195             - name: 'functest-kubernetes-opnfv-functest-kubernetes-security-{tag}-build'
1196               <<: *functest-kubernetes-jobs
1197       - multijob:
1198           name: build opnfv/functest-kubernetes-smoke
1199           projects:
1200             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-build'
1201               <<: *functest-kubernetes-jobs
1202       - multijob:
1203           name: build opnfv/functest-kubernetes-benchmarking
1204           projects:
1205             - name: 'functest-kubernetes-opnfv-functest-kubernetes-benchmarking-{tag}-build'
1206               <<: *functest-kubernetes-jobs
1207     publishers:
1208       - email-ext:
1209           failure: false
1210           first-failure: true
1211           fixed: true
1212           recipients: cedric.ollivier@orange.com
1213
1214 - builder:
1215     name: functest-kubernetes-trivy
1216     builders:
1217       - shell: |
1218           apt-get -o DPkg::Lock::Timeout=300 update && \
1219           DEBIAN_FRONTEND=noninteractive apt-get \
1220             -o DPkg::Lock::Timeout=300 install curl -y
1221
1222           curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b .
1223           if [ "{repo}" = "_" ]; then
1224             image={container}:{tag}
1225           elif [ "{port}" = "None" ]; then
1226             image={repo}/{container}:{tag}
1227           else
1228             image={repo}:{port}/{container}:{tag}
1229           fi
1230           ./trivy image --exit-code 1 $image
1231
1232 - job-template:
1233     name: 'functest-kubernetes-{repo}-{container}-{tag}-trivy'
1234     triggers:
1235       - timed: '@weekly'
1236     parameters:
1237       - functest-kubernetes-node:
1238           node: '{node}'
1239     builders:
1240       - functest-kubernetes-trivy:
1241           <<: *functest-kubernetes-containers
1242     publishers:
1243       - email-ext:
1244           failure: false
1245           first-failure: true
1246           fixed: true
1247           recipients: cedric.ollivier@orange.com
1248
1249 - project:
1250     name: 'functest-kubernetes-opnfv-functest-kubernetes-core-trivy'
1251     <<: *functest-kubernetes-params
1252     container: 'functest-kubernetes-core'
1253     jobs:
1254       - 'functest-kubernetes-{repo}-{container}-{tag}-trivy'
1255
1256 - project:
1257     name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-trivy'
1258     <<: *functest-kubernetes-params
1259     container: 'functest-kubernetes-healthcheck'
1260     jobs:
1261       - 'functest-kubernetes-{repo}-{container}-{tag}-trivy'
1262
1263 - project:
1264     name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf-trivy'
1265     <<: *functest-kubernetes-params
1266     container: 'functest-kubernetes-cnf'
1267     jobs:
1268       - 'functest-kubernetes-{repo}-{container}-{tag}-trivy'
1269
1270 - project:
1271     name: 'functest-kubernetes-opnfv-functest-kubernetes-security-trivy'
1272     <<: *functest-kubernetes-params
1273     container: 'functest-kubernetes-security'
1274     jobs:
1275       - 'functest-kubernetes-{repo}-{container}-{tag}-trivy'
1276
1277 - project:
1278     name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-trivy'
1279     <<: *functest-kubernetes-params
1280     container: 'functest-kubernetes-smoke'
1281     jobs:
1282       - 'functest-kubernetes-{repo}-{container}-{tag}-trivy'
1283
1284 - project:
1285     name: 'functest-kubernetes-opnfv-functest-kubernetes-benchmarking-trivy'
1286     <<: *functest-kubernetes-params
1287     container: 'functest-kubernetes-benchmarking'
1288     jobs:
1289       - 'functest-kubernetes-{repo}-{container}-{tag}-trivy'
1290
1291 - builder:
1292     name: functest-kubernetes-grype
1293     builders:
1294       - shell: |
1295           apt-get -o DPkg::Lock::Timeout=300 update && \
1296           DEBIAN_FRONTEND=noninteractive apt-get \
1297             -o DPkg::Lock::Timeout=300 install curl -y
1298
1299           curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sh -s -- -b .
1300           if [ "{repo}" = "_" ]; then
1301             image={container}:{tag}
1302           elif [ "{port}" = "None" ]; then
1303             image={repo}/{container}:{tag}
1304           else
1305             image={repo}:{port}/{container}:{tag}
1306           fi
1307           ./grype -q $image
1308
1309 - job-template:
1310     name: 'functest-kubernetes-{repo}-{container}-{tag}-grype'
1311     triggers:
1312       - timed: '@weekly'
1313     parameters:
1314       - functest-kubernetes-node:
1315           node: '{node}'
1316     builders:
1317       - functest-kubernetes-grype:
1318           <<: *functest-kubernetes-containers
1319     publishers:
1320       - email-ext:
1321           failure: false
1322           first-failure: true
1323           fixed: true
1324           recipients: cedric.ollivier@orange.com
1325
1326 - project:
1327     name: 'functest-kubernetes-opnfv-functest-kubernetes-core-grype'
1328     <<: *functest-kubernetes-params
1329     container: 'functest-kubernetes-core'
1330     jobs:
1331       - 'functest-kubernetes-{repo}-{container}-{tag}-grype'
1332
1333 - project:
1334     name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-grype'
1335     <<: *functest-kubernetes-params
1336     container: 'functest-kubernetes-healthcheck'
1337     jobs:
1338       - 'functest-kubernetes-{repo}-{container}-{tag}-grype'
1339
1340 - project:
1341     name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf-grype'
1342     <<: *functest-kubernetes-params
1343     container: 'functest-kubernetes-cnf'
1344     jobs:
1345       - 'functest-kubernetes-{repo}-{container}-{tag}-grype'
1346
1347 - project:
1348     name: 'functest-kubernetes-opnfv-functest-kubernetes-security-grype'
1349     <<: *functest-kubernetes-params
1350     container: 'functest-kubernetes-security'
1351     jobs:
1352       - 'functest-kubernetes-{repo}-{container}-{tag}-grype'
1353
1354 - project:
1355     name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-grype'
1356     <<: *functest-kubernetes-params
1357     container: 'functest-kubernetes-smoke'
1358     jobs:
1359       - 'functest-kubernetes-{repo}-{container}-{tag}-grype'
1360
1361 - project:
1362     name: 'functest-kubernetes-opnfv-functest-kubernetes-benchmarking-grype'
1363     <<: *functest-kubernetes-params
1364     container: 'functest-kubernetes-benchmarking'
1365     jobs:
1366       - 'functest-kubernetes-{repo}-{container}-{tag}-grype'
1367
1368 - builder:
1369     name: functest-kubernetes-sbom
1370     builders:
1371       - shell: |
1372           apt-get -o DPkg::Lock::Timeout=300 update && \
1373           DEBIAN_FRONTEND=noninteractive apt-get \
1374             -o DPkg::Lock::Timeout=300 install curl -y
1375
1376           mkdir -p ~/.docker
1377           curl -sSfL https://raw.githubusercontent.com/docker/sbom-cli-plugin/main/install.sh | sh -s --
1378           if [ "{repo}" = "_" ]; then
1379             image={container}:{tag}
1380           elif [ "{port}" = "None" ]; then
1381             image={repo}/{container}:{tag}
1382           else
1383             image={repo}:{port}/{container}:{tag}
1384           fi
1385           docker sbom $image
1386
1387 - job-template:
1388     name: 'functest-kubernetes-{repo}-{container}-{tag}-sbom'
1389     triggers:
1390       - timed: '@weekly'
1391     parameters:
1392       - functest-kubernetes-node:
1393           node: '{node}'
1394     builders:
1395       - functest-kubernetes-sbom:
1396           <<: *functest-kubernetes-containers
1397     publishers:
1398       - email-ext:
1399           failure: false
1400           first-failure: true
1401           fixed: true
1402           recipients: cedric.ollivier@orange.com
1403
1404 - project:
1405     name: 'functest-kubernetes-opnfv-functest-kubernetes-core-sbom'
1406     <<: *functest-kubernetes-params
1407     container: 'functest-kubernetes-core'
1408     jobs:
1409       - 'functest-kubernetes-{repo}-{container}-{tag}-sbom'
1410
1411 - project:
1412     name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-sbom'
1413     <<: *functest-kubernetes-params
1414     container: 'functest-kubernetes-healthcheck'
1415     jobs:
1416       - 'functest-kubernetes-{repo}-{container}-{tag}-sbom'
1417
1418 - project:
1419     name: 'functest-kubernetes-opnfv-functest-kubernetes-cnf-sbom'
1420     <<: *functest-kubernetes-params
1421     container: 'functest-kubernetes-cnf'
1422     jobs:
1423       - 'functest-kubernetes-{repo}-{container}-{tag}-sbom'
1424
1425 - project:
1426     name: 'functest-kubernetes-opnfv-functest-kubernetes-security-sbom'
1427     <<: *functest-kubernetes-params
1428     container: 'functest-kubernetes-security'
1429     jobs:
1430       - 'functest-kubernetes-{repo}-{container}-{tag}-sbom'
1431
1432 - project:
1433     name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-sbom'
1434     <<: *functest-kubernetes-params
1435     container: 'functest-kubernetes-smoke'
1436     jobs:
1437       - 'functest-kubernetes-{repo}-{container}-{tag}-sbom'
1438
1439 - project:
1440     name: 'functest-kubernetes-opnfv-functest-kubernetes-benchmarking-sbom'
1441     <<: *functest-kubernetes-params
1442     container: 'functest-kubernetes-benchmarking'
1443     jobs:
1444       - 'functest-kubernetes-{repo}-{container}-{tag}-sbom'
1445
1446 - project:
1447     name: 'functest-kubernetes'
1448     <<: *functest-kubernetes-params
1449     jobs:
1450       - 'functest-kubernetes-{tag}-docker'
1451
1452 - view:
1453     name: functest-kubernetes-docker
1454     view-type: list
1455     columns:
1456       - status
1457       - weather
1458       - job
1459       - last-success
1460       - last-failure
1461       - last-duration
1462     regex: ^functest-kubernetes-[a-z0-9.]+-docker$
1463
1464 - view:
1465     name: functest-kubernetes-trivy
1466     view-type: list
1467     columns:
1468       - status
1469       - weather
1470       - job
1471       - last-success
1472       - last-failure
1473       - last-duration
1474     regex: (?!functest-kubernetes-pi)(?!functest-kubernetes-ng)^functest-kubernetes-[a-z-0-9.]+-trivy$
1475
1476 - view:
1477     name: functest-kubernetes-grype
1478     view-type: list
1479     columns:
1480       - status
1481       - weather
1482       - job
1483       - last-success
1484       - last-failure
1485       - last-duration
1486     regex: (?!functest-kubernetes-pi)(?!functest-kubernetes-ng)^functest-kubernetes-[a-z-0-9.]+-grype$
1487
1488 - view:
1489     name: functest-kubernetes-sbom
1490     view-type: list
1491     columns:
1492       - status
1493       - weather
1494       - job
1495       - last-success
1496       - last-failure
1497       - last-duration
1498     regex: (?!functest-kubernetes-pi)(?!functest-kubernetes-ng)^functest-kubernetes-[a-z-0-9.]+-sbom$