Remove branch if pure daily jobs
[releng.git] / jjb / functest / xtesting-pi.yaml
1 ---
2 - xtesting-pi-jobs: &xtesting-pi-jobs
3     name: 'xtesting-pi-jobs'
4     current-parameters: true
5
6 - xtesting-pi-params: &xtesting-pi-params
7     name: 'xtesting-pi-params'
8     repo: 'ollivier'
9     port:
10     tag:
11       - latest:
12           slave: lf-virtual1
13       - leguer:
14           slave: lf-virtual1
15       - kali:
16           slave: lf-virtual1
17       - jerma:
18           slave: lf-virtual1
19       - iruya:
20           slave: lf-virtual1
21       - hunter:
22           slave: lf-virtual1
23       - arm-latest:
24           slave: lf-virtual1
25       - arm-leguer:
26           slave: lf-virtual1
27       - arm-kali:
28           slave: lf-virtual1
29       - arm-jerma:
30           slave: lf-virtual1
31       - arm-iruya:
32           slave: lf-virtual1
33       - arm-hunter:
34           slave: lf-virtual1
35       - arm64-latest:
36           slave: lf-virtual1
37       - arm64-leguer:
38           slave: lf-virtual1
39       - arm64-kali:
40           slave: lf-virtual1
41       - arm64-jerma:
42           slave: lf-virtual1
43       - arm64-iruya:
44           slave: lf-virtual1
45       - arm64-hunter:
46           slave: lf-virtual1
47
48 - parameter:
49     name: xtesting-pi-slave
50     parameters:
51       - label:
52           name: slave
53           default: '{slave}'
54
55 - parameter:
56     name: xtesting-pi-build_tag
57     parameters:
58       - random-string:
59           name: build_tag
60
61
62 - xtesting-pi-containers: &xtesting-pi-containers
63     name: 'xtesting-pi-containers'
64     repo: '{repo}'
65     port: '{port}'
66     container: '{container}'
67     tag: '{tag}'
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
132 - job-template:
133     name: 'xtesting-pi-{repo}-{container}-{tag}-pull'
134     parameters:
135       - xtesting-pi-slave:
136           slave: '{slave}'
137     builders:
138       - xtesting-pi-pull-containers:
139           <<: *xtesting-pi-containers
140
141 - project:
142     name: 'xtesting-pi-ollivier-xtesting-pull'
143     <<: *xtesting-pi-params
144     container: 'xtesting'
145     jobs:
146       - 'xtesting-pi-{repo}-{container}-{tag}-pull'
147
148 - project:
149     name: 'xtesting-pi-ollivier-xtesting-mts-pull'
150     <<: *xtesting-pi-params
151     container: 'xtesting-mts'
152     jobs:
153       - 'xtesting-pi-{repo}-{container}-{tag}-pull'
154
155 - job-template:
156     name: 'xtesting-pi-{repo}-{container}-{tag}-rmi'
157     parameters:
158       - xtesting-pi-slave:
159           slave: '{slave}'
160     builders:
161       - xtesting-pi-remove-images:
162           <<: *xtesting-pi-containers
163
164 - project:
165     name: 'xtesting-pi-ollivier-xtesting-rmi'
166     <<: *xtesting-pi-params
167     container: 'xtesting'
168     jobs:
169       - 'xtesting-pi-{repo}-{container}-{tag}-rmi'
170
171 - project:
172     name: 'xtesting-pi-ollivier-xtesting-mts-rmi'
173     <<: *xtesting-pi-params
174     container: 'xtesting-mts'
175     jobs:
176       - 'xtesting-pi-{repo}-{container}-{tag}-rmi'
177
178 - job-template:
179     name: 'xtesting-pi-{repo}-{container}-{tag}-{test}-run'
180     parameters:
181       - xtesting-pi-slave:
182           slave: '{slave}'
183       - xtesting-pi-build_tag:
184           build_tag: ''
185     builders:
186       - xtesting-pi-run-containers:
187           <<: *xtesting-pi-run-containers
188
189 - project:
190     name: 'xtesting-pi-ollivier-xtesting'
191     <<: *xtesting-pi-params
192     container: 'xtesting'
193     test:
194       - first
195       - second
196       - third
197       - fourth
198       - fifth
199       - sixth
200     privileged: 'false'
201     network: bridge
202     jobs:
203       - 'xtesting-pi-{repo}-{container}-{tag}-{test}-run'
204
205 - project:
206     name: 'xtesting-pi-ollivier-xtesting-mts'
207     <<: *xtesting-pi-params
208     container: 'xtesting-mts'
209     test:
210       - seventh
211     privileged: 'false'
212     network: bridge
213     jobs:
214       - 'xtesting-pi-{repo}-{container}-{tag}-{test}-run'
215
216
217 - builder:
218     name: xtesting-pi-zip
219     builders:
220       - shell: |
221           set +x
222           if [ "{repo}" = "_" ]; then
223             image={container}:{tag}
224           elif [ "{port}" = "None" ]; then
225             image={repo}/{container}:{tag}
226           else
227             image={repo}:{port}/{container}:{tag}
228           fi
229           sudo docker run --rm \
230             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
231             -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
232             -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
233             -v /home/opnfv/xtesting/.boto:/root/.boto \
234             -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
235             -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
236             -e BUILD_TAG=$BUILD_TAG \
237             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
238             $image zip_campaign
239
240 - job-template:
241     name: 'xtesting-pi-{tag}-zip'
242     parameters:
243       - xtesting-pi-slave:
244           slave: '{slave}'
245       - xtesting-pi-build_tag:
246           build_tag: ''
247     builders:
248       - xtesting-pi-zip:
249           <<: *xtesting-pi-containers
250
251 - project:
252     name: 'xtesting-pi-{tag}-zip'
253     <<: *xtesting-pi-params
254     container: 'xtesting'
255     jobs:
256       - 'xtesting-pi-{tag}-zip'
257
258 - job-template:
259     name: 'xtesting-pi-{tag}-daily'
260     project-type: multijob
261     triggers:
262       - timed: '@daily'
263     parameters:
264       - xtesting-pi-slave:
265           slave: '{slave}'
266       - xtesting-pi-build_tag:
267           build_tag: ''
268     properties:
269       - build-blocker:
270           use-build-blocker: true
271           blocking-level: 'NODE'
272           blocking-jobs:
273             - '^xtesting-pi-{tag}-(daily|docker|review)$'
274     builders:
275       - multijob:
276           name: remove former images
277           projects:
278             - name: 'xtesting-pi-ollivier-xtesting-{tag}-rmi'
279               <<: *xtesting-pi-jobs
280             - name: 'xtesting-pi-ollivier-xtesting-mts-{tag}-rmi'
281               <<: *xtesting-pi-jobs
282       - multijob:
283           name: pull containers
284           projects:
285             - name: 'xtesting-pi-ollivier-xtesting-{tag}-pull'
286               <<: *xtesting-pi-jobs
287             - name: 'xtesting-pi-ollivier-xtesting-mts-{tag}-pull'
288               <<: *xtesting-pi-jobs
289       - multijob:
290           name: ollivier/xtesting:{tag}
291           projects:
292             - name: 'xtesting-pi-ollivier-xtesting-{tag}-first-run'
293               <<: *xtesting-pi-jobs
294             - name: 'xtesting-pi-ollivier-xtesting-{tag}-second-run'
295               <<: *xtesting-pi-jobs
296             - name: 'xtesting-pi-ollivier-xtesting-{tag}-third-run'
297               <<: *xtesting-pi-jobs
298             - name: 'xtesting-pi-ollivier-xtesting-{tag}-fourth-run'
299               <<: *xtesting-pi-jobs
300             - name: 'xtesting-pi-ollivier-xtesting-{tag}-fifth-run'
301               <<: *xtesting-pi-jobs
302             - name: 'xtesting-pi-ollivier-xtesting-{tag}-sixth-run'
303               <<: *xtesting-pi-jobs
304       - multijob:
305           name: ollivier/xtesting-mts:{tag}
306           projects:
307             - name: 'xtesting-pi-ollivier-xtesting-mts-{tag}-seventh-run'
308               <<: *xtesting-pi-jobs
309       - multijob:
310           name: dump all campaign data
311           projects:
312             - name: 'xtesting-pi-{tag}-zip'
313               <<: *xtesting-pi-jobs
314
315 - project:
316     name: 'xtesting-pi-daily'
317     <<: *xtesting-pi-params
318     jobs:
319       - 'xtesting-pi-{tag}-daily'
320
321 - view:
322     name: xtesting-pi
323     view-type: list
324     columns:
325       - status
326       - weather
327       - job
328       - last-success
329       - last-failure
330       - last-duration
331     regex: ^xtesting-pi-[a-z-0-9]+-daily$