Fix typo in Functest container builds
[releng.git] / jjb / functest / xtesting-docker.yaml
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       - 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     image:
36       - 'core'
37       - 'mts'
38
39     exclude:
40       - stream: 'kali'
41         image: 'mts'
42       - stream: 'jerma'
43         image: 'mts'
44       - stream: 'iruya'
45         image: 'mts'
46       - stream: 'hunter'
47         image: 'mts'
48
49     # settings for jobs run in multijob phases
50     build-job-settings: &build-job-settings
51       current-parameters: false
52       git-revision: true
53       node-parameters: false
54       predefined-parameters: |
55         PUSH_IMAGE=$PUSH_IMAGE
56         COMMIT_ID=$COMMIT_ID
57         GERRIT_REFNAME=$GERRIT_REFNAME
58         DOCKERFILE=$DOCKERFILE
59       kill-phase-on: FAILURE
60       abort-all-jobs: false
61
62     manifest-job-settings: &manifest-job-settings
63       current-parameters: false
64       git-revision: true
65       node-parameters: false
66       predefined-parameters:
67         GERRIT_REFNAME=$GERRIT_REFNAME
68       kill-phase-on: FAILURE
69       abort-all-jobs: false
70
71     # yamllint enable rule:key-duplicates
72     jobs:
73       - "xtesting-docker-{stream}"
74       - "xtesting-{image}-docker-build-{arch_tag}-{stream}"
75       - "xtesting-{image}-docker-manifest-{stream}"
76
77 ########################
78 # job templates
79 ########################
80 - job-template:
81     name: 'xtesting-docker-{stream}'
82
83     project-type: multijob
84
85     disabled: '{obj:disabled}'
86
87     parameters:
88       - xtesting-job-parameters:
89           project: '{project}'
90           branch: '{branch}'
91           slave_label: 'lf-build2'
92           arch_tag: 'amd64'
93
94     properties:
95       - throttle:
96           max-per-node: 1
97           option: 'project'
98
99     scm:
100       - git-scm
101
102     triggers:
103       - pollscm:
104           cron: "*/30 * * * *"
105       - gerrit-trigger-tag-created:
106           project: '{project}'
107
108     builders:
109       - multijob:
110           name: 'build xtesting images'
111           execution-type: PARALLEL
112           projects:
113             - name: 'xtesting-core-docker-build-amd64-{stream}'
114               <<: *build-job-settings
115       - multijob:
116           name: 'publish xtesting manifests'
117           execution-type: PARALLEL
118           projects:
119             - name: 'xtesting-core-docker-manifest-{stream}'
120               <<: *manifest-job-settings
121       - multijob:
122           name: 'build xtesting-mts images'
123           execution-type: PARALLEL
124           projects:
125             - name: 'xtesting-mts-docker-build-amd64-{stream}'
126               <<: *build-job-settings
127       - multijob:
128           name: 'publish xtesting-mts manifests'
129           execution-type: PARALLEL
130           projects:
131             - name: 'xtesting-mts-docker-manifest-{stream}'
132               <<: *manifest-job-settings
133
134
135     publishers:
136       - 'xtesting-amd64-recipients'
137
138 - job-template:
139     name: 'xtesting-{image}-docker-build-{arch_tag}-{stream}'
140     disabled: '{obj:disabled}'
141     parameters:
142       - xtesting-job-parameters:
143           project: '{project}'
144           branch: '{branch}'
145           slave_label: '{slave_label}'
146           arch_tag: '{arch_tag}'
147     scm:
148       - git-scm
149     builders:
150       - shell: |
151           #!/bin/bash -ex
152           sudo arch=amd64 amd64_dirs=docker/{image} arm64_dirs= arm_dirs= bash ./build.sh
153           exit $?
154
155 - job-template:
156     name: 'xtesting-{image}-docker-manifest-{stream}'
157
158     parameters:
159       - project-parameter:
160           project: '{project}'
161           branch: '{branch}'
162       - label:
163           name: SLAVE_LABEL
164           default: 'lf-build2'
165           description: 'Slave label on Jenkins'
166           all-nodes: false
167           node-eligibility: 'ignore-offline'
168       - string:
169           name: PROJECT
170           default: "{project}"
171           description: "Project name used to enable job conditions"
172       - string:
173           name: GIT_BASE
174           default: https://gerrit.opnfv.org/gerrit/$PROJECT
175           description: 'Git URL to use on this Jenkins Slave'
176       - string:
177           name: REPO
178           default: "opnfv"
179           description: "Repository name for xtesting images"
180
181
182     disabled: '{obj:disabled}'
183
184     builders:
185       - shell: |
186           #!/bin/bash -ex
187           case "{stream}" in
188           "master")
189               tag="latest" ;;
190           *)
191               tag="{stream}" ;;
192           esac
193           case "{image}" in
194           "core")
195               img="" ;;
196           *)
197               img="-{image}" ;;
198           esac
199           sudo manifest-tool push from-args \
200               --platforms linux/amd64 \
201               --template $REPO/xtesting$img:ARCH-$tag \
202               --target $REPO/xtesting$img:$tag
203           exit $?
204
205 - parameter:
206     name: xtesting-job-parameters
207     parameters:
208       - project-parameter:
209           project: '{project}'
210           branch: '{branch}'
211       - label:
212           name: SLAVE_LABEL
213           default: '{slave_label}'
214           description: 'Slave label on Jenkins'
215           all-nodes: false
216           node-eligibility: 'ignore-offline'
217       - string:
218           name: GIT_BASE
219           default: https://gerrit.opnfv.org/gerrit/$PROJECT
220           description: 'Git URL to use on this Jenkins Slave'
221       - string:
222           name: PUSH_IMAGE
223           default: "true"
224           description: "To enable/disable pushing the image to Dockerhub."
225       - string:
226           name: COMMIT_ID
227           default: ""
228           description: "commit id to make a snapshot docker image"
229       - string:
230           name: GERRIT_REFNAME
231           default: ""
232           description: "Docker tag to be built, e.g. refs/tags/5.0.0, refs/tags/opnfv-5.0.0, refs/tags/5.0.RC1"
233       - string:
234           name: DOCKERFILE
235           default: "Dockerfile"
236           description: "Dockerfile to use for creating the image."
237       - string:
238           name: ARCH_TAG
239           default: "{arch_tag}"
240           description: "If set, this value will be added to the docker image tag as a prefix"
241       - string:
242           name: PROJECT
243           default: "{project}"
244           description: "Project name used to enable job conditions"
245       - string:
246           name: REPO
247           default: "opnfv"
248           description: "Repository name for xtesting images"
249
250 # publisher macros
251 - publisher:
252     name: 'xtesting-amd64-recipients'
253     publishers:
254       - email:
255           recipients: >
256             jalausuch@suse.com morgan.richomme@orange.com
257             cedric.ollivier@orange.com feng.xiaowei@zte.com.cn
258             juha.kosonen@nokia.com wangwulin@huawei.com
259             valentin.boucher@kontron.com