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