Fix .boto location
[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:/etc/boto.cfg \
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 mkdir -p $WORKSPACE/results
295           sudo chown {uid}:{gid} $WORKSPACE/results
296           sudo docker run --rm \
297             $volumes \
298             $env \
299             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
300             -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
301             -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
302             -v /home/opnfv/xtesting/.boto:/etc/boto.cfg \
303             -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
304             -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
305             -e BUILD_TAG=$BUILD_TAG \
306             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
307             $image zip_campaign
308
309 - job-template:
310     name: 'xtesting-pi-{tag}-zip'
311     parameters:
312       - xtesting-pi-slave:
313           slave: '{slave}'
314       - xtesting-pi-build_tag:
315           build_tag: ''
316     builders:
317       - xtesting-pi-zip:
318           <<: *xtesting-pi-containers
319           volumes: '{volumes}'
320           env: '{env}'
321           uid: '{uid}'
322           gid: '{gid}'
323
324 - project:
325     name: 'xtesting-pi-{tag}-zip'
326     <<: *xtesting-pi-params
327     volumes:
328     env:
329     container: 'xtesting'
330     uid: 1000
331     gid: 1000
332     jobs:
333       - 'xtesting-pi-{tag}-zip'
334
335 - job-template:
336     name: 'xtesting-pi-{tag}-daily'
337     project-type: multijob
338     triggers:
339       - timed: '@daily'
340     parameters:
341       - xtesting-pi-slave:
342           slave: '{slave}'
343       - xtesting-pi-build_tag:
344           build_tag: ''
345     # PyYAML and yamllint differ here
346     # see https://github.com/yaml/pyyaml/issues/234
347     # yamllint disable rule:indentation
348     properties:
349       - build-blocker:
350           blocking-jobs:
351           - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
352     # yamllint enable rule:indentation
353     builders:
354       - multijob:
355           name: remove former images
356           projects:
357             - name: 'xtesting-pi-ollivier-xtesting-{tag}-rmi'
358               <<: *xtesting-pi-jobs
359             - name: 'xtesting-pi-ollivier-xtesting-mts-{tag}-rmi'
360               <<: *xtesting-pi-jobs
361       - multijob:
362           name: pull containers
363           projects:
364             - name: 'xtesting-pi-ollivier-xtesting-{tag}-pull'
365               <<: *xtesting-pi-jobs
366             - name: 'xtesting-pi-ollivier-xtesting-mts-{tag}-pull'
367               <<: *xtesting-pi-jobs
368       - multijob:
369           name: ollivier/xtesting:{tag}
370           projects:
371             - name: 'xtesting-pi-ollivier-xtesting-{tag}-first-run'
372               <<: *xtesting-pi-jobs
373             - name: 'xtesting-pi-ollivier-xtesting-{tag}-second-run'
374               <<: *xtesting-pi-jobs
375             - name: 'xtesting-pi-ollivier-xtesting-{tag}-third-run'
376               <<: *xtesting-pi-jobs
377             - name: 'xtesting-pi-ollivier-xtesting-{tag}-fourth-run'
378               <<: *xtesting-pi-jobs
379             - name: 'xtesting-pi-ollivier-xtesting-{tag}-fifth-run'
380               <<: *xtesting-pi-jobs
381             - name: 'xtesting-pi-ollivier-xtesting-{tag}-sixth-run'
382               <<: *xtesting-pi-jobs
383             - name: 'xtesting-pi-ollivier-xtesting-{tag}-eighth-run'
384               <<: *xtesting-pi-jobs
385       - multijob:
386           name: ollivier/xtesting-mts:{tag}
387           projects:
388             - name: 'xtesting-pi-ollivier-xtesting-mts-{tag}-seventh-run'
389               <<: *xtesting-pi-jobs
390       - multijob:
391           name: dump all campaign data
392           projects:
393             - name: 'xtesting-pi-{tag}-zip'
394               <<: *xtesting-pi-jobs
395     publishers:
396       - email-ext:
397           failure: false
398           first-failure: true
399           fixed: true
400           recipients: cedric.ollivier@orange.com
401
402 - project:
403     name: 'xtesting-pi-daily'
404     <<: *xtesting-pi-params
405     jobs:
406       - 'xtesting-pi-{tag}-daily'
407
408 - view:
409     name: xtesting-pi
410     view-type: list
411     columns:
412       - status
413       - weather
414       - job
415       - last-success
416       - last-failure
417       - last-duration
418     regex: ^xtesting-pi-[a-z-0-9.]+-daily$