Build functest-xtesting images
[releng.git] / jjb / functest / xtesting-docker.yml
1 ---
2 ##############################################
3 # job configuration for docker build and push
4 ##############################################
5 - project:
6
7     name: xtesting-docker
8
9     project: functest-xtesting
10
11     stream:
12       - master:
13           branch: '{stream}'
14           disabled: false
15
16     arch_tag:
17       - 'amd64':
18           slave_label: 'opnfv-build-ubuntu'
19       - 'arm64':
20           slave_label: 'opnfv-build-ubuntu-arm'
21
22     # settings for jobs run in multijob phases
23     build-job-settings: &build-job-settings
24       current-parameters: false
25       git-revision: true
26       node-parameters: false
27       predefined-parameters: |
28         PUSH_IMAGE=$PUSH_IMAGE
29         COMMIT_ID=$COMMIT_ID
30         GERRIT_REFNAME=$GERRIT_REFNAME
31         DOCKERFILE=$DOCKERFILE
32       kill-phase-on: FAILURE
33       abort-all-jobs: false
34
35     manifest-job-settings: &manifest-job-settings
36       current-parameters: false
37       git-revision: true
38       node-parameters: false
39       predefined-parameters:
40         GERRIT_REFNAME=$GERRIT_REFNAME
41       kill-phase-on: FAILURE
42       abort-all-jobs: false
43
44     # yamllint enable rule:key-duplicates
45     jobs:
46       - "xtesting-docker-{stream}"
47       - "xtesting-docker-build-{arch_tag}-{stream}"
48       - "xtesting-docker-manifest-{stream}"
49
50 ########################
51 # job templates
52 ########################
53 - job-template:
54     name: 'xtesting-docker-{stream}'
55
56     project-type: multijob
57
58     disabled: '{obj:disabled}'
59
60     parameters:
61       - xtesting-job-parameters:
62           project: '{project}'
63           branch: '{branch}'
64           slave_label: 'opnfv-build-ubuntu'
65           arch_tag: 'amd64'
66
67     properties:
68       - throttle:
69           max-per-node: 1
70           option: 'project'
71
72     scm:
73       - git-scm
74
75     triggers:
76       - pollscm:
77           cron: "*/30 * * * *"
78       - gerrit-trigger-tag-created:
79           project: '{project}'
80
81     builders:
82       - multijob:
83           name: 'build xtesting images'
84           execution-type: PARALLEL
85           projects:
86             - name: 'xtesting-docker-build-amd64-{stream}'
87               <<: *build-job-settings
88             - name: 'xtesting-docker-build-arm64-{stream}'
89               <<: *build-job-settings
90       - multijob:
91           name: 'publish xtesting manifests'
92           execution-type: PARALLEL
93           projects:
94             - name: 'xtesting-docker-manifest-{stream}'
95               <<: *manifest-job-settings
96
97     publishers:
98       - 'xtesting-amd64-recipients'
99       - 'xtesting-arm64-recipients'
100
101 - job-template:
102     name: 'xtesting-docker-build-{arch_tag}-{stream}'
103     disabled: '{obj:disabled}'
104     parameters:
105       - xtesting-job-parameters:
106           project: '{project}'
107           branch: '{branch}'
108           slave_label: '{slave_label}'
109           arch_tag: '{arch_tag}'
110     scm:
111       - git-scm
112     builders:
113       - shell: |
114           #!/bin/bash -ex
115           sudo arch={arch_tag} bash ./build.sh
116           exit $?
117
118 - job-template:
119     name: 'xtesting-docker-manifest-{stream}'
120
121     parameters:
122       - project-parameter:
123           project: '{project}'
124           branch: '{branch}'
125       - label:
126           name: SLAVE_LABEL
127           default: 'opnfv-build-ubuntu'
128           description: 'Slave label on Jenkins'
129       - string:
130           name: PROJECT
131           default: "{project}"
132           description: "Project name used to enable job conditions"
133       - string:
134           name: GIT_BASE
135           default: https://gerrit.opnfv.org/gerrit/$PROJECT
136           description: 'Git URL to use on this Jenkins Slave'
137       - string:
138           name: REPO
139           default: "opnfv"
140           description: "Repository name for functest images"
141
142
143     disabled: '{obj:disabled}'
144
145     builders:
146       - shell: |
147           #!/bin/bash -ex
148           case "{stream}" in
149           "master")
150               tag="latest" ;;
151           *)
152               tag="{stream}" ;;
153           esac
154           sudo manifest-tool push from-args \
155               --platforms linux/amd64,linux/arm64 \
156               --template $REPO/xtesting:ARCH-$tag \
157               --target $REPO/xtesting:$tag
158           exit $?
159
160 - parameter:
161     name: xtesting-job-parameters
162     parameters:
163       - project-parameter:
164           project: '{project}'
165           branch: '{branch}'
166       - label:
167           name: SLAVE_LABEL
168           default: '{slave_label}'
169           description: 'Slave label on Jenkins'
170       - string:
171           name: GIT_BASE
172           default: https://gerrit.opnfv.org/gerrit/$PROJECT
173           description: 'Git URL to use on this Jenkins Slave'
174       - string:
175           name: PUSH_IMAGE
176           default: "true"
177           description: "To enable/disable pushing the image to Dockerhub."
178       - string:
179           name: COMMIT_ID
180           default: ""
181           description: "commit id to make a snapshot docker image"
182       - string:
183           name: GERRIT_REFNAME
184           default: ""
185           description: "Docker tag to be built, e.g. refs/tags/5.0.0, refs/tags/opnfv-5.0.0, refs/tags/5.0.RC1"
186       - string:
187           name: DOCKERFILE
188           default: "Dockerfile"
189           description: "Dockerfile to use for creating the image."
190       - string:
191           name: ARCH_TAG
192           default: "{arch_tag}"
193           description: "If set, this value will be added to the docker image tag as a prefix"
194       - string:
195           name: PROJECT
196           default: "{project}"
197           description: "Project name used to enable job conditions"
198       - string:
199           name: REPO
200           default: "opnfv"
201           description: "Repository name for functest images"
202
203 # publisher macros
204 - publisher:
205     name: 'xtesting-arm64-recipients'
206     publishers:
207       - email:
208           recipients: >
209             cristina.pauna@enea.com
210             alexandru.avadanii@enea.com
211             delia.popescu@enea.com
212
213 - publisher:
214     name: 'xtesting-amd64-recipients'
215     publishers:
216       - email:
217           recipients: >
218             jalausuch@suse.com morgan.richomme@orange.com
219             cedric.ollivier@orange.com feng.xiaowei@zte.com.cn
220             juha.kosonen@nokia.com wangwulin@huawei.com
221             valentin.boucher@kontron.com