Adds StorPerf Iruya branch
[releng.git] / jjb / functest / functest-docker.yaml
1 ---
2 ##############################################
3 # job configuration for docker build and push
4 ##############################################
5 - project:
6
7     name: functest-docker
8
9     project: functest
10
11     stream:
12       - master:
13           branch: '{stream}'
14           disabled: false
15       - jerma:
16           branch: 'stable/{stream}'
17           disabled: false
18       - iruya:
19           branch: 'stable/{stream}'
20           disabled: false
21       - hunter:
22           branch: 'stable/{stream}'
23           disabled: false
24
25     arch_tag:
26       - 'amd64':
27           slave_label: 'opnfv-build-ubuntu'
28       - 'arm64':
29           slave_label: 'opnfv-build-ubuntu-arm'
30
31     # yamllint disable rule:key-duplicates
32     image:
33       - 'core'
34       - 'tempest'
35       - 'healthcheck'
36       - 'smoke'
37       - 'benchmarking'
38       - 'vnf'
39       - 'smoke-cntt'
40       - 'benchmarking-cntt'
41       - 'features'
42
43     exclude:
44       - stream: 'master'
45         image: 'tempest'
46       - stream: 'jerma'
47         image: 'tempest'
48       - stream: 'master'
49         image: 'features'
50       - stream: 'jerma'
51         image: 'features'
52       - stream: 'iruya'
53         image: 'features'
54
55     # settings for jobs run in multijob phases
56     build-job-settings: &build-job-settings
57       current-parameters: false
58       git-revision: true
59       node-parameters: false
60       predefined-parameters: |
61         PUSH_IMAGE=$PUSH_IMAGE
62         COMMIT_ID=$COMMIT_ID
63         GERRIT_REFNAME=$GERRIT_REFNAME
64         DOCKERFILE=$DOCKERFILE
65       kill-phase-on: FAILURE
66       abort-all-jobs: false
67
68     manifest-job-settings: &manifest-job-settings
69       current-parameters: false
70       git-revision: true
71       node-parameters: false
72       predefined-parameters:
73         GERRIT_REFNAME=$GERRIT_REFNAME
74       kill-phase-on: FAILURE
75       abort-all-jobs: false
76
77     # yamllint enable rule:key-duplicates
78     jobs:
79       - "functest-docker-{stream}"
80       - "functest-{image}-docker-build-{arch_tag}-{stream}"
81       - "functest-{image}-docker-manifest-{stream}"
82
83 ########################
84 # job templates
85 ########################
86 - job-template:
87     name: 'functest-docker-{stream}'
88
89     project-type: multijob
90
91     disabled: '{obj:disabled}'
92
93     parameters:
94       - functest-job-parameters:
95           project: '{project}'
96           branch: '{branch}'
97           slave_label: 'opnfv-build-ubuntu'
98           arch_tag: 'amd64'
99
100     properties:
101       - throttle:
102           max-per-node: 1
103           option: 'project'
104
105     scm:
106       - git-scm
107
108     triggers:
109       - pollscm:
110           cron: "*/30 * * * *"
111       - gerrit-trigger-tag-created:
112           project: '{project}'
113
114     builders:
115       - multijob:
116           name: 'build functest-core images'
117           execution-type: PARALLEL
118           projects:
119             - name: 'functest-core-docker-build-amd64-{stream}'
120               <<: *build-job-settings
121             - name: 'functest-core-docker-build-arm64-{stream}'
122               <<: *build-job-settings
123       - multijob:
124           name: 'publish functest-core manifests'
125           execution-type: PARALLEL
126           projects:
127             - name: 'functest-core-docker-manifest-{stream}'
128               <<: *manifest-job-settings
129       - multijob:
130           name: 'build functest-tempest images'
131           execution-type: PARALLEL
132           projects:
133             - name: 'functest-tempest-docker-build-amd64-{stream}'
134               <<: *build-job-settings
135             - name: 'functest-tempest-docker-build-arm64-{stream}'
136               <<: *build-job-settings
137       - multijob:
138           name: 'publish functest-tempest manifests'
139           execution-type: PARALLEL
140           projects:
141             - name: 'functest-tempest-docker-manifest-{stream}'
142               <<: *manifest-job-settings
143       - multijob:
144           name: 'build all functest images'
145           condition: SUCCESSFUL
146           execution-type: PARALLEL
147           projects:
148             - name: 'functest-healthcheck-docker-build-amd64-{stream}'
149               <<: *build-job-settings
150             - name: 'functest-healthcheck-docker-build-arm64-{stream}'
151               <<: *build-job-settings
152             - name: 'functest-smoke-docker-build-amd64-{stream}'
153               <<: *build-job-settings
154             - name: 'functest-smoke-docker-build-arm64-{stream}'
155               <<: *build-job-settings
156             - name: 'functest-benchmarking-docker-build-amd64-{stream}'
157               <<: *build-job-settings
158             - name: 'functest-benchmarking-docker-build-arm64-{stream}'
159               <<: *build-job-settings
160             - name: 'functest-vnf-docker-build-amd64-{stream}'
161               <<: *build-job-settings
162             - name: 'functest-vnf-docker-build-arm64-{stream}'
163               <<: *build-job-settings
164             - name: 'functest-features-docker-build-amd64-{stream}'
165               <<: *build-job-settings
166             - name: 'functest-features-docker-build-arm64-{stream}'
167               <<: *build-job-settings
168       - multijob:
169           name: 'publish all manifests'
170           condition: SUCCESSFUL
171           execution-type: PARALLEL
172           projects:
173             - name: 'functest-healthcheck-docker-manifest-{stream}'
174               <<: *manifest-job-settings
175             - name: 'functest-smoke-docker-manifest-{stream}'
176               <<: *manifest-job-settings
177             - name: 'functest-benchmarking-docker-manifest-{stream}'
178               <<: *manifest-job-settings
179             - name: 'functest-vnf-docker-manifest-{stream}'
180               <<: *manifest-job-settings
181             - name: 'functest-features-docker-manifest-{stream}'
182               <<: *manifest-job-settings
183       - multijob:
184           name: 'build all functest cntt images'
185           condition: SUCCESSFUL
186           execution-type: PARALLEL
187           projects:
188             - name: 'functest-smoke-cntt-docker-build-amd64-{stream}'
189               <<: *build-job-settings
190             - name: 'functest-smoke-cntt-docker-build-arm64-{stream}'
191               <<: *build-job-settings
192             - name: 'functest-benchmarking-cntt-docker-build-amd64-{stream}'
193               <<: *build-job-settings
194             - name: 'functest-benchmarking-cntt-docker-build-arm64-{stream}'
195               <<: *build-job-settings
196       - multijob:
197           name: 'publish all cntt manifests'
198           condition: SUCCESSFUL
199           execution-type: PARALLEL
200           projects:
201             - name: 'functest-smoke-cntt-docker-manifest-{stream}'
202               <<: *manifest-job-settings
203             - name: 'functest-benchmarking-cntt-docker-manifest-{stream}'
204               <<: *manifest-job-settings
205
206     publishers:
207       - 'functest-amd64-recipients'
208       - 'functest-arm64-recipients'
209
210 - job-template:
211     name: 'functest-{image}-docker-build-{arch_tag}-{stream}'
212     disabled: '{obj:disabled}'
213     parameters:
214       - functest-job-parameters:
215           project: '{project}'
216           branch: '{branch}'
217           slave_label: '{slave_label}'
218           arch_tag: '{arch_tag}'
219     scm:
220       - git-scm
221     builders:
222       - shell: |
223           #!/bin/bash -ex
224           case "{arch_tag}" in
225           "arm64")
226               sudo amd64_dirs= arm64_dirs=docker/{image} arm_dirs= bash ./build.sh ;;
227           *)
228               sudo amd64_dirs=docker/{image} arm64_dirs= arm_dirs= bash ./build.sh ;;
229           esac
230           exit $?
231
232 - job-template:
233     name: 'functest-{image}-docker-manifest-{stream}'
234
235     parameters:
236       - project-parameter:
237           project: '{project}'
238           branch: '{branch}'
239       - label:
240           name: SLAVE_LABEL
241           default: 'opnfv-build-ubuntu'
242           description: 'Slave label on Jenkins'
243           all-nodes: false
244           node-eligibility: 'ignore-offline'
245       - string:
246           name: PROJECT
247           default: "{project}"
248           description: "Project name used to enable job conditions"
249       - string:
250           name: GIT_BASE
251           default: https://gerrit.opnfv.org/gerrit/$PROJECT
252           description: 'Git URL to use on this Jenkins Slave'
253       - string:
254           name: REPO
255           default: "opnfv"
256           description: "Repository name for functest images"
257
258
259     disabled: '{obj:disabled}'
260
261     builders:
262       - shell: |
263           #!/bin/bash -ex
264           case "{stream}" in
265           "master")
266               tag="latest" ;;
267           *)
268               tag="{stream}" ;;
269           esac
270           sudo manifest-tool push from-args \
271               --platforms linux/amd64,linux/arm64 \
272               --template $REPO/functest-{image}:ARCH-$tag \
273               --target $REPO/functest-{image}:$tag
274           exit $?
275
276 # parameter macro
277 - parameter:
278     name: functest-job-parameters
279     parameters:
280       - project-parameter:
281           project: '{project}'
282           branch: '{branch}'
283       - label:
284           name: SLAVE_LABEL
285           default: '{slave_label}'
286           description: 'Slave label on Jenkins'
287           all-nodes: false
288           node-eligibility: 'ignore-offline'
289       - string:
290           name: GIT_BASE
291           default: https://gerrit.opnfv.org/gerrit/$PROJECT
292           description: 'Git URL to use on this Jenkins Slave'
293       - string:
294           name: PUSH_IMAGE
295           default: "true"
296           description: "To enable/disable pushing the image to Dockerhub."
297       - string:
298           name: COMMIT_ID
299           default: ""
300           description: "commit id to make a snapshot docker image"
301       - string:
302           name: GERRIT_REFNAME
303           default: ""
304           description: "Docker tag to be built, e.g. refs/tags/5.0.0, refs/tags/opnfv-5.0.0, refs/tags/5.0.RC1"
305       - string:
306           name: DOCKERFILE
307           default: "Dockerfile"
308           description: "Dockerfile to use for creating the image."
309       - string:
310           name: ARCH_TAG
311           default: "{arch_tag}"
312           description: "If set, this value will be added to the docker image tag as a prefix"
313       - string:
314           name: PROJECT
315           default: "{project}"
316           description: "Project name used to enable job conditions"
317       - string:
318           name: REPO
319           default: "opnfv"
320           description: "Repository name for functest images"
321
322 # publisher macros
323 - publisher:
324     name: 'functest-arm64-recipients'
325     publishers:
326       - email:
327           recipients: >
328             cristina.pauna@enea.com
329             alexandru.avadanii@enea.com
330             delia.popescu@enea.com
331
332 - publisher:
333     name: 'functest-amd64-recipients'
334     publishers:
335       - email:
336           recipients: >
337             jalausuch@suse.com morgan.richomme@orange.com
338             cedric.ollivier@orange.com feng.xiaowei@zte.com.cn
339             juha.kosonen@nokia.com wangwulin@huawei.com
340             valentin.boucher@kontron.com