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