Merge "Add build triggers and source code management"
[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     scm:
171       - git-scm
172
173     triggers:
174       - pollscm:
175           cron: "*/30 * * * *"
176
177     publishers:
178       - 'functest-{arch_tag}-recipients'
179
180     builders:
181       - shell:
182           !include-raw-escape: ./opnfv-docker.sh
183
184 - job-template:
185
186     name: 'functest-{image}-create-manifest-{arch_tag}-{stream}'
187
188     disabled: '{obj:disabled}'
189
190     parameters:
191       - job-parameters:
192           project: '{project}'
193           branch: '{branch}'
194           slave_label: '{slave_label}'
195           arch_tag: '{arch_tag}'
196       - string:
197           name: DOCKER_REPO_NAME
198           default: "opnfv/functest-{image}"
199           description: "Dockerhub repo to be pushed to."
200       - string:
201           name: DOCKER_DIR
202           default: "docker/{image}"
203           description: "Directory containing files needed by the Dockerfile"
204
205     builders:
206       - shell:
207           !include-raw-escape: ./opnfv-manifest.sh
208
209     scm:
210       - git-scm
211
212     triggers:
213       - pollscm:
214           cron: "*/30 * * * *"
215
216     publishers:
217       - 'functest-{arch_tag}-recipients'
218
219 # parameter macro
220 - parameter:
221     name: job-parameters
222     parameters:
223       - project-parameter:
224           project: '{project}'
225           branch: '{branch}'
226       - label:
227           name: SLAVE_LABEL
228           default: '{slave_label}'
229           description: 'Slave label on Jenkins'
230       - string:
231           name: GIT_BASE
232           default: https://gerrit.opnfv.org/gerrit/$PROJECT
233           description: 'Git URL to use on this Jenkins Slave'
234       - string:
235           name: PUSH_IMAGE
236           default: "true"
237           description: "To enable/disable pushing the image to Dockerhub."
238       - string:
239           name: COMMIT_ID
240           default: ""
241           description: "commit id to make a snapshot docker image"
242       - string:
243           name: RELEASE_VERSION
244           default: ""
245           description: "Docker tag to be built, e.g. 5.0.0, opnfv-5.0.0, 5.0.RC1"
246       - string:
247           name: DOCKERFILE
248           default: "Dockerfile"
249           description: "Dockerfile to use for creating the image."
250       - string:
251           name: ARCH_TAG
252           default: "{arch_tag}"
253           description: "If set, this value will be added to the docker image tag as a prefix"
254       - string:
255           name: PROJECT
256           default: "{project}"
257           description: "Project name used to enable job conditions"
258
259 # publisher macros
260 - publisher:
261     name: 'functest-arm64-recipients'
262     publishers:
263       - email:
264           recipients: >
265             cristina.pauna@enea.com
266             alexandru.avadanii@enea.com
267             delia.popescu@enea.com
268
269 - publisher:
270     name: 'functest-amd64-recipients'
271     publishers:
272       - email:
273           recipients: >
274             jalausuch@suse.com morgan.richomme@orange.com
275             cedric.ollivier@orange.com feng.xiaowei@zte.com.cn
276             juha.kosonen@nokia.com wangwulin@huawei.com