blob: 50a9a573a631f6c1c60b2eca7355aba883a75e77 [file] [log] [blame]
Andrew Grimbergebc710a2017-01-30 12:59:38 -08001---
2# Global macros
3
Andrew Grimberg1ac7c2d2017-02-08 12:40:56 -08004# vim: sw=2 ts=2 sts=2 et :
5
Andrew Grimbergebc710a2017-01-30 12:59:38 -08006# BUILDERS
7- builder:
Andrew Grimbergebc710a2017-01-30 12:59:38 -08008 name: provide-maven-settings
9 builders:
10 - config-file-provider:
11 files:
12 - file-id: '{global-settings-file}'
13 variable: 'GLOBAL_SETTINGS_FILE'
14 - file-id: '{settings-file}'
15 variable: 'SETTINGS_FILE'
16
Andrew Grimberg3aaa7d42017-02-24 12:51:11 -080017# call maven-target builder with a goal of --version to force Jenkins to
18# install the needed maven version
19- builder:
20 name: maven-install
21 builders:
22 - maven-target:
23 maven-version: '{maven-version}'
24 goals: '--version'
25
Anaël Clossonabbafb52017-02-09 17:55:10 +010026- builder:
Gary Wu350fbcb2018-08-07 11:13:59 -070027 name: maven-set-release-version
28 builders:
29 - maven-target:
30 maven-version: '{maven-version}'
31 pom: '{pom}'
32 goals: 'versions:set versions:update-child-modules versions:commit -B'
33 properties:
34 - 'newVersion=${{release_version}}'
35 settings: '{mvn-settings}'
36 settings-type: cfp
37 global-settings: 'global-settings'
38 global-settings-type: cfp
39
40- builder:
Anaël Clossonabbafb52017-02-09 17:55:10 +010041 name: maven-docker-push-release
42 builders:
43 - maven-target:
Andrew Grimberge2465882017-02-24 12:38:05 -080044 maven-version: '{maven-version}'
Anaël Clossonabbafb52017-02-09 17:55:10 +010045 pom: '{pom}'
Anaël Closson09b59032017-02-16 15:44:51 +010046 goals: 'clean deploy -B -P {mvn-profile}'
Anaël Clossonabbafb52017-02-09 17:55:10 +010047 settings: '{mvn-settings}'
48 settings-type: cfp
49 global-settings: 'global-settings'
50 global-settings-type: cfp
51 properties:
52 - maven.test.skip=true
Jeremy Phelps48028ab2017-03-28 15:38:24 -050053 - docker.pull.registry=nexus3.onap.org:10001
54 - docker.push.registry=nexus3.onap.org:10002
Anaël Clossonabbafb52017-02-09 17:55:10 +010055
56- builder:
57 name: maven-docker-push-daily
58 builders:
59 - maven-target:
Andrew Grimberge2465882017-02-24 12:38:05 -080060 maven-version: '{maven-version}'
Anaël Clossonabbafb52017-02-09 17:55:10 +010061 pom: '{pom}'
Jessica Wagantallf8f030a2018-05-07 11:13:19 -070062 goals: 'clean deploy -B -P {mvn-profile} {mvn-params}'
Anaël Clossonabbafb52017-02-09 17:55:10 +010063 settings: '{mvn-settings}'
64 settings-type: cfp
65 global-settings: 'global-settings'
66 global-settings-type: cfp
67 properties:
Jeremy Phelps48028ab2017-03-28 15:38:24 -050068 - docker.pull.registry=nexus3.onap.org:10001
69 - docker.push.registry=nexus3.onap.org:10003
Anaël Clossonabbafb52017-02-09 17:55:10 +010070
Anaël Closson63e090e2017-02-15 14:50:45 +010071- builder:
72 name: docker-login
73 builders:
74 - shell: !include-raw: include-docker-login.sh
75
Vanessa Rene Valderrama295975d2018-02-27 15:10:17 -080076- builder:
77 name: publish-pypi
78 builders:
79 - inject:
80 properties-content: PYPI_SERVER={pypi-server}
81 - shell:
82 !include-raw-escape: ../shell/pypi-publish.sh
83
Andrew Grimbergebc710a2017-01-30 12:59:38 -080084# PARAMETERS
85- parameter:
Andrew Grimberg4307a1c2017-03-16 13:00:00 -070086 name: infra-parameters
Andrew Grimbergebc710a2017-01-30 12:59:38 -080087 parameters:
88 - string:
89 name: PROJECT
90 default: '{project}'
91 # yamllint disable rule:line-length
92 description: 'JJB configured PROJECT parameter to identify a Gerrit project'
93 # yamllint enable
94 - string:
95 name: ARCHIVE_ARTIFACTS
96 default: '{artifacts} **/target/surefire-reports/*-output.txt'
97 # yamllint disable rule:line-length
98 description: 'Space separated glob patterns for artifacts to archive to logs hosting'
99 # yamllint enable
100 - string:
101 name: GERRIT_BRANCH
102 default: '{branch}'
103 description: 'JJB configured GERRIT_BRANCH parameter'
104 - string:
105 name: GERRIT_PROJECT
106 default: '{project}'
107 description: 'GERRIT_PROJECT parameter if not given by trigger'
108 - string:
109 name: GERRIT_REFSPEC
110 default: '{refspec}'
111 description: 'GERRIT_REFSPEC parameter if not given by trigger'
112 - string:
113 name: STACK_NAME
114 default: '$JOB_NAME-$BUILD_NUMBER'
115 description: 'Used by Heat to generate a unique stack & vm name'
116
117- parameter:
Jessica Wagantalld25908c2018-03-28 12:06:39 -0700118 name: maven-params
119 parameters:
120 - string:
121 name: MAVEN_PARAMS
122 default: '{mvn-params}'
123 description: Maven parameters to pass to the mvn command.
124
125- parameter:
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800126 name: maven-exec
127 parameters:
128 - string:
129 name: MVN
130 # yamllint disable rule:line-length
131 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{maven-version}/bin/mvn'
132 # yamllint enable
133 description: 'Maven selector to be used by shell scripts'
134
Gary Wudc3f2952017-08-23 16:48:59 -0700135- parameter:
136 name: docker-image-name
137 parameters:
138 - string:
139 name: DOCKER_IMAGE_NAME
140 # yamllint disable rule:line-length
141 default: '{docker-image-name}'
142 # yamllint enable
143 description: 'Docker image name, e.g. onap/appc'
144
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800145# PROPERTIES
146- property:
Andrew Grimberg4307a1c2017-03-16 13:00:00 -0700147 name: infra-properties
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800148 properties:
149 - build-discarder:
150 days-to-keep: '{build-days-to-keep}'
151 num-to-keep: 40
152 artifact-days-to-keep: -1
153 artifact-num-to-keep: 5
154
155# PUBLISHERS
156- publisher:
157 name: archive-artifacts
158 publishers:
159 - archive:
160 artifacts: '{artifacts}'
161 allow-empty: true
162 fingerprint: true
163 latest-only: true
164
165- publisher:
166 name: email-notification
167 publishers:
168 - email-ext:
169 recipients: 'nobody@open-o.org'
170 reply-to:
171 content-type: default
172 # yamllint disable rule:line-length
173 subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
174 # yamllint enable
175 body: |
176 $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
177
178 Check console output at $BUILD_URL to view the results.
179 unstable: true
180 fixed: true
181 send-to:
182 - developers
183 - recipients
184
185- publisher:
186 name: jacoco-report
187 publishers:
188 - jacoco:
189 exec-pattern: '**/**.exec'
190 class-pattern: '**/classes'
191 source-pattern: '**/src/main/java'
192 # yamllint disable rule:line-length
193 exclusion-pattern: '**/gen**,**/generated-sources/**,**/yang-gen**,**/pax/**'
194 # yamllint enable
195 status-update: true
196 targets:
197 - branch:
198 healthy: 10
199 unhealthy: 20
200 - method:
201 healthy: 50
202 unhealthy: 40
203
204- publisher:
JulienBe77903ed2017-07-17 15:30:26 +0200205 name: checkstyle-result
206 publishers:
207 - checkstyle:
208 pattern: '**/checkstyle-result.xml'
209 healthy: 0
210 unhealthy: 100
211 health-threshold: 'high'
212 thresholds:
213 unstable:
214 total-all: 30
215 total-high: 15
216 total-normal: 20
217 total-low: 25
218 new-all: 5
219 new-high: 0
220 new-normal: 2
221 new-low: 5
222
223- publisher:
224 name: checkstyle-result-daily
225 publishers:
226 - checkstyle:
227 pattern: '**/checkstyle-result.xml'
228 healthy: 0
229 unhealthy: 100
230 health-threshold: 'high'
231 thresholds:
232 unstable:
233 total-all: 30
234 total-high: 15
235 total-normal: 20
236 total-low: 25
237 new-all: 1
238 new-high: 0
239 new-normal: 1
240 new-low: 1
241
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800242# SCMS
243- scm:
244 name: git-scm
245 scm:
246 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700247 credentials-id: 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800248 url: '$GIT_BASE'
249 refspec: ''
250 branches:
Andrew Grimberg1ac7c2d2017-02-08 12:40:56 -0800251 - 'origin/{branch}'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800252 skip-tag: true
253 wipe-workspace: true
254 timeout: 30
255
256- scm:
257 name: gerrit-trigger-scm
258 scm:
259 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700260 credentials-id: 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800261 url: '$GIT_BASE'
262 refspec: '{refspec}'
263 branches:
264 - 'origin/$GERRIT_BRANCH'
265 skip-tag: true
266 timeout: 30
267 choosing-strategy: '{choosing-strategy}'
Jeremy Phelps2c76e492017-07-12 13:45:40 -0500268 submodule:
269 recursive: '{submodule-recursive}'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800270
271- scm:
272 name: gerrit-trigger-scm-basedir
273 scm:
274 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700275 credentials-id: 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800276 url: '$GIT_BASE'
277 refspec: '{refspec}'
278 branches:
279 - 'origin/$GERRIT_BRANCH'
280 skip-tag: true
281 timeout: 30
282 choosing-strategy: '{choosing-strategy}'
283 basedir: '{basedir}'
284
285- scm:
286 name: git-branch-scm
287 scm:
288 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700289 credentials-id: 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800290 url: '$GIT_BASE'
291 refspec: ''
292 branches:
293 - 'origin/{branch}'
294 skip-tag: true
295 timeout: 30
296 wipe-workspace: true
297
Andrew Grimberg1ac7c2d2017-02-08 12:40:56 -0800298- scm:
299 name: git-extra-project
300 scm:
301 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700302 credentials-id: 'onap-jenkins-ssh'
Andrew Grimberg1ac7c2d2017-02-08 12:40:56 -0800303 url: '$GIT_NO_PROJECT/{project}'
304 refspec: '{refspec}'
305 branches:
306 - 'origin/{branch}'
307 skip-tag: true
308 timeoute: 30
309 wipe-workspace: false
310 basedir: '{checkout-dir}'
311
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800312# TRIGGERS
313
314# This is a single macro to use for all jobs who vote on every (relevant) patch
315# set. Only 'recheck' trigger word is supported, it always triggers the full set
316# of relevant jobs, in order to prevent Jenkins from starting only a subset and
317# still voting Verified+1
318# Arguments:
319# server: name of gerrit server to listen to
320# project: pattern to match triggering projects
321# branch: triggering branch name
322# files: pattern to match triggering filepaths
323- trigger:
324 name: gerrit-trigger-patch-submitted
325 triggers:
326 - gerrit:
327 server-name: '{server}'
328 trigger-on:
329 - patchset-created-event:
330 exclude-drafts: 'false'
331 exclude-trivial-rebase: 'false'
332 exclude-no-code-change: 'false'
333 - draft-published-event
334 - comment-added-contains-event:
335 comment-contains-value: 'recheck'
336 projects:
337 - project-compare-type: 'ANT'
338 project-pattern: '{project}'
339 branches:
340 - branch-compare-type: 'ANT'
341 branch-pattern: '**/{branch}'
342 file-paths:
343 - compare-type: 'ANT'
344 pattern: '{files}'
345
346- trigger:
347 name: gerrit-trigger-patch-merged
348 triggers:
349 - gerrit:
350 server-name: '{server}'
351 trigger-on:
352 - change-merged-event
353 - comment-added-contains-event:
354 comment-contains-value: 'remerge'
355 projects:
356 - project-compare-type: 'ANT'
357 project-pattern: '{project}'
358 branches:
359 - branch-compare-type: 'ANT'
360 branch-pattern: '**/{branch}'
361 file-paths:
362 - compare-type: 'ANT'
363 pattern: '{files}'
364
JulienBe0d8c2c32017-02-16 11:50:48 -0800365- trigger:
Jeremy Phelpsd73b2142018-08-27 15:26:11 -0500366 name: gerrit-trigger-helm-patch-submitted
367 triggers:
368 - gerrit:
369 server-name: '{server}'
370 trigger-on:
371 - patchset-created-event:
372 exclude-drafts: 'false'
Jeremy Phelpsd73b2142018-08-27 15:26:11 -0500373 exclude-no-code-change: 'false'
efiacord7432d22022-04-25 11:35:27 +0100374 exclude-trivial-rebase: 'true'
375 exclude-wip: 'true'
Jeremy Phelpsd73b2142018-08-27 15:26:11 -0500376 - draft-published-event
377 - comment-added-contains-event:
Jessica Wagantall65198c82020-03-24 09:57:03 -0700378 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify|verify-helm)\s*$'
Jeremy Phelpsd73b2142018-08-27 15:26:11 -0500379 projects:
380 - project-compare-type: 'ANT'
381 project-pattern: '{project}'
382 branches:
383 - branch-compare-type: 'ANT'
384 branch-pattern: '**/{branch}'
385 file-paths:
386 - compare-type: 'ANT'
387 pattern: '{files}'
388
389- trigger:
390 name: gerrit-trigger-helm-patch-merged
391 triggers:
392 - gerrit:
393 server-name: '{server}'
394 trigger-on:
395 - change-merged-event
396 - comment-added-contains-event:
397 comment-contains-value: '^remerge-helm$'
398 projects:
399 - project-compare-type: 'ANT'
400 project-pattern: '{project}'
401 branches:
402 - branch-compare-type: 'ANT'
403 branch-pattern: '**/{branch}'
404 file-paths:
405 - compare-type: 'ANT'
406 pattern: '{files}'
407
408- trigger:
JulienBe0d8c2c32017-02-16 11:50:48 -0800409 name: gerrit-trigger-release-manually
410 triggers:
411 - gerrit:
412 server-name: '{server}'
413 trigger-on:
414 - comment-added-contains-event:
415 comment-contains-value: 'please release'
416 projects:
417 - project-compare-type: 'ANT'
418 project-pattern: '{project}'
419 branches:
420 - branch-compare-type: 'ANT'
421 branch-pattern: '**/{branch}'
422 file-paths:
423 - compare-type: 'ANT'
424 pattern: '**'
425
Anaël Clossonadcb39d2017-03-10 15:39:09 +0100426- trigger:
427 name: trigger-on-build-success
428 triggers:
Anaël Closson41ddffd2017-03-13 13:39:57 +0100429 - reverse:
430 jobs: '{job-name}'
431 result: 'success'
432
Anaël Clossonadcb39d2017-03-10 15:39:09 +0100433
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800434# WRAPPERS
435- wrapper:
436 name: build-timeout
437 wrappers:
438 - timeout:
439 type: absolute
440 timeout: 360
441 fail: true
442
443- wrapper:
Kiran Kamineni9655e0f2018-10-23 16:53:34 -0700444 name: golang110
Kiran Kamineni85b44e82018-03-21 11:14:29 -0700445 wrappers:
446 - raw:
447 xml: |
448 <org.jenkinsci.plugins.golang.GolangBuildWrapper plugin="golang@1.2">
449 <goVersion>Golang 1.10</goVersion>
450 </org.jenkinsci.plugins.golang.GolangBuildWrapper>
451
452- wrapper:
Kiran Kamineni9655e0f2018-10-23 16:53:34 -0700453 name: golang111
454 wrappers:
455 - raw:
456 xml: |
457 <org.jenkinsci.plugins.golang.GolangBuildWrapper plugin="golang@1.2">
458 <goVersion>Golang 1.11</goVersion>
459 </org.jenkinsci.plugins.golang.GolangBuildWrapper>
460
461- wrapper:
Kiran Kamineni64cbb962019-04-25 12:21:26 -0700462 name: golang112
463 wrappers:
464 - raw:
465 xml: |
466 <org.jenkinsci.plugins.golang.GolangBuildWrapper plugin="golang@1.2">
467 <goVersion>Golang 1.12</goVersion>
468 </org.jenkinsci.plugins.golang.GolangBuildWrapper>
469
470- wrapper:
Larry Sachsbfeb7122020-06-30 08:42:20 -0700471 name: golang114
472 wrappers:
473 - raw:
474 xml: |
Larry Sachs5561c722020-07-07 17:46:25 -0700475 <org.jenkinsci.plugins.golang.GolangBuildWrapper plugin="golang@1.2">
Larry Sachsbfeb7122020-06-30 08:42:20 -0700476 <goVersion>Golang 1.14</goVersion>
477 </org.jenkinsci.plugins.golang.GolangBuildWrapper>
478
479- wrapper:
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800480 # This wrapper is required for all jobs as it configures the wrappers
481 # needed by the eCOMP infra.
Andrew Grimberg4307a1c2017-03-16 13:00:00 -0700482 name: infra-wrappers
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800483 wrappers:
Jessica Wagantall4fecf312017-04-25 11:40:31 -0700484 - timestamps
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800485 - timeout:
486 type: absolute
487 timeout: '{build-timeout}'
488 timeout-var: 'BUILD_TIMEOUT'
489 fail: true
490 - ssh-agent-credentials:
491 users:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700492 - 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800493 - openstack:
494 single-use: true
gwuadeda5a2018-07-17 14:12:09 -0700495
496- wrapper:
497 # This wrapper is used for docker build jobs to use the dedicated docker
498 # build VM and turn off OpenStack single-use
499 name: infra-wrappers-docker-build
500 wrappers:
501 - timestamps
502 - timeout:
503 type: absolute
504 timeout: '{build-timeout}'
505 timeout-var: 'BUILD_TIMEOUT'
506 fail: true
507 - ssh-agent-credentials:
508 users:
509 - 'onap-jenkins-ssh'
510 - openstack:
511 single-use: false