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