feat(hicn.yaml): add project and job-template for sonar scanner.
[ci-management.git] / jjb / hicn / hicn.yaml
1 # Copyright (c) 2021 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 ---
15 - project:
16     name: hicn-x86_64
17     jobs:
18       - "hicn-verify-{stream}-{os}-{executor-arch}"
19       - "hicn-merge-{stream}-{os}-{executor-arch}"
20     project: "hicn"
21     os: ubuntu2004
22     executor-arch: "x86_64"
23     stream:
24       - hicn:
25           branch: "master"
26
27 - project:
28     name: hicn-aarch64
29     jobs:
30       - "hicn-verify-{stream}-{os}-{executor-arch}"
31       - "hicn-merge-{stream}-{os}-{executor-arch}"
32     project: "hicn"
33     os: ubuntu2004
34     executor-arch: "aarch64"
35     stream:
36       - hicn:
37           branch: "master"
38
39 - project:
40     name: hicn-misc
41     jobs:
42       - "hicn-checkstyle-verify-{stream}-{os}-{executor-arch}"
43     project: "hicn"
44     stream:
45       - hicn:
46           branch: "master"
47     os: ubuntu2004
48     executor-arch: "x86_64"
49
50 - project:
51     name: hicn-extras-x86_64
52     jobs:
53       - "hicn-extras-verify-{stream}-{os}-{executor-arch}"
54       - "hicn-extras-build-{stream}-{os}-{executor-arch}"
55     project: "hicn"
56     os: ubuntu2004
57     executor-arch: "x86_64"
58     stream:
59       - hicn:
60           branch: "master"
61
62 - project:
63     name: hicn-extras-aarch64
64     jobs:
65       - "hicn-extras-verify-{stream}-{os}-{executor-arch}"
66       - "hicn-extras-build-{stream}-{os}-{executor-arch}"
67     project: "hicn"
68     os: ubuntu2004
69     executor-arch: "aarch64"
70     stream:
71       - hicn:
72           branch: "master"
73
74 - project:
75     name: hicn-view
76     views:
77       - project-view
78     project-name: hicn
79
80 - project:
81     name: hicn-sonar
82     jobs:
83       - hicn-sonar-scanner
84     project: hicn
85     sonarcloud: true
86     sonarcloud-project-organization: "{sonarcloud_project_organization}"
87     sonarcloud-api-token: "{sonarcloud_api_token}"
88     sonarcloud-project-key: "{sonarcloud_project_organization}-{project}"
89     stream:
90       - hicn:
91           branch: "master"
92
93 - job-template:
94     name: hicn-sonar-scanner
95
96     project-type: freestyle
97     node: centos7-docker-4c-4g
98     concurrent: true
99
100     scm:
101       - gerrit-trigger-scm:
102           credentials-id: "jenkins-gerrit-credentials"
103           refspec: ""
104           choosing-strategy: "default"
105
106     wrappers:
107       - fdio-infra-wrappers:
108           build-timeout: "{build-timeout}"
109
110     triggers:
111       - gerrit-trigger-patch-merged:
112           name: "{project}"
113           branch: "{branch}"
114
115     builders:
116       - inject:
117           properties-content: |
118             SONAR_HOST_URL=https://sonarcloud.io
119             PROJECT_KEY={sonarcloud-project-key}
120             PROJECT_ORGANIZATION={sonarcloud-project-organization}
121             API_TOKEN={sonarcloud-api-token}
122       - shell: !include-raw-escape:
123           - ../scripts/hicn/sonar.sh
124
125 - job-template:
126     name: "hicn-checkstyle-verify-{stream}-{os}-{executor-arch}"
127
128     project-type: freestyle
129     node: "builder-{os}-prod-{executor-arch}"
130     concurrent: true
131
132     properties:
133       - lf-infra-properties:
134           build-days-to-keep: "{build-days-to-keep}"
135
136     parameters:
137       - project-parameter:
138           project: "{project}"
139       - gerrit-parameter:
140           branch: "{branch}"
141       - os-parameter:
142           os: "{os}"
143
144     scm:
145       - gerrit-trigger-scm:
146           credentials-id: "jenkins-gerrit-credentials"
147           refspec: "$GERRIT_REFSPEC"
148           choosing-strategy: "gerrit"
149
150     wrappers:
151       - fdio-infra-wrappers:
152           build-timeout: "{build-timeout}"
153
154     triggers:
155       - gerrit:
156           server-name: "Primary"
157           trigger-on:
158             - patchset-created-event:
159                 exclude-drafts: "true"
160                 exclude-trivial-rebase: "false"
161                 exclude-no-code-change: "true"
162             - draft-published-event
163             - comment-added-contains-event:
164                 comment-contains-value: "checkstylecheck"
165             - comment-added-contains-event:
166                 comment-contains-value: "docsonly"
167             - comment-added-contains-event:
168                 comment-contains-value: "recheck"
169             - comment-added-contains-event:
170                 comment-contains-value: "reverify"
171           projects:
172             - project-compare-type: "ANT"
173               project-pattern: "{project}"
174               branches:
175                 - branch-compare-type: "ANT"
176                   branch-pattern: "**/{branch}"
177               file-paths:
178                 - compare-type: REG_EXP
179                   pattern: ^((?!\/COMMIT_MSG|docs|_abc|_def[\/\.]).)*$
180               disable-strict-forbidden-file-verification: "true"
181           override-votes: true
182           gerrit-build-notbuilt-verified-value: 0
183           gerrit-build-successful-verified-value: 1
184           # yamllint disable-line rule:line-length
185           notbuilt-message: "Automatic retry of failed jobs may be in process. A proper vote should be set when retry completes."
186           # yamllint disable-line rule:line-length
187           failed-message: "Checkstyle failed. No further verify jobs will be started."
188           successful-message: "checkstyle_success"
189           skip-vote:
190             successful: true
191             failed: false
192             unstable: false
193             notbuilt: false
194
195     builders:
196       - shell: !include-raw-escape:
197           - ../scripts/setup_executor_env.sh
198       - shell: !include-raw-escape:
199           - ../scripts/hicn/checkstyle.sh
200
201     publishers:
202       - fdio-infra-publish
203       - naginator:
204           rerun-unstable-builds: true
205           max-failed-builds: 1
206           fixed-delay: 90
207
208 - job-template:
209     name: "hicn-verify-{stream}-{os}-{executor-arch}"
210
211     project-type: freestyle
212     node: "builder-{os}-prod-{executor-arch}"
213     concurrent: true
214
215     properties:
216       - lf-infra-properties:
217           build-days-to-keep: "{build-days-to-keep}"
218
219     parameters:
220       - project-parameter:
221           project: "{project}"
222       - gerrit-parameter:
223           branch: "{branch}"
224       - os-parameter:
225           os: "{os}"
226       - stream-parameter:
227           stream: "{stream}"
228
229     scm:
230       - gerrit-trigger-scm:
231           credentials-id: "jenkins-gerrit-credentials"
232           refspec: "$GERRIT_REFSPEC"
233           choosing-strategy: "gerrit"
234
235     wrappers:
236       - fdio-infra-wrappers:
237           build-timeout: 120
238
239     triggers:
240       - gerrit-trigger-checkstyle:
241           name: "{project}"
242           branch: "{branch}"
243
244     builders:
245       - shell: !include-raw-escape:
246           - ../scripts/setup_executor_env.sh
247       - shell: !include-raw-escape:
248           - ../scripts/hicn/build.sh
249
250     publishers:
251       - fdio-infra-publish
252
253 - job-template:
254     name: "hicn-merge-{stream}-{os}-{executor-arch}"
255
256     project-type: freestyle
257     node: "builder-{os}-prod-{executor-arch}"
258
259     properties:
260       - lf-infra-properties:
261           build-days-to-keep: "{build-days-to-keep}"
262
263     parameters:
264       - project-parameter:
265           project: "{project}"
266       - gerrit-parameter:
267           branch: "{branch}"
268       - os-parameter:
269           os: "{os}"
270       - stream-parameter:
271           stream: "{stream}"
272
273     scm:
274       - gerrit-trigger-scm:
275           credentials-id: "jenkins-gerrit-credentials"
276           refspec: ""
277           choosing-strategy: "default"
278
279     wrappers:
280       - fdio-infra-wrappers:
281           build-timeout: "{build-timeout}"
282
283     triggers:
284       - gerrit-trigger-patch-merged:
285           name: "{project}"
286           branch: "{branch}"
287
288     builders:
289       - config-file-provider:
290           files:
291             - file-id: ".packagecloud"
292               target: "/root/.packagecloud"
293       - config-file-provider:
294           files:
295             - file-id: "packagecloud_api"
296               target: "/root/packagecloud_api"
297       - shell: !include-raw-escape:
298           - ../scripts/setup_executor_env.sh
299       - shell: !include-raw-escape:
300           - ../scripts/hicn/checkstyle.sh
301       - shell: !include-raw-escape:
302           - ../scripts/hicn/build.sh
303       - shell: !include-raw-escape:
304           - ../scripts/packagecloud_push.sh
305
306     publishers:
307       - fdio-infra-publish
308
309 - job-template:
310     name: "hicn-extras-verify-{stream}-{os}-{executor-arch}"
311
312     project-type: freestyle
313     node: "builder-{os}-prod-{executor-arch}"
314     concurrent: true
315
316     properties:
317       - lf-infra-properties:
318           build-days-to-keep: "{build-days-to-keep}"
319
320     parameters:
321       - project-parameter:
322           project: "{project}"
323       - gerrit-parameter:
324           branch: "{branch}"
325       - os-parameter:
326           os: "{os}"
327       - stream-parameter:
328           stream: "{stream}"
329
330     scm:
331       - gerrit-trigger-scm:
332           credentials-id: "jenkins-gerrit-credentials"
333           refspec: "$GERRIT_REFSPEC"
334           choosing-strategy: "gerrit"
335
336     wrappers:
337       - fdio-infra-wrappers:
338           build-timeout: 120
339
340     triggers:
341       - gerrit:
342           server-name: "Primary"
343           trigger-on:
344             - comment-added-contains-event:
345                 comment-contains-value: "verify-extras"
346           projects:
347             - project-compare-type: "ANT"
348               project-pattern: "{project}"
349               branches:
350                 - branch-compare-type: "ANT"
351                   branch-pattern: "**/{branch}"
352
353     builders:
354       - shell: !include-raw-escape:
355           - ../scripts/setup_executor_env.sh
356       - shell: !include-raw-escape:
357           - ../scripts/hicn/build-extras.sh
358
359     publishers:
360       - fdio-infra-publish
361
362 - job-template:
363     name: "hicn-extras-build-{stream}-{os}-{executor-arch}"
364
365     project-type: freestyle
366     node: "builder-{os}-prod-{executor-arch}"
367
368     properties:
369       - lf-infra-properties:
370           build-days-to-keep: "{build-days-to-keep}"
371
372     parameters:
373       - project-parameter:
374           project: "{project}"
375       - gerrit-parameter:
376           branch: "{branch}"
377       - os-parameter:
378           os: "{os}"
379       - stream-parameter:
380           stream: "hicn"
381
382     scm:
383       - gerrit-trigger-scm:
384           credentials-id: "jenkins-gerrit-credentials"
385           refspec: ""
386           choosing-strategy: "default"
387
388     wrappers:
389       - fdio-infra-wrappers:
390           build-timeout: "{build-timeout}"
391
392     triggers:
393       - gerrit:
394           server-name: "Primary"
395           trigger-on:
396             - comment-added-contains-event:
397                 comment-contains-value: "build-extras"
398           projects:
399             - project-compare-type: "ANT"
400               project-pattern: "{project}"
401               branches:
402                 - branch-compare-type: "ANT"
403                   branch-pattern: "**/{branch}"
404
405     builders:
406       - config-file-provider:
407           files:
408             - file-id: ".packagecloud"
409               target: "/root/.packagecloud"
410       - config-file-provider:
411           files:
412             - file-id: "packagecloud_api"
413               target: "/root/packagecloud_api"
414       - shell: !include-raw-escape:
415           - ../scripts/setup_executor_env.sh
416       - shell: !include-raw-escape:
417           - ../scripts/hicn/build-extras.sh
418       - shell: !include-raw-escape:
419           - ../scripts/packagecloud_push.sh
420
421     publishers:
422       - fdio-infra-publish
423
424 - project:
425     name: hicn-info
426     project-name: hicn
427     jobs:
428       - gerrit-info-yaml-verify
429     build-node: centos7-builder-2c-2g
430     project: hicn
431     branch: master