3fbfaf0344276dcec89e40117aa74b5566d8e44d
[releng.git] / jjb / functest / xtesting-pi.yaml
1 ---
2 - xtesting-pi-containers: &xtesting-pi-containers
3     name: 'xtesting-pi-containers'
4     repo: '{repo}'
5     port: '{port}'
6     container: '{container}'
7     tag: '{tag}'
8
9 - xtesting-pi-params: &xtesting-pi-params
10     name: 'xtesting-pi-params'
11     repo: 'ollivier'
12     port:
13     tag:
14       - latest:
15           slave: lf-virtual1
16       - xena:
17           slave: lf-virtual1
18       - wallaby:
19           slave: lf-virtual1
20       - leguer:
21           slave: lf-virtual1
22       - kali:
23           slave: lf-virtual1
24       - jerma:
25           slave: lf-virtual1
26       - arm-latest:
27           slave: lf-virtual1
28       - arm-xena:
29           slave: lf-virtual1
30       - arm-wallaby:
31           slave: lf-virtual1
32       - arm-leguer:
33           slave: lf-virtual1
34       - arm-kali:
35           slave: lf-virtual1
36       - arm-jerma:
37           slave: lf-virtual1
38       - arm64-latest:
39           slave: lf-virtual1
40       - arm64-xena:
41           slave: lf-virtual1
42       - arm64-wallaby:
43           slave: lf-virtual1
44       - arm64-leguer:
45           slave: lf-virtual1
46       - arm64-kali:
47           slave: lf-virtual1
48       - arm64-jerma:
49           slave: lf-virtual1
50
51 - xtesting-pi-jobs: &xtesting-pi-jobs
52     name: 'xtesting-pi-jobs'
53     current-parameters: true
54
55 - parameter:
56     name: xtesting-pi-slave
57     parameters:
58       - label:
59           name: slave
60           default: '{slave}'
61
62 - parameter:
63     name: xtesting-pi-build_tag
64     parameters:
65       - random-string:
66           name: build_tag
67
68 - xtesting-pi-run-containers: &xtesting-pi-run-containers
69     name: 'xtesting-pi-run-containers'
70     <<: *xtesting-pi-containers
71     test: '{test}'
72     privileged: '{privileged}'
73     volumes: '{volumes}'
74     env: '{env}'
75     network: '{network}'
76     uid: '{uid}'
77     gid: '{gid}'
78
79 - builder:
80     name: xtesting-pi-pull-containers
81     builders:
82       - shell: |
83           set +x
84           if [ "{repo}" = "_" ]; then
85             image={container}:{tag}
86           elif [ "{port}" = "None" ]; then
87             image={repo}/{container}:{tag}
88           else
89             image={repo}:{port}/{container}:{tag}
90           fi
91           sudo docker pull $image
92
93 - builder:
94     name: xtesting-pi-run-containers
95     builders:
96       - shell: |
97           set +x
98           volumes=;
99           if [ "{volumes}" != "None" ]; then
100             for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
101               do volumes="-v $i $volumes"; done
102           fi
103           env=;
104           if [ "{env}" != "None" ]; then
105             for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
106               do env="-e $i $env"; done
107           fi
108           [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
109           if [ "{repo}" = "_" ]; then
110             image={container}:{tag}
111           elif [ "{port}" = "None" ]; then
112             image={repo}/{container}:{tag}
113           else
114             image={repo}:{port}/{container}:{tag}
115           fi
116           sudo mkdir -p $WORKSPACE/results
117           sudo chown {uid}:{gid} $WORKSPACE/results
118           sudo docker run --rm \
119             --privileged={privileged} \
120             --network={network} \
121             $volumes \
122             $env \
123             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
124             -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
125             -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
126             -v /home/opnfv/xtesting/.boto:/root/.boto \
127             -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
128             -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
129             -e NODE_NAME=$slave \
130             -e BUILD_TAG=$BUILD_TAG \
131             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
132             $image run_tests -t {test} -p -r
133
134 - builder:
135     name: xtesting-pi-remove-images
136     builders:
137       - shell: |
138           set +x
139           if [ "{repo}" = "_" ]; then
140             image={container}:{tag}
141           elif [ "{port}" = "None" ]; then
142             image={repo}/{container}:{tag}
143           else
144             image={repo}:{port}/{container}:{tag}
145           fi
146           sudo docker rmi $image || true
147
148 - job-template:
149     name: 'xtesting-pi-{repo}-{container}-{tag}-pull'
150     parameters:
151       - xtesting-pi-slave:
152           slave: '{slave}'
153     builders:
154       - xtesting-pi-pull-containers:
155           <<: *xtesting-pi-containers
156
157 - project:
158     name: 'xtesting-pi-ollivier-xtesting-pull'
159     <<: *xtesting-pi-params
160     container: 'xtesting'
161     jobs:
162       - 'xtesting-pi-{repo}-{container}-{tag}-pull'
163
164 - project:
165     name: 'xtesting-pi-ollivier-xtesting-mts-pull'
166     <<: *xtesting-pi-params
167     container: 'xtesting-mts'
168     jobs:
169       - 'xtesting-pi-{repo}-{container}-{tag}-pull'
170
171 - job-template:
172     name: 'xtesting-pi-{repo}-{container}-{tag}-rmi'
173     parameters:
174       - xtesting-pi-slave:
175           slave: '{slave}'
176     builders:
177       - xtesting-pi-remove-images:
178           <<: *xtesting-pi-containers
179
180 - project:
181     name: 'xtesting-pi-ollivier-xtesting-rmi'
182     <<: *xtesting-pi-params
183     container: 'xtesting'
184     jobs:
185       - 'xtesting-pi-{repo}-{container}-{tag}-rmi'
186
187 - project:
188     name: 'xtesting-pi-ollivier-xtesting-mts-rmi'
189     <<: *xtesting-pi-params
190     container: 'xtesting-mts'
191     jobs:
192       - 'xtesting-pi-{repo}-{container}-{tag}-rmi'
193
194 - job-template:
195     name: 'xtesting-pi-ollivier-xtesting-{tag}-{test}-run'
196     parameters:
197       - xtesting-pi-slave:
198           slave: '{slave}'
199       - xtesting-pi-build_tag:
200           build_tag: ''
201     builders:
202       - xtesting-pi-run-containers:
203           <<: *xtesting-pi-run-containers
204
205 - project:
206     name: 'xtesting-pi-ollivier-xtesting'
207     <<: *xtesting-pi-params
208     volumes:
209     env:
210     container: 'xtesting'
211     test:
212       - first
213       - second
214       - third
215       - fourth
216       - fifth
217       - sixth
218       - eighth
219     privileged: 'false'
220     network: bridge
221     uid: 1000
222     gid: 1000
223     exclude:
224       - tag: leguer
225         test: eighth
226       - tag: kali
227         test: eighth
228       - tag: jerma
229         test: eighth
230       - tag: arm-leguer
231         test: eighth
232       - tag: arm-kali
233         test: eighth
234       - tag: arm-jerma
235         test: eighth
236       - tag: arm64-leguer
237         test: eighth
238       - tag: arm64-kali
239         test: eighth
240       - tag: arm64-jerma
241         test: eighth
242     jobs:
243       - 'xtesting-pi-ollivier-xtesting-{tag}-{test}-run'
244
245 - job-template:
246     name: 'xtesting-pi-ollivier-xtesting-mts-{tag}-{test}-run'
247     parameters:
248       - xtesting-pi-slave:
249           slave: '{slave}'
250       - xtesting-pi-build_tag:
251           build_tag: ''
252     builders:
253       - xtesting-pi-run-containers:
254           <<: *xtesting-pi-run-containers
255
256 - project:
257     name: 'xtesting-pi-ollivier-xtesting-mts'
258     <<: *xtesting-pi-params
259     volumes:
260     env:
261     container: 'xtesting-mts'
262     test:
263       - seventh
264     privileged: 'false'
265     network: bridge
266     uid: 1000
267     gid: 1000
268     jobs:
269       - 'xtesting-pi-ollivier-xtesting-mts-{tag}-{test}-run'
270
271 - builder:
272     name: xtesting-pi-zip
273     builders:
274       - shell: |
275           set +x
276           volumes=;
277           if [ "{volumes}" != "None" ]; then
278             for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
279               do volumes="-v $i $volumes"; done
280           fi
281           env=;
282           if [ "{env}" != "None" ]; then
283             for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
284               do env="-e $i $env"; done
285           fi
286           [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
287           if [ "{repo}" = "_" ]; then
288             image={container}:{tag}
289           elif [ "{port}" = "None" ]; then
290             image={repo}/{container}:{tag}
291           else
292             image={repo}:{port}/{container}:{tag}
293           fi
294           sudo docker run --rm \
295             $volumes \
296             $env \
297             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
298             -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
299             -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
300             -v /home/opnfv/xtesting/.boto:/root/.boto \
301             -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
302             -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
303             -e BUILD_TAG=$BUILD_TAG \
304             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
305             $image zip_campaign
306
307 - job-template:
308     name: 'xtesting-pi-{tag}-zip'
309     parameters:
310       - xtesting-pi-slave:
311           slave: '{slave}'
312       - xtesting-pi-build_tag:
313           build_tag: ''
314     builders:
315       - xtesting-pi-zip:
316           <<: *xtesting-pi-containers
317           volumes: '{volumes}'
318           env: '{env}'
319
320 - project:
321     name: 'xtesting-pi-{tag}-zip'
322     <<: *xtesting-pi-params
323     volumes:
324     env:
325     container: 'xtesting'
326     jobs:
327       - 'xtesting-pi-{tag}-zip'
328
329 - job-template:
330     name: 'xtesting-pi-{tag}-daily'
331     project-type: multijob
332     triggers:
333       - timed: '@daily'
334     parameters:
335       - xtesting-pi-slave:
336           slave: '{slave}'
337       - xtesting-pi-build_tag:
338           build_tag: ''
339     # PyYAML and yamllint differ here
340     # see https://github.com/yaml/pyyaml/issues/234
341     # yamllint disable rule:indentation
342     properties:
343       - build-blocker:
344           blocking-jobs:
345           - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
346     # yamllint enable rule:indentation
347     builders:
348       - multijob:
349           name: remove former images
350           projects:
351             - name: 'xtesting-pi-ollivier-xtesting-{tag}-rmi'
352               <<: *xtesting-pi-jobs
353             - name: 'xtesting-pi-ollivier-xtesting-mts-{tag}-rmi'
354               <<: *xtesting-pi-jobs
355       - multijob:
356           name: pull containers
357           projects:
358             - name: 'xtesting-pi-ollivier-xtesting-{tag}-pull'
359               <<: *xtesting-pi-jobs
360             - name: 'xtesting-pi-ollivier-xtesting-mts-{tag}-pull'
361               <<: *xtesting-pi-jobs
362       - multijob:
363           name: ollivier/xtesting:{tag}
364           projects:
365             - name: 'xtesting-pi-ollivier-xtesting-{tag}-first-run'
366               <<: *xtesting-pi-jobs
367             - name: 'xtesting-pi-ollivier-xtesting-{tag}-second-run'
368               <<: *xtesting-pi-jobs
369             - name: 'xtesting-pi-ollivier-xtesting-{tag}-third-run'
370               <<: *xtesting-pi-jobs
371             - name: 'xtesting-pi-ollivier-xtesting-{tag}-fourth-run'
372               <<: *xtesting-pi-jobs
373             - name: 'xtesting-pi-ollivier-xtesting-{tag}-fifth-run'
374               <<: *xtesting-pi-jobs
375             - name: 'xtesting-pi-ollivier-xtesting-{tag}-sixth-run'
376               <<: *xtesting-pi-jobs
377             - name: 'xtesting-pi-ollivier-xtesting-{tag}-eighth-run'
378               <<: *xtesting-pi-jobs
379       - multijob:
380           name: ollivier/xtesting-mts:{tag}
381           projects:
382             - name: 'xtesting-pi-ollivier-xtesting-mts-{tag}-seventh-run'
383               <<: *xtesting-pi-jobs
384       - multijob:
385           name: dump all campaign data
386           projects:
387             - name: 'xtesting-pi-{tag}-zip'
388               <<: *xtesting-pi-jobs
389     publishers:
390       - email-ext:
391           failure: false
392           first-failure: true
393           fixed: true
394           recipients: cedric.ollivier@orange.com
395
396 - project:
397     name: 'xtesting-pi-daily'
398     <<: *xtesting-pi-params
399     jobs:
400       - 'xtesting-pi-{tag}-daily'
401
402 - view:
403     name: xtesting-pi
404     view-type: list
405     columns:
406       - status
407       - weather
408       - job
409       - last-success
410       - last-failure
411       - last-duration
412     regex: ^xtesting-pi-[a-z-0-9.]+-daily$