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