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