Support CentOS 7 in GoogleStorage Gitlab template
[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
77 - builder:
78     name: xtesting-pi-pull-containers
79     builders:
80       - shell: |
81           set +x
82           if [ "{repo}" = "_" ]; then
83             image={container}:{tag}
84           elif [ "{port}" = "None" ]; then
85             image={repo}/{container}:{tag}
86           else
87             image={repo}:{port}/{container}:{tag}
88           fi
89           sudo docker pull $image
90
91 - builder:
92     name: xtesting-pi-run-containers
93     builders:
94       - shell: |
95           set +x
96           volumes=;
97           if [ "{volumes}" != "None" ]; then
98             for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
99               do volumes="-v $i $volumes"; done
100           fi
101           env=;
102           if [ "{env}" != "None" ]; then
103             for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
104               do env="-e $i $env"; done
105           fi
106           [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
107           if [ "{repo}" = "_" ]; then
108             image={container}:{tag}
109           elif [ "{port}" = "None" ]; then
110             image={repo}/{container}:{tag}
111           else
112             image={repo}:{port}/{container}:{tag}
113           fi
114           sudo docker run --rm \
115             --privileged={privileged} \
116             --network={network} \
117             $volumes \
118             $env \
119             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
120             -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
121             -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
122             -v /home/opnfv/xtesting/.boto:/root/.boto \
123             -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
124             -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
125             -e NODE_NAME=$slave \
126             -e BUILD_TAG=$BUILD_TAG \
127             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
128             $image run_tests -t {test} -p -r
129
130 - builder:
131     name: xtesting-pi-remove-images
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           sudo docker rmi $image || true
143
144 - job-template:
145     name: 'xtesting-pi-{repo}-{container}-{tag}-pull'
146     parameters:
147       - xtesting-pi-slave:
148           slave: '{slave}'
149     builders:
150       - xtesting-pi-pull-containers:
151           <<: *xtesting-pi-containers
152
153 - project:
154     name: 'xtesting-pi-ollivier-xtesting-pull'
155     <<: *xtesting-pi-params
156     container: 'xtesting'
157     jobs:
158       - 'xtesting-pi-{repo}-{container}-{tag}-pull'
159
160 - project:
161     name: 'xtesting-pi-ollivier-xtesting-mts-pull'
162     <<: *xtesting-pi-params
163     container: 'xtesting-mts'
164     jobs:
165       - 'xtesting-pi-{repo}-{container}-{tag}-pull'
166
167 - job-template:
168     name: 'xtesting-pi-{repo}-{container}-{tag}-rmi'
169     parameters:
170       - xtesting-pi-slave:
171           slave: '{slave}'
172     builders:
173       - xtesting-pi-remove-images:
174           <<: *xtesting-pi-containers
175
176 - project:
177     name: 'xtesting-pi-ollivier-xtesting-rmi'
178     <<: *xtesting-pi-params
179     container: 'xtesting'
180     jobs:
181       - 'xtesting-pi-{repo}-{container}-{tag}-rmi'
182
183 - project:
184     name: 'xtesting-pi-ollivier-xtesting-mts-rmi'
185     <<: *xtesting-pi-params
186     container: 'xtesting-mts'
187     jobs:
188       - 'xtesting-pi-{repo}-{container}-{tag}-rmi'
189
190 - job-template:
191     name: 'xtesting-pi-ollivier-xtesting-{tag}-{test}-run'
192     parameters:
193       - xtesting-pi-slave:
194           slave: '{slave}'
195       - xtesting-pi-build_tag:
196           build_tag: ''
197     builders:
198       - xtesting-pi-run-containers:
199           <<: *xtesting-pi-run-containers
200
201 - project:
202     name: 'xtesting-pi-ollivier-xtesting'
203     <<: *xtesting-pi-params
204     volumes:
205     env:
206     container: 'xtesting'
207     test:
208       - first
209       - second
210       - third
211       - fourth
212       - fifth
213       - sixth
214       - eighth
215     privileged: 'false'
216     network: bridge
217     exclude:
218       - tag: leguer
219         test: eighth
220       - tag: kali
221         test: eighth
222       - tag: jerma
223         test: eighth
224       - tag: arm-leguer
225         test: eighth
226       - tag: arm-kali
227         test: eighth
228       - tag: arm-jerma
229         test: eighth
230       - tag: arm64-leguer
231         test: eighth
232       - tag: arm64-kali
233         test: eighth
234       - tag: arm64-jerma
235         test: eighth
236     jobs:
237       - 'xtesting-pi-ollivier-xtesting-{tag}-{test}-run'
238
239 - job-template:
240     name: 'xtesting-pi-ollivier-xtesting-mts-{tag}-{test}-run'
241     parameters:
242       - xtesting-pi-slave:
243           slave: '{slave}'
244       - xtesting-pi-build_tag:
245           build_tag: ''
246     builders:
247       - xtesting-pi-run-containers:
248           <<: *xtesting-pi-run-containers
249
250 - project:
251     name: 'xtesting-pi-ollivier-xtesting-mts'
252     <<: *xtesting-pi-params
253     volumes:
254     env:
255     container: 'xtesting-mts'
256     test:
257       - seventh
258     privileged: 'false'
259     network: bridge
260     jobs:
261       - 'xtesting-pi-ollivier-xtesting-mts-{tag}-{test}-run'
262
263 - builder:
264     name: xtesting-pi-zip
265     builders:
266       - shell: |
267           set +x
268           volumes=;
269           if [ "{volumes}" != "None" ]; then
270             for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
271               do volumes="-v $i $volumes"; done
272           fi
273           env=;
274           if [ "{env}" != "None" ]; then
275             for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
276               do env="-e $i $env"; done
277           fi
278           [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
279           if [ "{repo}" = "_" ]; then
280             image={container}:{tag}
281           elif [ "{port}" = "None" ]; then
282             image={repo}/{container}:{tag}
283           else
284             image={repo}:{port}/{container}:{tag}
285           fi
286           sudo docker run --rm \
287             $volumes \
288             $env \
289             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
290             -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
291             -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
292             -v /home/opnfv/xtesting/.boto:/root/.boto \
293             -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
294             -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
295             -e BUILD_TAG=$BUILD_TAG \
296             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
297             $image zip_campaign
298
299 - job-template:
300     name: 'xtesting-pi-{tag}-zip'
301     parameters:
302       - xtesting-pi-slave:
303           slave: '{slave}'
304       - xtesting-pi-build_tag:
305           build_tag: ''
306     builders:
307       - xtesting-pi-zip:
308           <<: *xtesting-pi-containers
309           volumes: '{volumes}'
310           env: '{env}'
311
312 - project:
313     name: 'xtesting-pi-{tag}-zip'
314     <<: *xtesting-pi-params
315     volumes:
316     env:
317     container: 'xtesting'
318     jobs:
319       - 'xtesting-pi-{tag}-zip'
320
321 - job-template:
322     name: 'xtesting-pi-{tag}-daily'
323     project-type: multijob
324     triggers:
325       - timed: '@daily'
326     parameters:
327       - xtesting-pi-slave:
328           slave: '{slave}'
329       - xtesting-pi-build_tag:
330           build_tag: ''
331     # PyYAML and yamllint differ here
332     # see https://github.com/yaml/pyyaml/issues/234
333     # yamllint disable rule:indentation
334     properties:
335       - build-blocker:
336           blocking-jobs:
337           - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
338     # yamllint enable rule:indentation
339     builders:
340       - multijob:
341           name: remove former images
342           projects:
343             - name: 'xtesting-pi-ollivier-xtesting-{tag}-rmi'
344               <<: *xtesting-pi-jobs
345             - name: 'xtesting-pi-ollivier-xtesting-mts-{tag}-rmi'
346               <<: *xtesting-pi-jobs
347       - multijob:
348           name: pull containers
349           projects:
350             - name: 'xtesting-pi-ollivier-xtesting-{tag}-pull'
351               <<: *xtesting-pi-jobs
352             - name: 'xtesting-pi-ollivier-xtesting-mts-{tag}-pull'
353               <<: *xtesting-pi-jobs
354       - multijob:
355           name: ollivier/xtesting:{tag}
356           projects:
357             - name: 'xtesting-pi-ollivier-xtesting-{tag}-first-run'
358               <<: *xtesting-pi-jobs
359             - name: 'xtesting-pi-ollivier-xtesting-{tag}-second-run'
360               <<: *xtesting-pi-jobs
361             - name: 'xtesting-pi-ollivier-xtesting-{tag}-third-run'
362               <<: *xtesting-pi-jobs
363             - name: 'xtesting-pi-ollivier-xtesting-{tag}-fourth-run'
364               <<: *xtesting-pi-jobs
365             - name: 'xtesting-pi-ollivier-xtesting-{tag}-fifth-run'
366               <<: *xtesting-pi-jobs
367             - name: 'xtesting-pi-ollivier-xtesting-{tag}-sixth-run'
368               <<: *xtesting-pi-jobs
369             - name: 'xtesting-pi-ollivier-xtesting-{tag}-eighth-run'
370               <<: *xtesting-pi-jobs
371       - multijob:
372           name: ollivier/xtesting-mts:{tag}
373           projects:
374             - name: 'xtesting-pi-ollivier-xtesting-mts-{tag}-seventh-run'
375               <<: *xtesting-pi-jobs
376       - multijob:
377           name: dump all campaign data
378           projects:
379             - name: 'xtesting-pi-{tag}-zip'
380               <<: *xtesting-pi-jobs
381
382 - project:
383     name: 'xtesting-pi-daily'
384     <<: *xtesting-pi-params
385     jobs:
386       - 'xtesting-pi-{tag}-daily'
387
388 - view:
389     name: xtesting-pi
390     view-type: list
391     columns:
392       - status
393       - weather
394       - job
395       - last-success
396       - last-failure
397       - last-duration
398     regex: ^xtesting-pi-[a-z-0-9.]+-daily$