blob: 1f751da62b8c73754ecdef809a0d4bbdc9889972 [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:
27 name: maven-docker-push-release
28 builders:
29 - maven-target:
Andrew Grimberge2465882017-02-24 12:38:05 -080030 maven-version: '{maven-version}'
Anaël Clossonabbafb52017-02-09 17:55:10 +010031 pom: '{pom}'
Anaël Closson09b59032017-02-16 15:44:51 +010032 goals: 'clean deploy -B -P {mvn-profile}'
Anaël Clossonabbafb52017-02-09 17:55:10 +010033 settings: '{mvn-settings}'
34 settings-type: cfp
35 global-settings: 'global-settings'
36 global-settings-type: cfp
37 properties:
38 - maven.test.skip=true
Jeremy Phelps48028ab2017-03-28 15:38:24 -050039 - docker.pull.registry=nexus3.onap.org:10001
40 - docker.push.registry=nexus3.onap.org:10002
Anaël Clossonabbafb52017-02-09 17:55:10 +010041
42- builder:
43 name: maven-docker-push-daily
44 builders:
45 - maven-target:
Andrew Grimberge2465882017-02-24 12:38:05 -080046 maven-version: '{maven-version}'
Anaël Clossonabbafb52017-02-09 17:55:10 +010047 pom: '{pom}'
Jessica Wagantallf8f030a2018-05-07 11:13:19 -070048 goals: 'clean deploy -B -P {mvn-profile} {mvn-params}'
Anaël Clossonabbafb52017-02-09 17:55:10 +010049 settings: '{mvn-settings}'
50 settings-type: cfp
51 global-settings: 'global-settings'
52 global-settings-type: cfp
53 properties:
Jeremy Phelps48028ab2017-03-28 15:38:24 -050054 - docker.pull.registry=nexus3.onap.org:10001
55 - docker.push.registry=nexus3.onap.org:10003
Anaël Clossonabbafb52017-02-09 17:55:10 +010056
Anaël Closson63e090e2017-02-15 14:50:45 +010057- builder:
Jessica Wagantall9a03dac2018-03-19 09:27:18 -070058 name: maven-docker-push-daily-test
59 builders:
60 - maven-target:
61 maven-version: '{maven-version}'
62 pom: '{pom}'
63 goals: 'clean deploy -B -P {mvn-profile}'
64 settings: '{mvn-settings}'
65 settings-type: cfp
66 global-settings: 'global-settings'
67 global-settings-type: cfp
68 properties:
69 - docker.pull.registry=nexus3.onap.org:10001
70 - docker.push.registry=nexus3.onap.org:10003
71
72- builder:
Anaël Closson63e090e2017-02-15 14:50:45 +010073 name: docker-login
74 builders:
75 - shell: !include-raw: include-docker-login.sh
76
Vanessa Rene Valderrama295975d2018-02-27 15:10:17 -080077- builder:
78 name: publish-pypi
79 builders:
80 - inject:
81 properties-content: PYPI_SERVER={pypi-server}
82 - shell:
83 !include-raw-escape: ../shell/pypi-publish.sh
84
Andrew Grimbergebc710a2017-01-30 12:59:38 -080085# PARAMETERS
86- parameter:
Andrew Grimberg4307a1c2017-03-16 13:00:00 -070087 name: infra-parameters
Andrew Grimbergebc710a2017-01-30 12:59:38 -080088 parameters:
89 - string:
90 name: PROJECT
91 default: '{project}'
92 # yamllint disable rule:line-length
93 description: 'JJB configured PROJECT parameter to identify a Gerrit project'
94 # yamllint enable
95 - string:
96 name: ARCHIVE_ARTIFACTS
97 default: '{artifacts} **/target/surefire-reports/*-output.txt'
98 # yamllint disable rule:line-length
99 description: 'Space separated glob patterns for artifacts to archive to logs hosting'
100 # yamllint enable
101 - string:
102 name: GERRIT_BRANCH
103 default: '{branch}'
104 description: 'JJB configured GERRIT_BRANCH parameter'
105 - string:
106 name: GERRIT_PROJECT
107 default: '{project}'
108 description: 'GERRIT_PROJECT parameter if not given by trigger'
109 - string:
110 name: GERRIT_REFSPEC
111 default: '{refspec}'
112 description: 'GERRIT_REFSPEC parameter if not given by trigger'
113 - string:
114 name: STACK_NAME
115 default: '$JOB_NAME-$BUILD_NUMBER'
116 description: 'Used by Heat to generate a unique stack & vm name'
117
118- parameter:
Jessica Wagantalld25908c2018-03-28 12:06:39 -0700119 name: maven-params
120 parameters:
121 - string:
122 name: MAVEN_PARAMS
123 default: '{mvn-params}'
124 description: Maven parameters to pass to the mvn command.
125
126- parameter:
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800127 name: maven-exec
128 parameters:
129 - string:
130 name: MVN
131 # yamllint disable rule:line-length
132 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{maven-version}/bin/mvn'
133 # yamllint enable
134 description: 'Maven selector to be used by shell scripts'
135
Gary Wudc3f2952017-08-23 16:48:59 -0700136- parameter:
137 name: docker-image-name
138 parameters:
139 - string:
140 name: DOCKER_IMAGE_NAME
141 # yamllint disable rule:line-length
142 default: '{docker-image-name}'
143 # yamllint enable
144 description: 'Docker image name, e.g. onap/appc'
145
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800146# PROPERTIES
147- property:
Andrew Grimberg4307a1c2017-03-16 13:00:00 -0700148 name: infra-properties
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800149 properties:
150 - build-discarder:
151 days-to-keep: '{build-days-to-keep}'
152 num-to-keep: 40
153 artifact-days-to-keep: -1
154 artifact-num-to-keep: 5
155
156# PUBLISHERS
157- publisher:
158 name: archive-artifacts
159 publishers:
160 - archive:
161 artifacts: '{artifacts}'
162 allow-empty: true
163 fingerprint: true
164 latest-only: true
165
166- publisher:
167 name: email-notification
168 publishers:
169 - email-ext:
170 recipients: 'nobody@open-o.org'
171 reply-to:
172 content-type: default
173 # yamllint disable rule:line-length
174 subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
175 # yamllint enable
176 body: |
177 $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
178
179 Check console output at $BUILD_URL to view the results.
180 unstable: true
181 fixed: true
182 send-to:
183 - developers
184 - recipients
185
186- publisher:
187 name: jacoco-report
188 publishers:
189 - jacoco:
190 exec-pattern: '**/**.exec'
191 class-pattern: '**/classes'
192 source-pattern: '**/src/main/java'
193 # yamllint disable rule:line-length
194 exclusion-pattern: '**/gen**,**/generated-sources/**,**/yang-gen**,**/pax/**'
195 # yamllint enable
196 status-update: true
197 targets:
198 - branch:
199 healthy: 10
200 unhealthy: 20
201 - method:
202 healthy: 50
203 unhealthy: 40
204
205- publisher:
JulienBe77903ed2017-07-17 15:30:26 +0200206 name: checkstyle-result
207 publishers:
208 - checkstyle:
209 pattern: '**/checkstyle-result.xml'
210 healthy: 0
211 unhealthy: 100
212 health-threshold: 'high'
213 thresholds:
214 unstable:
215 total-all: 30
216 total-high: 15
217 total-normal: 20
218 total-low: 25
219 new-all: 5
220 new-high: 0
221 new-normal: 2
222 new-low: 5
223
224- publisher:
225 name: checkstyle-result-daily
226 publishers:
227 - checkstyle:
228 pattern: '**/checkstyle-result.xml'
229 healthy: 0
230 unhealthy: 100
231 health-threshold: 'high'
232 thresholds:
233 unstable:
234 total-all: 30
235 total-high: 15
236 total-normal: 20
237 total-low: 25
238 new-all: 1
239 new-high: 0
240 new-normal: 1
241 new-low: 1
242
243- publisher:
Andrew Grimberg4307a1c2017-03-16 13:00:00 -0700244 name: infra-shiplogs
Jeremy Phelpscf6116d2018-04-03 11:15:00 -0500245 # lf-infra macro to finish up a build.
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800246 #
Jeremy Phelpscf6116d2018-04-03 11:15:00 -0500247 # Handles the following:
248 # - Shipping logs to Nexus logs site repository
249 # - Cleanup workspace
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800250 publishers:
251 - postbuildscript:
252 builders:
Jeremy Phelpscf6116d2018-04-03 11:15:00 -0500253 - role: BOTH
254 build-on:
255 - ABORTED
256 - FAILURE
257 - NOT_BUILT
258 - SUCCESS
259 - UNSTABLE
260 build-steps:
261 - lf-infra-sysstat
262 - lf-infra-ship-logs
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800263 mark-unstable-if-failed: true
264 - workspace-cleanup:
Jeremy Phelpscf6116d2018-04-03 11:15:00 -0500265 exclude:
266 # Do not clean up *.jenkins-trigger files for jobs that use a
267 # properties file as input for triggering another build.
268 - '**/*.jenkins-trigger'
269 fail-build: false
270
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800271
272# SCMS
273- scm:
274 name: git-scm
275 scm:
276 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700277 credentials-id: 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800278 url: '$GIT_BASE'
279 refspec: ''
280 branches:
Andrew Grimberg1ac7c2d2017-02-08 12:40:56 -0800281 - 'origin/{branch}'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800282 skip-tag: true
283 wipe-workspace: true
284 timeout: 30
285
286- scm:
287 name: gerrit-trigger-scm
288 scm:
289 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700290 credentials-id: 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800291 url: '$GIT_BASE'
292 refspec: '{refspec}'
293 branches:
294 - 'origin/$GERRIT_BRANCH'
295 skip-tag: true
296 timeout: 30
297 choosing-strategy: '{choosing-strategy}'
Jeremy Phelps2c76e492017-07-12 13:45:40 -0500298 submodule:
299 recursive: '{submodule-recursive}'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800300
301- scm:
302 name: gerrit-trigger-scm-basedir
303 scm:
304 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700305 credentials-id: 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800306 url: '$GIT_BASE'
307 refspec: '{refspec}'
308 branches:
309 - 'origin/$GERRIT_BRANCH'
310 skip-tag: true
311 timeout: 30
312 choosing-strategy: '{choosing-strategy}'
313 basedir: '{basedir}'
314
315- scm:
316 name: git-branch-scm
317 scm:
318 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700319 credentials-id: 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800320 url: '$GIT_BASE'
321 refspec: ''
322 branches:
323 - 'origin/{branch}'
324 skip-tag: true
325 timeout: 30
326 wipe-workspace: true
327
Andrew Grimberg1ac7c2d2017-02-08 12:40:56 -0800328- scm:
329 name: git-extra-project
330 scm:
331 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700332 credentials-id: 'onap-jenkins-ssh'
Andrew Grimberg1ac7c2d2017-02-08 12:40:56 -0800333 url: '$GIT_NO_PROJECT/{project}'
334 refspec: '{refspec}'
335 branches:
336 - 'origin/{branch}'
337 skip-tag: true
338 timeoute: 30
339 wipe-workspace: false
340 basedir: '{checkout-dir}'
341
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800342# TRIGGERS
343
344# This is a single macro to use for all jobs who vote on every (relevant) patch
345# set. Only 'recheck' trigger word is supported, it always triggers the full set
346# of relevant jobs, in order to prevent Jenkins from starting only a subset and
347# still voting Verified+1
348# Arguments:
349# server: name of gerrit server to listen to
350# project: pattern to match triggering projects
351# branch: triggering branch name
352# files: pattern to match triggering filepaths
353- trigger:
354 name: gerrit-trigger-patch-submitted
355 triggers:
356 - gerrit:
357 server-name: '{server}'
358 trigger-on:
359 - patchset-created-event:
360 exclude-drafts: 'false'
361 exclude-trivial-rebase: 'false'
362 exclude-no-code-change: 'false'
363 - draft-published-event
364 - comment-added-contains-event:
365 comment-contains-value: 'recheck'
366 projects:
367 - project-compare-type: 'ANT'
368 project-pattern: '{project}'
369 branches:
370 - branch-compare-type: 'ANT'
371 branch-pattern: '**/{branch}'
372 file-paths:
373 - compare-type: 'ANT'
374 pattern: '{files}'
375
376- trigger:
377 name: gerrit-trigger-patch-merged
378 triggers:
379 - gerrit:
380 server-name: '{server}'
381 trigger-on:
382 - change-merged-event
383 - comment-added-contains-event:
384 comment-contains-value: 'remerge'
385 projects:
386 - project-compare-type: 'ANT'
387 project-pattern: '{project}'
388 branches:
389 - branch-compare-type: 'ANT'
390 branch-pattern: '**/{branch}'
391 file-paths:
392 - compare-type: 'ANT'
393 pattern: '{files}'
394
JulienBe0d8c2c32017-02-16 11:50:48 -0800395- trigger:
396 name: gerrit-trigger-release-manually
397 triggers:
398 - gerrit:
399 server-name: '{server}'
400 trigger-on:
401 - comment-added-contains-event:
402 comment-contains-value: 'please release'
403 projects:
404 - project-compare-type: 'ANT'
405 project-pattern: '{project}'
406 branches:
407 - branch-compare-type: 'ANT'
408 branch-pattern: '**/{branch}'
409 file-paths:
410 - compare-type: 'ANT'
411 pattern: '**'
412
Anaël Clossonadcb39d2017-03-10 15:39:09 +0100413- trigger:
414 name: trigger-on-build-success
415 triggers:
Anaël Closson41ddffd2017-03-13 13:39:57 +0100416 - reverse:
417 jobs: '{job-name}'
418 result: 'success'
419
Anaël Clossonadcb39d2017-03-10 15:39:09 +0100420
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800421# WRAPPERS
422- wrapper:
423 name: build-timeout
424 wrappers:
425 - timeout:
426 type: absolute
427 timeout: 360
428 fail: true
429
430- wrapper:
Kiran Kamineni85b44e82018-03-21 11:14:29 -0700431 name: golang
432 wrappers:
433 - raw:
434 xml: |
435 <org.jenkinsci.plugins.golang.GolangBuildWrapper plugin="golang@1.2">
436 <goVersion>Golang 1.10</goVersion>
437 </org.jenkinsci.plugins.golang.GolangBuildWrapper>
438
439- wrapper:
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800440 # This wrapper is required for all jobs as it configures the wrappers
441 # needed by the eCOMP infra.
Andrew Grimberg4307a1c2017-03-16 13:00:00 -0700442 name: infra-wrappers
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800443 wrappers:
Jessica Wagantall4fecf312017-04-25 11:40:31 -0700444 - timestamps
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800445 - timeout:
446 type: absolute
447 timeout: '{build-timeout}'
448 timeout-var: 'BUILD_TIMEOUT'
449 fail: true
450 - ssh-agent-credentials:
451 users:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700452 - 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800453 - openstack:
454 single-use: true
gwuadeda5a2018-07-17 14:12:09 -0700455
456- wrapper:
457 # This wrapper is used for docker build jobs to use the dedicated docker
458 # build VM and turn off OpenStack single-use
459 name: infra-wrappers-docker-build
460 wrappers:
461 - timestamps
462 - timeout:
463 type: absolute
464 timeout: '{build-timeout}'
465 timeout-var: 'BUILD_TIMEOUT'
466 fail: true
467 - ssh-agent-credentials:
468 users:
469 - 'onap-jenkins-ssh'
470 - openstack:
471 single-use: false