Merge "[Daisy] Add docker image tarball builder"
[releng.git] / jjb / releng / functest-docker.yml
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       - euphrates:
16           branch: 'stable/{stream}'
17           disabled: false
18
19     arch_tag:
20       - 'amd64':
21           slave_label: 'opnfv-build-ubuntu'
22       - 'arm64':
23           slave_label: 'opnfv-build-ubuntu-arm'
24
25     # yamllint disable rule:key-duplicates
26     image:
27       - 'core'
28       - 'healthcheck'
29       - 'features'
30       - 'components'
31       - 'parser'
32       - 'smoke'
33       - 'vnf'
34       - 'restapi'
35
36     # settings for jobs run in multijob phases
37     build-job-settings: &build-job-settings
38       current-parameters: false
39       git-revision: true
40       node-parameters: true
41       predefined-parameters: |
42         PUSH_IMAGE=$PUSH_IMAGE
43         COMMIT_ID=$COMMIT_ID
44         RELEASE_VERSION=$RELEASE_VERSION
45         DOCKERFILE=$DOCKERFILE
46         ARCH_TAG=$ARCH_TAG
47       kill-phase-on: FAILURE
48       abort-all-jobs: false
49
50     manifest-job-settings: &manifest-job-settings
51       current-parameters: false
52       git-revision: true
53       node-parameters: true
54       predefined-parameters: |
55         RELEASE_VERSION=$RELEASE_VERSION
56         ARCH_TAG=$ARCH_TAG
57       kill-phase-on: FAILURE
58       abort-all-jobs: false
59
60     # yamllint enable rule:key-duplicates
61     jobs:
62       - "functest-docker-build-push-{arch_tag}-{stream}"
63       - "functest-{image}-build-push-{arch_tag}-{stream}"
64       - "functest-{image}-create-manifest-{arch_tag}-{stream}"
65 ########################
66 # job templates
67 ########################
68 - job-template:
69     name: 'functest-docker-build-push-{arch_tag}-{stream}'
70
71     project-type: multijob
72
73     disabled: '{obj:disabled}'
74
75     parameters:
76       - job-parameters:
77           project: '{project}'
78           branch: '{branch}'
79           slave_label: '{slave_label}'
80           arch_tag: '{arch_tag}'
81       - string:
82           name: ARCH_TAG
83           default: "{arch_tag}"
84           description: "If set, this value will be added to the docker image tag as a prefix"
85
86     properties:
87       - throttle:
88           max-per-node: 1
89           option: 'project'
90
91     scm:
92       - git-scm
93
94     triggers:
95       - pollscm:
96           cron: "*/30 * * * *"
97
98     builders:
99       - multijob:
100           name: 'build-base-img-create-manifest'
101           execution-type: SEQUENTIAL
102           projects:
103             - name: 'functest-core-build-push-{stream}'
104               <<: *build-job-settings
105             - name: 'functest-core-create-manifest-{stream}'
106               <<: *manifest-job-settings
107       - multijob:
108           name: 'build-child-img'
109           condition: SUCCESSFUL
110           execution-type: PARALLEL
111           projects:
112             - name: 'functest-healthcheck-build-push-{stream}'
113               <<: *build-job-settings
114             - name: 'functest-features-build-push-{stream}'
115               <<: *build-job-settings
116             - name: 'functest-components-build-push-{stream}'
117               <<: *build-job-settings
118             - name: 'functest-parser-build-push-{stream}'
119               <<: *build-job-settings
120             - name: 'functest-smoke-build-push-{stream}'
121               <<: *build-job-settings
122             - name: 'functest-vnf-build-push-{stream}'
123               <<: *build-job-settings
124             - name: 'functest-restapi-build-push-{stream}'
125               <<: *build-job-settings
126       - multijob:
127           name: 'create-img-manifest'
128           condition: SUCCESSFUL
129           execution-type: PARALLEL
130           projects:
131             - name: 'functest-healthcheck-create-manifest-{stream}'
132               <<: *manifest-job-settings
133             - name: 'functest-features-create-manifest-{stream}'
134               <<: *manifest-job-settings
135             - name: 'functest-components-create-manifest-{stream}'
136               <<: *manifest-job-settings
137             - name: 'functest-parser-create-manifest-{stream}'
138               <<: *manifest-job-settings
139             - name: 'functest-smoke-create-manifest-{stream}'
140               <<: *manifest-job-settings
141             - name: 'functest-vnf-create-manifest-{stream}'
142               <<: *manifest-job-settings
143             - name: 'functest-restapi-create-manifest-{stream}'
144               <<: *manifest-job-settings
145
146     publishers:
147       - 'functest-{arch_tag}-recipients'
148
149 - job-template:
150
151     name: 'functest-{image}-build-push-{arch_tag}-{stream}'
152
153     disabled: '{obj:disabled}'
154
155     parameters:
156       - job-parameters:
157           project: '{project}'
158           branch: '{branch}'
159           slave_label: '{slave_label}'
160           arch_tag: '{arch_tag}'
161       - string:
162           name: DOCKER_REPO_NAME
163           default: "opnfv/functest-{image}"
164           description: "Dockerhub repo to be pushed to."
165       - string:
166           name: DOCKER_DIR
167           default: "docker/{image}"
168           description: "Directory containing files needed by the Dockerfile"
169
170     builders:
171       - shell:
172           !include-raw-escape: ./opnfv-docker.sh
173
174 - job-template:
175
176     name: 'functest-{image}-create-manifest-{arch_tag}-{stream}'
177
178     disabled: '{obj:disabled}'
179
180     parameters:
181       - job-parameters:
182           project: '{project}'
183           branch: '{branch}'
184           slave_label: '{slave_label}'
185           arch_tag: '{arch_tag}'
186       - string:
187           name: DOCKER_REPO_NAME
188           default: "opnfv/functest-{image}"
189           description: "Dockerhub repo to be pushed to."
190       - string:
191           name: DOCKER_DIR
192           default: "docker/{image}"
193           description: "Directory containing files needed by the Dockerfile"
194
195     builders:
196       - shell:
197           !include-raw-escape: ./opnfv-manifest.sh
198
199 # parameter macro
200 - parameter:
201     name: job-parameters
202     parameters:
203       - project-parameter:
204           project: '{project}'
205           branch: '{branch}'
206       - label:
207           name: SLAVE_LABEL
208           default: '{slave_label}'
209           description: 'Slave label on Jenkins'
210       - string:
211           name: GIT_BASE
212           default: https://gerrit.opnfv.org/gerrit/$PROJECT
213           description: 'Git URL to use on this Jenkins Slave'
214       - string:
215           name: PUSH_IMAGE
216           default: "true"
217           description: "To enable/disable pushing the image to Dockerhub."
218       - string:
219           name: COMMIT_ID
220           default: ""
221           description: "commit id to make a snapshot docker image"
222       - string:
223           name: RELEASE_VERSION
224           default: ""
225           description: "Docker tag to be built, e.g. 5.0.0, opnfv-5.0.0, 5.0.RC1"
226       - string:
227           name: DOCKERFILE
228           default: "Dockerfile"
229           description: "Dockerfile to use for creating the image."
230       - string:
231           name: ARCH_TAG
232           default: "{arch_tag}"
233           description: "If set, this value will be added to the docker image tag as a prefix"
234       - string:
235           name: PROJECT
236           default: "{project}"
237           description: "Project name used to enable job conditions"
238
239 # publisher macros
240 - publisher:
241     name: 'functest-arm64-recipients'
242     publishers:
243       - email:
244           recipients: >
245             cristina.pauna@enea.com
246             alexandru.avadanii@enea.com
247             delia.popescu@enea.com
248
249 - publisher:
250     name: 'functest-amd64-recipients'
251     publishers:
252       - email:
253           recipients: >
254             jalausuch@suse.com morgan.richomme@orange.com
255             cedric.ollivier@orange.com feng.xiaowei@zte.com.cn
256             juha.kosonen@nokia.com wangwulin@huawei.com