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