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