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