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