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