Jerma Release Tagging for OPNFV Docs
[releng.git] / jjb / functest / xtesting.yaml
1 ---
2 - xtesting-jobs: &xtesting-jobs
3     name: 'xtesting-jobs'
4     current-parameters: true
5
6 - xtesting-params: &xtesting-params
7     name: 'xtesting-params'
8     repo: 'opnfv'
9     port:
10     tag:
11       - latest:
12           branch: master
13           slave: lf-virtual1
14       - leguer:
15           branch: stable/leguer
16           slave: lf-virtual1
17       - kali:
18           branch: stable/kali
19           slave: lf-virtual1
20       - jerma:
21           branch: stable/jerma
22           slave: lf-virtual1
23       - iruya:
24           branch: stable/iruya
25           slave: lf-virtual1
26       - hunter:
27           branch: stable/hunter
28           slave: lf-virtual1
29
30 - parameter:
31     name: xtesting-slave
32     parameters:
33       - label:
34           name: slave
35           default: '{slave}'
36
37 - parameter:
38     name: xtesting-build_tag
39     parameters:
40       - random-string:
41           name: build_tag
42
43 - parameter:
44     name: xtesting-branch
45     parameters:
46       - string:
47           name: branch
48           default: '{branch}'
49
50 - parameter:
51     name: xtesting-DEBUG
52     parameters:
53       - string:
54           name: DEBUG
55           default: 'true'
56
57 - xtesting-containers: &xtesting-containers
58     name: 'xtesting-containers'
59     repo: '{repo}'
60     port: '{port}'
61     container: '{container}'
62     tag: '{tag}'
63
64 - xtesting-run-containers: &xtesting-run-containers
65     name: 'xtesting-run-containers'
66     <<: *xtesting-containers
67     test: '{test}'
68     privileged: '{privileged}'
69     network: '{network}'
70
71 - builder:
72     name: xtesting-pull-containers
73     builders:
74       - shell: |
75           set +x
76           if [ "{repo}" = "_" ]; then
77             image={container}:{tag}
78           elif [ "{port}" = "None" ]; then
79             image={repo}/{container}:{tag}
80           else
81             image={repo}:{port}/{container}:{tag}
82           fi
83           sudo docker pull $image
84
85 - builder:
86     name: xtesting-run-containers
87     builders:
88       - shell: |
89           set +x
90           [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/* || true
91           if [ "{repo}" = "_" ]; then
92             image={container}:{tag}
93           elif [ "{port}" = "None" ]; then
94             image={repo}/{container}:{tag}
95           else
96             image={repo}:{port}/{container}:{tag}
97           fi
98           sudo docker run --rm \
99             --privileged={privileged} \
100             --network={network} \
101             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
102             -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
103             -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
104             -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
105             -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
106             -e NODE_NAME=$slave \
107             -e BUILD_TAG=$BUILD_TAG \
108             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
109             -e DEBUG=$DEBUG \
110             -v /home/opnfv/xtesting/.boto:/root/.boto \
111             $image run_tests -t {test} -p -r
112
113 - builder:
114     name: xtesting-remove-images
115     builders:
116       - shell: |
117           set +x
118           if [ "{repo}" = "_" ]; then
119             image={container}:{tag}
120           elif [ "{port}" = "None" ]; then
121             image={repo}/{container}:{tag}
122           else
123             image={repo}:{port}/{container}:{tag}
124           fi
125           sudo docker rmi $image || true
126
127 - xtesting-build-containers: &xtesting-build-containers
128     name: 'xtesting-build-containers'
129     <<: *xtesting-containers
130     ref_arg: '{ref_arg}'
131     path: '{path}'
132
133 - builder:
134     name: xtesting-build-containers
135     builders:
136       - shell: |
137           set +x
138           if [ "{repo}" = "_" ]; then
139             image={container}:{tag}
140           elif [ "{port}" = "None" ]; then
141             image={repo}/{container}:{tag}
142           else
143             image={repo}:{port}/{container}:{tag}
144           fi
145           if [ "{ref_arg}" = "None" ]; then
146             build_arg=""
147           else
148             build_arg="--build-arg {ref_arg}={ref}"
149           fi
150           case {tag} in
151           *latest|*leguer)
152             cd {path};;
153           *)
154             cd docker;;
155           esac
156           sudo docker build $build_arg \
157             --pull=false --no-cache --force-rm=true \
158             -t $image .
159
160 - scm:
161     name: xtesting-scm
162     scm:
163       - git:
164           url: https://gerrit.opnfv.org/gerrit/functest-xtesting
165           refspec: '+refs/changes/*:refs/changes/*'
166           branches:
167             - '{ref}'
168
169 - job-template:
170     name: 'xtesting-{repo}-{container}-{tag}-pull'
171     parameters:
172       - xtesting-slave:
173           slave: '{slave}'
174     builders:
175       - xtesting-pull-containers:
176           <<: *xtesting-containers
177
178 - project:
179     name: 'xtesting-opnfv-xtesting-pull'
180     <<: *xtesting-params
181     container: 'xtesting'
182     jobs:
183       - 'xtesting-{repo}-{container}-{tag}-pull'
184
185 - project:
186     name: 'xtesting-opnfv-xtesting-mts-pull'
187     <<: *xtesting-params
188     container: 'xtesting-mts'
189     exclude:
190       - tag: hunter
191       - tag: iruya
192       - tag: jerma
193       - tag: kali
194     jobs:
195       - 'xtesting-{repo}-{container}-{tag}-pull'
196
197 - job-template:
198     name: 'xtesting-{repo}-{container}-{tag}-rmi'
199     parameters:
200       - xtesting-slave:
201           slave: '{slave}'
202     builders:
203       - xtesting-remove-images:
204           <<: *xtesting-containers
205
206 - project:
207     name: 'xtesting-opnfv-xtesting-rmi'
208     <<: *xtesting-params
209     container: 'xtesting'
210     jobs:
211       - 'xtesting-{repo}-{container}-{tag}-rmi'
212
213 - project:
214     name: 'xtesting-opnfv-xtesting-mts-rmi'
215     <<: *xtesting-params
216     container: 'xtesting-mts'
217     exclude:
218       - tag: hunter
219       - tag: iruya
220       - tag: jerma
221       - tag: kali
222     jobs:
223       - 'xtesting-{repo}-{container}-{tag}-rmi'
224
225 - job-template:
226     name: 'xtesting-{repo}-{container}-{tag}-{test}-run'
227     parameters:
228       - xtesting-slave:
229           slave: '{slave}'
230       - xtesting-build_tag:
231           build_tag: ''
232       - xtesting-DEBUG:
233           DEBUG: 'true'
234     builders:
235       - xtesting-run-containers:
236           <<: *xtesting-run-containers
237
238 - project:
239     name: 'xtesting-opnfv-xtesting'
240     <<: *xtesting-params
241     container: 'xtesting'
242     test:
243       - first
244       - second
245       - third
246       - fourth
247       - fifth
248       - sixth
249     exclude:
250       - tag: hunter
251         test: sixth
252       - tag: iruya
253         test: sixth
254     privileged: 'false'
255     network: bridge
256     jobs:
257       - 'xtesting-{repo}-{container}-{tag}-{test}-run'
258
259 - project:
260     name: 'xtesting-opnfv-xtesting-mts'
261     <<: *xtesting-params
262     container: 'xtesting-mts'
263     test:
264       - seventh
265     exclude:
266       - tag: hunter
267         test: seventh
268       - tag: iruya
269         test: seventh
270       - tag: jerma
271         test: seventh
272       - tag: kali
273         test: seventh
274     privileged: 'false'
275     network: bridge
276     jobs:
277       - 'xtesting-{repo}-{container}-{tag}-{test}-run'
278
279 - builder:
280     name: xtesting-zip
281     builders:
282       - shell: |
283           set +x
284           [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/* || true
285           if [ "{repo}" = "_" ]; then
286             image={container}:{tag}
287           elif [ "{port}" = "None" ]; then
288             image={repo}/{container}:{tag}
289           else
290             image={repo}:{port}/{container}:{tag}
291           fi
292           sudo docker run --rm \
293             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
294             -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
295             -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
296             -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
297             -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
298             -e BUILD_TAG=$BUILD_TAG \
299             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
300             -e DEBUG=$DEBUG \
301             -v /home/opnfv/xtesting/.boto:/root/.boto \
302             $image zip_campaign
303
304 - job-template:
305     name: 'xtesting-{tag}-zip'
306     parameters:
307       - xtesting-slave:
308           slave: '{slave}'
309       - xtesting-build_tag:
310           build_tag: ''
311       - xtesting-DEBUG:
312           DEBUG: 'true'
313     builders:
314       - xtesting-zip:
315           <<: *xtesting-containers
316
317 - project:
318     name: 'xtesting-{tag}-zip'
319     <<: *xtesting-params
320     container: 'xtesting'
321     jobs:
322       - 'xtesting-{tag}-zip'
323
324 - job-template:
325     name: 'xtesting-{tag}-daily'
326     project-type: multijob
327     triggers:
328       - timed: '@daily'
329     parameters:
330       - xtesting-slave:
331           slave: '{slave}'
332       - xtesting-build_tag:
333           build_tag: ''
334       - xtesting-DEBUG:
335           DEBUG: 'true'
336     properties:
337       - build-blocker:
338           use-build-blocker: true
339           blocking-level: 'NODE'
340           blocking-jobs:
341             - '^xtesting-{tag}-(daily|check|gate)$'
342     builders:
343       - multijob:
344           name: remove former images
345           projects:
346             - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
347               <<: *xtesting-jobs
348             - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
349               <<: *xtesting-jobs
350       - multijob:
351           name: pull containers
352           projects:
353             - name: 'xtesting-opnfv-xtesting-{tag}-pull'
354               <<: *xtesting-jobs
355             - name: 'xtesting-opnfv-xtesting-mts-{tag}-pull'
356               <<: *xtesting-jobs
357       - multijob:
358           name: opnfv/xtesting:{tag}
359           projects:
360             - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
361               <<: *xtesting-jobs
362             - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
363               <<: *xtesting-jobs
364             - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
365               <<: *xtesting-jobs
366             - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
367               <<: *xtesting-jobs
368             - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
369               <<: *xtesting-jobs
370             - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
371               <<: *xtesting-jobs
372       - multijob:
373           name: opnfv/xtesting-mts:{tag}
374           projects:
375             - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
376               <<: *xtesting-jobs
377       - multijob:
378           name: dump all campaign data
379           projects:
380             - name: 'xtesting-{tag}-zip'
381               <<: *xtesting-jobs
382
383 - job-template:
384     name: 'xtesting-{repo}-{container}-{tag}-gate'
385     parameters:
386       - xtesting-slave:
387           slave: '{slave}'
388     scm:
389       - xtesting-scm:
390           ref: $GERRIT_REFSPEC
391     builders:
392       - xtesting-build-containers:
393           <<: *xtesting-build-containers
394           ref: $GERRIT_REFSPEC
395
396 - job-template:
397     name: 'xtesting-{repo}-{container}-{tag}-check'
398     parameters:
399       - xtesting-slave:
400           slave: '{slave}'
401       - xtesting-branch:
402           branch: '{branch}'
403     scm:
404       - xtesting-scm:
405           ref: $branch
406     builders:
407       - xtesting-build-containers:
408           <<: *xtesting-build-containers
409           ref: $branch
410
411 - project:
412     name: 'xtesting-_-alpine-3.12-rmi'
413     repo: _
414     port:
415     container: alpine
416     tag: '3.12'
417     slave: master
418     jobs:
419       - 'xtesting-{repo}-{container}-{tag}-rmi'
420
421 - project:
422     name: 'xtesting-_-alpine-3.12-pull'
423     repo: _
424     port:
425     container: alpine
426     tag: '3.12'
427     slave: master
428     jobs:
429       - 'xtesting-{repo}-{container}-{tag}-pull'
430
431 - project:
432     name: xtesting-opnfv-xtesting-{tag}-build
433     <<: *xtesting-params
434     container: xtesting
435     ref_arg: BRANCH
436     path: docker/core
437     jobs:
438       - 'xtesting-{repo}-{container}-{tag}-gate'
439       - 'xtesting-{repo}-{container}-{tag}-check'
440
441 - project:
442     name: xtesting-opnfv-xtesting-mts-{tag}-build
443     <<: *xtesting-params
444     container: xtesting-mts
445     ref_arg: BRANCH
446     path: docker/mts
447     exclude:
448       - tag: hunter
449       - tag: iruya
450       - tag: jerma
451       - tag: kali
452     jobs:
453       - 'xtesting-{repo}-{container}-{tag}-gate'
454       - 'xtesting-{repo}-{container}-{tag}-check'
455
456 - job-template:
457     name: 'xtesting-{tag}-check'
458     project-type: multijob
459     parameters:
460       - xtesting-slave:
461           slave: '{slave}'
462       - xtesting-build_tag:
463           build_tag: ''
464       - xtesting-branch:
465           branch: '{branch}'
466       - xtesting-DEBUG:
467           DEBUG: 'true'
468     properties:
469       - build-blocker:
470           use-build-blocker: true
471           blocking-level: 'NODE'
472           blocking-jobs:
473             - '^xtesting-{tag}-(daily|check|gate)$'
474     builders:
475       - multijob:
476           name: remove former images
477           projects:
478             - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
479               <<: *xtesting-jobs
480             - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
481               <<: *xtesting-jobs
482       - multijob:
483           name: remove dependencies
484           projects:
485             - name: 'xtesting-_-alpine-3.12-rmi'
486               <<: *xtesting-jobs
487       - multijob:
488           name: pull dependencies
489           projects:
490             - name: 'xtesting-_-alpine-3.12-pull'
491               <<: *xtesting-jobs
492       - multijob:
493           name: opnfv/xtesting
494           projects:
495             - name: 'xtesting-opnfv-xtesting-{tag}-check'
496               <<: *xtesting-jobs
497       - multijob:
498           name: opnfv/xtesting-mts
499           projects:
500             - name: 'xtesting-opnfv-xtesting-mts-{tag}-check'
501               <<: *xtesting-jobs
502       - multijob:
503           name: opnfv/xtesting:{tag}
504           projects:
505             - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
506               <<: *xtesting-jobs
507             - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
508               <<: *xtesting-jobs
509             - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
510               <<: *xtesting-jobs
511             - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
512               <<: *xtesting-jobs
513             - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
514               <<: *xtesting-jobs
515             - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
516               <<: *xtesting-jobs
517       - multijob:
518           name: opnfv/xtesting-mts:{tag}
519           projects:
520             - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
521               <<: *xtesting-jobs
522
523 - trigger:
524     name: xtesting-patchset-created
525     triggers:
526       - gerrit:
527           server-name: 'gerrit.opnfv.org'
528           trigger-on:
529             - patchset-created-event
530             - comment-added-contains-event:
531                 comment-contains-value: 'recheck'
532             - comment-added-contains-event:
533                 comment-contains-value: 'reverify'
534           projects:
535             - project-compare-type: 'ANT'
536               project-pattern: 'functest-xtesting'
537               branches:
538                 - branch-compare-type: 'ANT'
539                   branch-pattern: '**/{branch}'
540           skip-vote:
541             successful: false
542             failed: false
543             unstable: false
544             notbuilt: false
545
546 - job-template:
547     name: 'xtesting-{tag}-gate'
548     project-type: multijob
549     triggers:
550       - xtesting-patchset-created:
551           branch: '{branch}'
552     parameters:
553       - xtesting-slave:
554           slave: '{slave}'
555       - xtesting-build_tag:
556           build_tag: ''
557       - xtesting-DEBUG:
558           DEBUG: 'true'
559     properties:
560       - build-blocker:
561           use-build-blocker: true
562           blocking-level: 'NODE'
563           blocking-jobs:
564             - '^xtesting-{tag}-(daily|check|gate)$'
565     builders:
566       - multijob:
567           name: remove former images
568           projects:
569             - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
570               <<: *xtesting-jobs
571             - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
572               <<: *xtesting-jobs
573       - multijob:
574           name: remove dependencies
575           projects:
576             - name: 'xtesting-_-alpine-3.12-rmi'
577               <<: *xtesting-jobs
578       - multijob:
579           name: pull dependencies
580           projects:
581             - name: 'xtesting-_-alpine-3.12-pull'
582               <<: *xtesting-jobs
583       - multijob:
584           name: opnfv/xtesting
585           projects:
586             - name: 'xtesting-opnfv-xtesting-{tag}-gate'
587               <<: *xtesting-jobs
588       - multijob:
589           name: opnfv/xtesting-mts
590           projects:
591             - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
592               <<: *xtesting-jobs
593       - multijob:
594           name: opnfv/xtesting:{tag}
595           projects:
596             - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
597               <<: *xtesting-jobs
598             - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
599               <<: *xtesting-jobs
600             - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
601               <<: *xtesting-jobs
602             - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
603               <<: *xtesting-jobs
604             - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
605               <<: *xtesting-jobs
606             - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
607               <<: *xtesting-jobs
608       - multijob:
609           name: opnfv/xtesting-mts:{tag}
610           projects:
611             - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
612               <<: *xtesting-jobs
613
614 - project:
615     name: 'xtesting'
616     <<: *xtesting-params
617     jobs:
618       - 'xtesting-{tag}-daily'
619
620 - project:
621     name: 'xtesting-gate'
622     <<: *xtesting-params
623     jobs:
624       - 'xtesting-{tag}-check'
625       - 'xtesting-{tag}-gate'
626
627 - view:
628     name: xtesting
629     view-type: list
630     columns:
631       - status
632       - weather
633       - job
634       - last-success
635       - last-failure
636       - last-duration
637     regex: ^xtesting-(amd64-)*[a-z]+-daily$
638
639 - view:
640     name: xtesting-gate
641     view-type: list
642     columns:
643       - status
644       - weather
645       - job
646       - last-success
647       - last-failure
648       - last-duration
649     regex: ^xtesting-(amd64-)*[a-z]+-gate$