Exlude tempest if leguer
[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: 'leguer'
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       - multijob:
132           name: 'publish functest-core manifests'
133           execution-type: PARALLEL
134           projects:
135             - name: 'functest-core-docker-manifest-{stream}'
136               <<: *manifest-job-settings
137       - multijob:
138           name: 'build functest-tempest images'
139           execution-type: PARALLEL
140           projects:
141             - name: 'functest-tempest-docker-build-amd64-{stream}'
142               <<: *build-job-settings
143       - multijob:
144           name: 'publish functest-tempest manifests'
145           execution-type: PARALLEL
146           projects:
147             - name: 'functest-tempest-docker-manifest-{stream}'
148               <<: *manifest-job-settings
149       - multijob:
150           name: 'build all functest images'
151           condition: SUCCESSFUL
152           execution-type: PARALLEL
153           projects:
154             - name: 'functest-healthcheck-docker-build-amd64-{stream}'
155               <<: *build-job-settings
156             - name: 'functest-smoke-docker-build-amd64-{stream}'
157               <<: *build-job-settings
158             - name: 'functest-benchmarking-docker-build-amd64-{stream}'
159               <<: *build-job-settings
160             - name: 'functest-vnf-docker-build-amd64-{stream}'
161               <<: *build-job-settings
162             - name: 'functest-features-docker-build-amd64-{stream}'
163               <<: *build-job-settings
164       - multijob:
165           name: 'publish all manifests'
166           condition: SUCCESSFUL
167           execution-type: PARALLEL
168           projects:
169             - name: 'functest-healthcheck-docker-manifest-{stream}'
170               <<: *manifest-job-settings
171             - name: 'functest-smoke-docker-manifest-{stream}'
172               <<: *manifest-job-settings
173             - name: 'functest-benchmarking-docker-manifest-{stream}'
174               <<: *manifest-job-settings
175             - name: 'functest-vnf-docker-manifest-{stream}'
176               <<: *manifest-job-settings
177             - name: 'functest-features-docker-manifest-{stream}'
178               <<: *manifest-job-settings
179       - multijob:
180           name: 'build all functest cntt images'
181           condition: SUCCESSFUL
182           execution-type: PARALLEL
183           projects:
184             - name: 'functest-smoke-cntt-docker-build-amd64-{stream}'
185               <<: *build-job-settings
186             - name: 'functest-benchmarking-cntt-docker-build-amd64-{stream}'
187               <<: *build-job-settings
188       - multijob:
189           name: 'publish all cntt manifests'
190           condition: SUCCESSFUL
191           execution-type: PARALLEL
192           projects:
193             - name: 'functest-smoke-cntt-docker-manifest-{stream}'
194               <<: *manifest-job-settings
195             - name: 'functest-benchmarking-cntt-docker-manifest-{stream}'
196               <<: *manifest-job-settings
197
198     publishers:
199       - 'functest-amd64-recipients'
200
201 - job-template:
202     name: 'functest-{image}-docker-build-{arch_tag}-{stream}'
203     disabled: '{obj:disabled}'
204     parameters:
205       - functest-job-parameters:
206           project: '{project}'
207           branch: '{branch}'
208           slave_label: '{slave_label}'
209           arch_tag: '{arch_tag}'
210     scm:
211       - git-scm
212     builders:
213       - shell: |
214           #!/bin/bash -ex
215           sudo amd64_dirs=docker/{image} arm64_dirs= arm_dirs= bash ./build.sh
216           exit $?
217
218 - job-template:
219     name: 'functest-{image}-docker-manifest-{stream}'
220
221     parameters:
222       - project-parameter:
223           project: '{project}'
224           branch: '{branch}'
225       - label:
226           name: SLAVE_LABEL
227           default: 'lf-build2'
228           description: 'Slave label on Jenkins'
229           all-nodes: false
230           node-eligibility: 'ignore-offline'
231       - string:
232           name: PROJECT
233           default: "{project}"
234           description: "Project name used to enable job conditions"
235       - string:
236           name: GIT_BASE
237           default: https://gerrit.opnfv.org/gerrit/$PROJECT
238           description: 'Git URL to use on this Jenkins Slave'
239       - string:
240           name: REPO
241           default: "opnfv"
242           description: "Repository name for functest images"
243
244
245     disabled: '{obj:disabled}'
246
247     builders:
248       - shell: |
249           #!/bin/bash -ex
250           case "{stream}" in
251           "master")
252               tag="latest" ;;
253           *)
254               tag="{stream}" ;;
255           esac
256           sudo manifest-tool push from-args \
257               --platforms linux/amd64 \
258               --template $REPO/functest-{image}:ARCH-$tag \
259               --target $REPO/functest-{image}:$tag
260           exit $?
261
262 # parameter macro
263 - parameter:
264     name: functest-job-parameters
265     parameters:
266       - project-parameter:
267           project: '{project}'
268           branch: '{branch}'
269       - label:
270           name: SLAVE_LABEL
271           default: '{slave_label}'
272           description: 'Slave label on Jenkins'
273           all-nodes: false
274           node-eligibility: 'ignore-offline'
275       - string:
276           name: GIT_BASE
277           default: https://gerrit.opnfv.org/gerrit/$PROJECT
278           description: 'Git URL to use on this Jenkins Slave'
279       - string:
280           name: PUSH_IMAGE
281           default: "true"
282           description: "To enable/disable pushing the image to Dockerhub."
283       - string:
284           name: COMMIT_ID
285           default: ""
286           description: "commit id to make a snapshot docker image"
287       - string:
288           name: GERRIT_REFNAME
289           default: ""
290           description: "Docker tag to be built, e.g. refs/tags/5.0.0, refs/tags/opnfv-5.0.0, refs/tags/5.0.RC1"
291       - string:
292           name: DOCKERFILE
293           default: "Dockerfile"
294           description: "Dockerfile to use for creating the image."
295       - string:
296           name: ARCH_TAG
297           default: "{arch_tag}"
298           description: "If set, this value will be added to the docker image tag as a prefix"
299       - string:
300           name: PROJECT
301           default: "{project}"
302           description: "Project name used to enable job conditions"
303       - string:
304           name: REPO
305           default: "opnfv"
306           description: "Repository name for functest images"
307
308 # publisher macros
309 - publisher:
310     name: 'functest-amd64-recipients'
311     publishers:
312       - email:
313           recipients: >
314             jalausuch@suse.com morgan.richomme@orange.com
315             cedric.ollivier@orange.com feng.xiaowei@zte.com.cn
316             juha.kosonen@nokia.com wangwulin@huawei.com
317             valentin.boucher@kontron.com