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