VNFM with ETSI FEAT03 changes
[releng.git] / jjb / functest / functest-kubernetes.yaml
1 ---
2 - functest-kubernetes-jobs: &functest-kubernetes-jobs
3     name: 'functest-kubernetes-jobs'
4     current-parameters: true
5
6 - functest-kubernetes-params: &functest-kubernetes-params
7     name: 'functest-kubernetes-params'
8     repo: 'opnfv'
9     port:
10     tag:
11       - latest:
12           branch: master
13           slave: lf-virtual8
14       - jerma:
15           branch: stable/jerma
16           slave: lf-virtual8
17       - iruya:
18           branch: stable/iruya
19           slave: lf-virtual7
20       - hunter:
21           branch: stable/hunter
22           slave: lf-virtual5
23
24 - parameter:
25     name: functest-kubernetes-slave
26     parameters:
27       - label:
28           name: slave
29           default: '{slave}'
30
31 - parameter:
32     name: functest-kubernetes-branch
33     parameters:
34       - string:
35           name: branch
36           default: '{branch}'
37
38 - functest-kubernetes-containers: &functest-kubernetes-containers
39     name: 'functest-kubernetes-containers'
40     repo: '{repo}'
41     port: '{port}'
42     container: '{container}'
43     tag: '{tag}'
44
45 - functest-kubernetes-run-containers: &functest-kubernetes-run-containers
46     name: 'functest-kubernetes-build-containers'
47     <<: *functest-kubernetes-containers
48     test: '{test}'
49
50 - functest-kubernetes-build-containers: &functest-kubernetes-build-containers
51     name: 'functest-kubernetes-build-containers'
52     <<: *functest-kubernetes-containers
53     ref_arg: '{ref_arg}'
54     path: '{path}'
55
56 - builder:
57     name: functest-kubernetes-pull-containers
58     builders:
59       - shell: |
60           set +x
61           if [ "{repo}" = "_" ]; then
62             image={container}:{tag}
63           elif [ "{port}" = "None" ]; then
64             image={repo}/{container}:{tag}
65           else
66             image={repo}:{port}/{container}:{tag}
67           fi
68           docker pull $image
69
70 - builder:
71     name: functest-kubernetes-build-containers
72     builders:
73       - shell: |
74           set +x
75           if [ "{repo}" = "_" ]; then
76             image={container}:{tag}
77           elif [ "{port}" = "None" ]; then
78             image={repo}/{container}:{tag}
79           else
80             image={repo}:{port}/{container}:{tag}
81           fi
82           if [ "{ref_arg}" = "None" ]; then
83             build_arg=""
84           else
85             build_arg="--build-arg {ref_arg}={ref}"
86           fi
87           cd {path}
88           docker build $build_arg \
89             --pull=false --no-cache --force-rm=true \
90             -t $image .
91
92 - builder:
93     name: functest-kubernetes-run-containers
94     builders:
95       - shell: |
96           set +ex
97           [ ! -z "$WORKSPACE" ] && rm -rf $WORKSPACE/* || true
98           if [ "{repo}" = "_" ]; then
99             image={container}:{tag}
100           elif [ "{port}" = "None" ]; then
101             image={repo}/{container}:{tag}
102           else
103             image={repo}:{port}/{container}:{tag}
104           fi
105           docker run --rm \
106             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
107             -e S3_DST_URL=s3://artifacts.opnfv.org/functest-kubernetes/$JOB_NAME-$BUILD_ID \
108             -e HTTP_DST_URL=http://artifacts.opnfv.org/functest-kubernetes/$JOB_NAME-$BUILD_ID \
109             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
110             -e DEPLOY_SCENARIO=k8-nosdn-nofeature-noha \
111             -v /home/opnfv/functest-kubernetes/config.{tag}:/root/.kube/config \
112             -v /home/opnfv/functest-kubernetes/.boto:/root/.boto \
113             $image run_tests -t {test} -p
114
115 - builder:
116     name: functest-kubernetes-remove-images
117     builders:
118       - shell: |
119           set +x
120           if [ "{repo}" = "_" ]; then
121             image={container}:{tag}
122           elif [ "{port}" = "None" ]; then
123             image={repo}/{container}:{tag}
124           else
125             image={repo}:{port}/{container}:{tag}
126           fi
127           docker rmi $image || true
128
129 - scm:
130     name: functest-kubernetes-scm
131     scm:
132       - git:
133           url: https://gerrit.opnfv.org/gerrit/functest-kubernetes
134           refspec: '+refs/changes/*:refs/changes/*'
135           branches:
136             - '{ref}'
137
138 - job-template:
139     name: 'functest-kubernetes-{repo}-{container}-{tag}-pull'
140     parameters:
141       - functest-kubernetes-slave:
142           slave: '{slave}'
143     builders:
144       - functest-kubernetes-pull-containers:
145           <<: *functest-kubernetes-containers
146
147 - project:
148     name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-pull'
149     <<: *functest-kubernetes-params
150     container: 'functest-kubernetes-healthcheck'
151     jobs:
152       - 'functest-kubernetes-{repo}-{container}-{tag}-pull'
153
154 - project:
155     name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-pull'
156     <<: *functest-kubernetes-params
157     container: 'functest-kubernetes-smoke'
158     jobs:
159       - 'functest-kubernetes-{repo}-{container}-{tag}-pull'
160
161 - job-template:
162     name: 'functest-kubernetes-{repo}-{container}-{tag}-rmi'
163     parameters:
164       - functest-kubernetes-slave:
165           slave: '{slave}'
166     builders:
167       - functest-kubernetes-remove-images:
168           <<: *functest-kubernetes-containers
169
170 - project:
171     name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-rmi'
172     <<: *functest-kubernetes-params
173     container: 'functest-kubernetes-healthcheck'
174     jobs:
175       - 'functest-kubernetes-{repo}-{container}-{tag}-rmi'
176
177 - project:
178     name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-rmi'
179     <<: *functest-kubernetes-params
180     container: 'functest-kubernetes-smoke'
181     jobs:
182       - 'functest-kubernetes-{repo}-{container}-{tag}-rmi'
183
184 - job-template:
185     name: 'functest-kubernetes-{repo}-{container}-{tag}-{test}-run'
186     parameters:
187       - functest-kubernetes-slave:
188           slave: '{slave}'
189     builders:
190       - functest-kubernetes-run-containers:
191           <<: *functest-kubernetes-run-containers
192
193 - project:
194     name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck'
195     <<: *functest-kubernetes-params
196     container: 'functest-kubernetes-healthcheck'
197     test:
198       - k8s_smoke
199     jobs:
200       - 'functest-kubernetes-{repo}-{container}-{tag}-{test}-run'
201
202 - project:
203     name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke'
204     <<: *functest-kubernetes-params
205     container: 'functest-kubernetes-smoke'
206     test:
207       - xrally_kubernetes
208       - k8s_conformance
209     jobs:
210       - 'functest-kubernetes-{repo}-{container}-{tag}-{test}-run'
211     exclude:
212       - tag: iruya
213         test: xrally_kubernetes
214       - tag: hunter
215         test: xrally_kubernetes
216
217 - job-template:
218     name: 'functest-kubernetes-{tag}-daily'
219     project-type: multijob
220     triggers:
221       - timed: '@daily'
222     parameters:
223       - functest-kubernetes-slave:
224           slave: '{slave}'
225     properties:
226       - build-blocker:
227           use-build-blocker: true
228           blocking-level: 'NODE'
229           blocking-jobs:
230             - '^functest-kubernetes-{tag}-(daily|check|gate)$'
231     builders:
232       - multijob:
233           name: remove former images
234           projects:
235             - name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-rmi'
236               <<: *functest-kubernetes-jobs
237             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-rmi'
238               <<: *functest-kubernetes-jobs
239       - multijob:
240           name: pull containers
241           projects:
242             - name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-pull'
243               <<: *functest-kubernetes-jobs
244             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-pull'
245               <<: *functest-kubernetes-jobs
246       - multijob:
247           name: opnfv/functest-kubernetes-healthcheck:{tag}
248           projects:
249             - name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-k8s_smoke-run'
250               <<: *functest-kubernetes-jobs
251       - multijob:
252           name: opnfv/functest-kubernetes-smoke:{tag}
253           execution-type: SEQUENTIALLY
254           projects:
255             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-xrally_kubernetes-run'
256               <<: *functest-kubernetes-jobs
257             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-k8s_conformance-run'
258               <<: *functest-kubernetes-jobs
259
260 - job-template:
261     name: 'functest-kubernetes-{repo}-{container}-{tag}-gate'
262     parameters:
263       - functest-kubernetes-slave:
264           slave: '{slave}'
265     scm:
266       - functest-kubernetes-scm:
267           ref: $GERRIT_REFSPEC
268     builders:
269       - functest-kubernetes-build-containers:
270           <<: *functest-kubernetes-build-containers
271           ref: $GERRIT_REFSPEC
272
273 - job-template:
274     name: 'functest-kubernetes-{repo}-{container}-{tag}-check'
275     parameters:
276       - functest-kubernetes-slave:
277           slave: '{slave}'
278       - functest-kubernetes-branch:
279           branch: '{branch}'
280     scm:
281       - functest-kubernetes-scm:
282           ref: $branch
283     builders:
284       - functest-kubernetes-build-containers:
285           <<: *functest-kubernetes-build-containers
286           ref: $branch
287
288 - project:
289     name: 'functest-kubernetes-_-golang-1.12-alpine3.10-rmi'
290     repo: _
291     port:
292     container: golang
293     tag: '1.12-alpine3.10'
294     slave: master
295     jobs:
296       - 'functest-kubernetes-{repo}-{container}-{tag}-rmi'
297
298 - project:
299     name: 'functest-kubernetes-_-golang-1.12-alpine3.10-pull'
300     repo: _
301     port:
302     container: golang
303     tag: '1.12-alpine3.10'
304     slave: master
305     jobs:
306       - 'functest-kubernetes-{repo}-{container}-{tag}-pull'
307
308 - project:
309     name: functest-kubernetes-opnfv-functest-kubernetes-core-{tag}-build
310     <<: *functest-kubernetes-params
311     container: functest-kubernetes-core
312     ref_arg: BRANCH
313     path: docker/core
314     jobs:
315       - 'functest-kubernetes-{repo}-{container}-{tag}-gate'
316       - 'functest-kubernetes-{repo}-{container}-{tag}-check'
317
318 - project:
319     name: functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-build
320     <<: *functest-kubernetes-params
321     container: functest-kubernetes-healthcheck
322     ref_arg:
323     path: docker/healthcheck
324     jobs:
325       - 'functest-kubernetes-{repo}-{container}-{tag}-gate'
326       - 'functest-kubernetes-{repo}-{container}-{tag}-check'
327
328 - project:
329     name: functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-build
330     <<: *functest-kubernetes-params
331     container: functest-kubernetes-smoke
332     ref_arg:
333     path: docker/smoke
334     jobs:
335       - 'functest-kubernetes-{repo}-{container}-{tag}-gate'
336       - 'functest-kubernetes-{repo}-{container}-{tag}-check'
337
338 - job-template:
339     name: 'functest-kubernetes-{tag}-check'
340     project-type: multijob
341     parameters:
342       - functest-kubernetes-slave:
343           slave: '{slave}'
344       - functest-kubernetes-branch:
345           branch: '{branch}'
346     properties:
347       - build-blocker:
348           use-build-blocker: true
349           blocking-level: 'NODE'
350           blocking-jobs:
351             - '^functest-kubernetes-{tag}-(daily|check|gate)$'
352     builders:
353       - multijob:
354           name: remove former images
355           projects:
356             - name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-rmi'
357               <<: *functest-kubernetes-jobs
358             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-rmi'
359               <<: *functest-kubernetes-jobs
360       - multijob:
361           name: remove dependencies
362           projects:
363             - name: 'functest-kubernetes-_-golang-1.12-alpine3.10-rmi'
364               <<: *functest-kubernetes-jobs
365       - multijob:
366           name: pull dependencies
367           projects:
368             - name: 'functest-kubernetes-_-golang-1.12-alpine3.10-pull'
369               <<: *functest-kubernetes-jobs
370       - multijob:
371           name: build opnfv/functest-kubernetes-core
372           projects:
373             - name: 'functest-kubernetes-opnfv-functest-kubernetes-core-{tag}-check'
374               <<: *functest-kubernetes-jobs
375       - multijob:
376           name: build opnfv/functest-kubernetes-healthcheck
377           projects:
378             - name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-check'
379               <<: *functest-kubernetes-jobs
380       - multijob:
381           name: build containers
382           projects:
383             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-check'
384               <<: *functest-kubernetes-jobs
385       - multijob:
386           name: opnfv/functest-kubernetes-healthcheck:{tag}
387           projects:
388             - name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-k8s_smoke-run'
389               <<: *functest-kubernetes-jobs
390       - multijob:
391           name: opnfv/functest-kubernetes-smoke:{tag}
392           execution-type: SEQUENTIALLY
393           projects:
394             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-xrally_kubernetes-run'
395               <<: *functest-kubernetes-jobs
396             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-k8s_conformance-run'
397               <<: *functest-kubernetes-jobs
398
399 - trigger:
400     name: functest-kubernetes-patchset-created
401     triggers:
402       - gerrit:
403           server-name: 'gerrit.opnfv.org'
404           trigger-on:
405             - patchset-created-event
406             - comment-added-contains-event:
407                 comment-contains-value: 'recheck'
408             - comment-added-contains-event:
409                 comment-contains-value: 'reverify'
410           projects:
411             - project-compare-type: 'ANT'
412               project-pattern: 'functest-kubernetes'
413               branches:
414                 - branch-compare-type: 'ANT'
415                   branch-pattern: '**/{branch}'
416           skip-vote:
417             successful: false
418             failed: false
419             unstable: false
420             notbuilt: false
421
422 - job-template:
423     name: 'functest-kubernetes-{tag}-gate'
424     project-type: multijob
425     triggers:
426       - functest-kubernetes-patchset-created:
427           branch: '{branch}'
428     parameters:
429       - functest-kubernetes-slave:
430           slave: '{slave}'
431     properties:
432       - build-blocker:
433           use-build-blocker: true
434           blocking-level: 'NODE'
435           blocking-jobs:
436             - '^functest-kubernetes-{tag}-(daily|check|gate)$'
437     builders:
438       - multijob:
439           name: remove former images
440           projects:
441             - name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-rmi'
442               <<: *functest-kubernetes-jobs
443             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-rmi'
444               <<: *functest-kubernetes-jobs
445       - multijob:
446           name: remove dependencies
447           projects:
448             - name: 'functest-kubernetes-_-golang-1.12-alpine3.10-rmi'
449               <<: *functest-kubernetes-jobs
450       - multijob:
451           name: pull dependencies
452           projects:
453             - name: 'functest-kubernetes-_-golang-1.12-alpine3.10-pull'
454               <<: *functest-kubernetes-jobs
455       - multijob:
456           name: build opnfv/functest-kubernetes-core
457           projects:
458             - name: 'functest-kubernetes-opnfv-functest-kubernetes-core-{tag}-gate'
459               <<: *functest-kubernetes-jobs
460       - multijob:
461           name: build opnfv/functest-kubernetes-healthcheck
462           projects:
463             - name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-gate'
464               <<: *functest-kubernetes-jobs
465       - multijob:
466           name: build containers
467           projects:
468             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-gate'
469               <<: *functest-kubernetes-jobs
470       - multijob:
471           name: opnfv/functest-kubernetes-healthcheck:{tag}
472           projects:
473             - name: 'functest-kubernetes-opnfv-functest-kubernetes-healthcheck-{tag}-k8s_smoke-run'
474               <<: *functest-kubernetes-jobs
475       - multijob:
476           name: opnfv/functest-kubernetes-smoke:{tag}
477           execution-type: SEQUENTIALLY
478           projects:
479             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-xrally_kubernetes-run'
480               <<: *functest-kubernetes-jobs
481             - name: 'functest-kubernetes-opnfv-functest-kubernetes-smoke-{tag}-k8s_conformance-run'
482               <<: *functest-kubernetes-jobs
483
484 - project:
485     name: 'functest-kubernetes'
486     <<: *functest-kubernetes-params
487     jobs:
488       - 'functest-kubernetes-{tag}-daily'
489       - 'functest-kubernetes-{tag}-check'
490       - 'functest-kubernetes-{tag}-gate'
491
492 - view:
493     name: functest-kubernetes
494     view-type: list
495     columns:
496       - status
497       - weather
498       - job
499       - last-success
500       - last-failure
501       - last-duration
502     regex: ^functest-kubernetes-[a-z]+-(daily|check|gate)$