blob: d7ca143782069a6497500c1b9080c3d14127ad78 [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:
8 name: ci-management-check-unicode
9 builders:
10 - shell: |
11 $WORKSPACE/scripts/check-unicode.sh jjb/
12
13- builder:
14 name: provide-maven-settings
15 builders:
16 - config-file-provider:
17 files:
18 - file-id: '{global-settings-file}'
19 variable: 'GLOBAL_SETTINGS_FILE'
20 - file-id: '{settings-file}'
21 variable: 'SETTINGS_FILE'
22
Andrew Grimberg3aaa7d42017-02-24 12:51:11 -080023# call maven-target builder with a goal of --version to force Jenkins to
24# install the needed maven version
25- builder:
26 name: maven-install
27 builders:
28 - maven-target:
29 maven-version: '{maven-version}'
30 goals: '--version'
31
Anaël Clossonabbafb52017-02-09 17:55:10 +010032- builder:
33 name: maven-docker-push-release
34 builders:
35 - maven-target:
Andrew Grimberge2465882017-02-24 12:38:05 -080036 maven-version: '{maven-version}'
Anaël Clossonabbafb52017-02-09 17:55:10 +010037 pom: '{pom}'
Anaël Closson09b59032017-02-16 15:44:51 +010038 goals: 'clean deploy -B -P {mvn-profile}'
Anaël Clossonabbafb52017-02-09 17:55:10 +010039 settings: '{mvn-settings}'
40 settings-type: cfp
41 global-settings: 'global-settings'
42 global-settings-type: cfp
43 properties:
44 - maven.test.skip=true
Jeremy Phelps48028ab2017-03-28 15:38:24 -050045 - docker.pull.registry=nexus3.onap.org:10001
46 - docker.push.registry=nexus3.onap.org:10002
Anaël Clossonabbafb52017-02-09 17:55:10 +010047
48- builder:
49 name: maven-docker-push-daily
50 builders:
51 - maven-target:
Andrew Grimberge2465882017-02-24 12:38:05 -080052 maven-version: '{maven-version}'
Anaël Clossonabbafb52017-02-09 17:55:10 +010053 pom: '{pom}'
Jessica Wagantallf8f030a2018-05-07 11:13:19 -070054 goals: 'clean deploy -B -P {mvn-profile} {mvn-params}'
Anaël Clossonabbafb52017-02-09 17:55:10 +010055 settings: '{mvn-settings}'
56 settings-type: cfp
57 global-settings: 'global-settings'
58 global-settings-type: cfp
59 properties:
Jeremy Phelps48028ab2017-03-28 15:38:24 -050060 - docker.pull.registry=nexus3.onap.org:10001
61 - docker.push.registry=nexus3.onap.org:10003
Anaël Clossonabbafb52017-02-09 17:55:10 +010062
Anaël Closson63e090e2017-02-15 14:50:45 +010063- builder:
Jessica Wagantall9a03dac2018-03-19 09:27:18 -070064 name: maven-docker-push-daily-test
65 builders:
66 - maven-target:
67 maven-version: '{maven-version}'
68 pom: '{pom}'
69 goals: 'clean deploy -B -P {mvn-profile}'
70 settings: '{mvn-settings}'
71 settings-type: cfp
72 global-settings: 'global-settings'
73 global-settings-type: cfp
74 properties:
75 - docker.pull.registry=nexus3.onap.org:10001
76 - docker.push.registry=nexus3.onap.org:10003
77
78- builder:
Anaël Closson63e090e2017-02-15 14:50:45 +010079 name: docker-login
80 builders:
81 - shell: !include-raw: include-docker-login.sh
82
Vanessa Rene Valderrama295975d2018-02-27 15:10:17 -080083- builder:
84 name: publish-pypi
85 builders:
86 - inject:
87 properties-content: PYPI_SERVER={pypi-server}
88 - shell:
89 !include-raw-escape: ../shell/pypi-publish.sh
90
Andrew Grimbergebc710a2017-01-30 12:59:38 -080091# PARAMETERS
92- parameter:
Andrew Grimberg4307a1c2017-03-16 13:00:00 -070093 name: infra-parameters
Andrew Grimbergebc710a2017-01-30 12:59:38 -080094 parameters:
95 - string:
96 name: PROJECT
97 default: '{project}'
98 # yamllint disable rule:line-length
99 description: 'JJB configured PROJECT parameter to identify a Gerrit project'
100 # yamllint enable
101 - string:
102 name: ARCHIVE_ARTIFACTS
103 default: '{artifacts} **/target/surefire-reports/*-output.txt'
104 # yamllint disable rule:line-length
105 description: 'Space separated glob patterns for artifacts to archive to logs hosting'
106 # yamllint enable
107 - string:
108 name: GERRIT_BRANCH
109 default: '{branch}'
110 description: 'JJB configured GERRIT_BRANCH parameter'
111 - string:
112 name: GERRIT_PROJECT
113 default: '{project}'
114 description: 'GERRIT_PROJECT parameter if not given by trigger'
115 - string:
116 name: GERRIT_REFSPEC
117 default: '{refspec}'
118 description: 'GERRIT_REFSPEC parameter if not given by trigger'
119 - string:
120 name: STACK_NAME
121 default: '$JOB_NAME-$BUILD_NUMBER'
122 description: 'Used by Heat to generate a unique stack & vm name'
123
124- parameter:
Jessica Wagantalld25908c2018-03-28 12:06:39 -0700125 name: maven-params
126 parameters:
127 - string:
128 name: MAVEN_PARAMS
129 default: '{mvn-params}'
130 description: Maven parameters to pass to the mvn command.
131
132- parameter:
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800133 name: maven-exec
134 parameters:
135 - string:
136 name: MVN
137 # yamllint disable rule:line-length
138 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{maven-version}/bin/mvn'
139 # yamllint enable
140 description: 'Maven selector to be used by shell scripts'
141
Gary Wudc3f2952017-08-23 16:48:59 -0700142- parameter:
143 name: docker-image-name
144 parameters:
145 - string:
146 name: DOCKER_IMAGE_NAME
147 # yamllint disable rule:line-length
148 default: '{docker-image-name}'
149 # yamllint enable
150 description: 'Docker image name, e.g. onap/appc'
151
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800152# PROPERTIES
153- property:
Andrew Grimberg4307a1c2017-03-16 13:00:00 -0700154 name: infra-properties
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800155 properties:
156 - build-discarder:
157 days-to-keep: '{build-days-to-keep}'
158 num-to-keep: 40
159 artifact-days-to-keep: -1
160 artifact-num-to-keep: 5
161
162# PUBLISHERS
163- publisher:
164 name: archive-artifacts
165 publishers:
166 - archive:
167 artifacts: '{artifacts}'
168 allow-empty: true
169 fingerprint: true
170 latest-only: true
171
172- publisher:
173 name: email-notification
174 publishers:
175 - email-ext:
176 recipients: 'nobody@open-o.org'
177 reply-to:
178 content-type: default
179 # yamllint disable rule:line-length
180 subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
181 # yamllint enable
182 body: |
183 $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
184
185 Check console output at $BUILD_URL to view the results.
186 unstable: true
187 fixed: true
188 send-to:
189 - developers
190 - recipients
191
192- publisher:
193 name: jacoco-report
194 publishers:
195 - jacoco:
196 exec-pattern: '**/**.exec'
197 class-pattern: '**/classes'
198 source-pattern: '**/src/main/java'
199 # yamllint disable rule:line-length
200 exclusion-pattern: '**/gen**,**/generated-sources/**,**/yang-gen**,**/pax/**'
201 # yamllint enable
202 status-update: true
203 targets:
204 - branch:
205 healthy: 10
206 unhealthy: 20
207 - method:
208 healthy: 50
209 unhealthy: 40
210
211- publisher:
JulienBe77903ed2017-07-17 15:30:26 +0200212 name: checkstyle-result
213 publishers:
214 - checkstyle:
215 pattern: '**/checkstyle-result.xml'
216 healthy: 0
217 unhealthy: 100
218 health-threshold: 'high'
219 thresholds:
220 unstable:
221 total-all: 30
222 total-high: 15
223 total-normal: 20
224 total-low: 25
225 new-all: 5
226 new-high: 0
227 new-normal: 2
228 new-low: 5
229
230- publisher:
231 name: checkstyle-result-daily
232 publishers:
233 - checkstyle:
234 pattern: '**/checkstyle-result.xml'
235 healthy: 0
236 unhealthy: 100
237 health-threshold: 'high'
238 thresholds:
239 unstable:
240 total-all: 30
241 total-high: 15
242 total-normal: 20
243 total-low: 25
244 new-all: 1
245 new-high: 0
246 new-normal: 1
247 new-low: 1
248
249- publisher:
Andrew Grimberg4307a1c2017-03-16 13:00:00 -0700250 name: infra-shiplogs
Jeremy Phelpscf6116d2018-04-03 11:15:00 -0500251 # lf-infra macro to finish up a build.
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800252 #
Jeremy Phelpscf6116d2018-04-03 11:15:00 -0500253 # Handles the following:
254 # - Shipping logs to Nexus logs site repository
255 # - Cleanup workspace
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800256 publishers:
257 - postbuildscript:
258 builders:
Jeremy Phelpscf6116d2018-04-03 11:15:00 -0500259 - role: BOTH
260 build-on:
261 - ABORTED
262 - FAILURE
263 - NOT_BUILT
264 - SUCCESS
265 - UNSTABLE
266 build-steps:
267 - lf-infra-sysstat
268 - lf-infra-ship-logs
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800269 mark-unstable-if-failed: true
270 - workspace-cleanup:
Jeremy Phelpscf6116d2018-04-03 11:15:00 -0500271 exclude:
272 # Do not clean up *.jenkins-trigger files for jobs that use a
273 # properties file as input for triggering another build.
274 - '**/*.jenkins-trigger'
275 fail-build: false
276
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800277
278# SCMS
279- scm:
280 name: git-scm
281 scm:
282 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700283 credentials-id: 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800284 url: '$GIT_BASE'
285 refspec: ''
286 branches:
Andrew Grimberg1ac7c2d2017-02-08 12:40:56 -0800287 - 'origin/{branch}'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800288 skip-tag: true
289 wipe-workspace: true
290 timeout: 30
291
292- scm:
293 name: gerrit-trigger-scm
294 scm:
295 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700296 credentials-id: 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800297 url: '$GIT_BASE'
298 refspec: '{refspec}'
299 branches:
300 - 'origin/$GERRIT_BRANCH'
301 skip-tag: true
302 timeout: 30
303 choosing-strategy: '{choosing-strategy}'
Jeremy Phelps2c76e492017-07-12 13:45:40 -0500304 submodule:
305 recursive: '{submodule-recursive}'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800306
307- scm:
308 name: gerrit-trigger-scm-basedir
309 scm:
310 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700311 credentials-id: 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800312 url: '$GIT_BASE'
313 refspec: '{refspec}'
314 branches:
315 - 'origin/$GERRIT_BRANCH'
316 skip-tag: true
317 timeout: 30
318 choosing-strategy: '{choosing-strategy}'
319 basedir: '{basedir}'
320
321- scm:
322 name: git-branch-scm
323 scm:
324 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700325 credentials-id: 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800326 url: '$GIT_BASE'
327 refspec: ''
328 branches:
329 - 'origin/{branch}'
330 skip-tag: true
331 timeout: 30
332 wipe-workspace: true
333
Andrew Grimberg1ac7c2d2017-02-08 12:40:56 -0800334- scm:
335 name: git-extra-project
336 scm:
337 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700338 credentials-id: 'onap-jenkins-ssh'
Andrew Grimberg1ac7c2d2017-02-08 12:40:56 -0800339 url: '$GIT_NO_PROJECT/{project}'
340 refspec: '{refspec}'
341 branches:
342 - 'origin/{branch}'
343 skip-tag: true
344 timeoute: 30
345 wipe-workspace: false
346 basedir: '{checkout-dir}'
347
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800348# TRIGGERS
349
350# This is a single macro to use for all jobs who vote on every (relevant) patch
351# set. Only 'recheck' trigger word is supported, it always triggers the full set
352# of relevant jobs, in order to prevent Jenkins from starting only a subset and
353# still voting Verified+1
354# Arguments:
355# server: name of gerrit server to listen to
356# project: pattern to match triggering projects
357# branch: triggering branch name
358# files: pattern to match triggering filepaths
359- trigger:
360 name: gerrit-trigger-patch-submitted
361 triggers:
362 - gerrit:
363 server-name: '{server}'
364 trigger-on:
365 - patchset-created-event:
366 exclude-drafts: 'false'
367 exclude-trivial-rebase: 'false'
368 exclude-no-code-change: 'false'
369 - draft-published-event
370 - comment-added-contains-event:
371 comment-contains-value: 'recheck'
372 projects:
373 - project-compare-type: 'ANT'
374 project-pattern: '{project}'
375 branches:
376 - branch-compare-type: 'ANT'
377 branch-pattern: '**/{branch}'
378 file-paths:
379 - compare-type: 'ANT'
380 pattern: '{files}'
381
382- trigger:
383 name: gerrit-trigger-patch-merged
384 triggers:
385 - gerrit:
386 server-name: '{server}'
387 trigger-on:
388 - change-merged-event
389 - comment-added-contains-event:
390 comment-contains-value: 'remerge'
391 projects:
392 - project-compare-type: 'ANT'
393 project-pattern: '{project}'
394 branches:
395 - branch-compare-type: 'ANT'
396 branch-pattern: '**/{branch}'
397 file-paths:
398 - compare-type: 'ANT'
399 pattern: '{files}'
400
JulienBe0d8c2c32017-02-16 11:50:48 -0800401- trigger:
402 name: gerrit-trigger-release-manually
403 triggers:
404 - gerrit:
405 server-name: '{server}'
406 trigger-on:
407 - comment-added-contains-event:
408 comment-contains-value: 'please release'
409 projects:
410 - project-compare-type: 'ANT'
411 project-pattern: '{project}'
412 branches:
413 - branch-compare-type: 'ANT'
414 branch-pattern: '**/{branch}'
415 file-paths:
416 - compare-type: 'ANT'
417 pattern: '**'
418
Anaël Clossonadcb39d2017-03-10 15:39:09 +0100419- trigger:
420 name: trigger-on-build-success
421 triggers:
Anaël Closson41ddffd2017-03-13 13:39:57 +0100422 - reverse:
423 jobs: '{job-name}'
424 result: 'success'
425
Anaël Clossonadcb39d2017-03-10 15:39:09 +0100426
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800427# WRAPPERS
428- wrapper:
429 name: build-timeout
430 wrappers:
431 - timeout:
432 type: absolute
433 timeout: 360
434 fail: true
435
436- wrapper:
Kiran Kamineni85b44e82018-03-21 11:14:29 -0700437 name: golang
438 wrappers:
439 - raw:
440 xml: |
441 <org.jenkinsci.plugins.golang.GolangBuildWrapper plugin="golang@1.2">
442 <goVersion>Golang 1.10</goVersion>
443 </org.jenkinsci.plugins.golang.GolangBuildWrapper>
444
445- wrapper:
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800446 # This wrapper is required for all jobs as it configures the wrappers
447 # needed by the eCOMP infra.
Andrew Grimberg4307a1c2017-03-16 13:00:00 -0700448 name: infra-wrappers
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800449 wrappers:
Jessica Wagantall4fecf312017-04-25 11:40:31 -0700450 - timestamps
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800451 - timeout:
452 type: absolute
453 timeout: '{build-timeout}'
454 timeout-var: 'BUILD_TIMEOUT'
455 fail: true
456 - ssh-agent-credentials:
457 users:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700458 - 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800459 - openstack:
460 single-use: true