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