blob: 27167b67e3b890c61a5ad30f7165d1c33bdaa875 [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}'
Anaël Closson09b59032017-02-16 15:44:51 +010054 goals: 'clean deploy -B -P {mvn-profile}'
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:
60 - maven.test.skip=true
Jeremy Phelps48028ab2017-03-28 15:38:24 -050061 - docker.pull.registry=nexus3.onap.org:10001
62 - docker.push.registry=nexus3.onap.org:10003
Anaël Clossonabbafb52017-02-09 17:55:10 +010063
Anaël Closson63e090e2017-02-15 14:50:45 +010064- builder:
Jessica Wagantall9a03dac2018-03-19 09:27:18 -070065 name: maven-docker-push-daily-test
66 builders:
67 - maven-target:
68 maven-version: '{maven-version}'
69 pom: '{pom}'
70 goals: 'clean deploy -B -P {mvn-profile}'
71 settings: '{mvn-settings}'
72 settings-type: cfp
73 global-settings: 'global-settings'
74 global-settings-type: cfp
75 properties:
76 - docker.pull.registry=nexus3.onap.org:10001
77 - docker.push.registry=nexus3.onap.org:10003
78
79- builder:
Anaël Closson63e090e2017-02-15 14:50:45 +010080 name: docker-login
81 builders:
82 - shell: !include-raw: include-docker-login.sh
83
Vanessa Rene Valderrama295975d2018-02-27 15:10:17 -080084- builder:
85 name: publish-pypi
86 builders:
87 - inject:
88 properties-content: PYPI_SERVER={pypi-server}
89 - shell:
90 !include-raw-escape: ../shell/pypi-publish.sh
91
Andrew Grimbergebc710a2017-01-30 12:59:38 -080092# PARAMETERS
93- parameter:
Andrew Grimberg4307a1c2017-03-16 13:00:00 -070094 name: infra-parameters
Andrew Grimbergebc710a2017-01-30 12:59:38 -080095 parameters:
96 - string:
97 name: PROJECT
98 default: '{project}'
99 # yamllint disable rule:line-length
100 description: 'JJB configured PROJECT parameter to identify a Gerrit project'
101 # yamllint enable
102 - string:
103 name: ARCHIVE_ARTIFACTS
104 default: '{artifacts} **/target/surefire-reports/*-output.txt'
105 # yamllint disable rule:line-length
106 description: 'Space separated glob patterns for artifacts to archive to logs hosting'
107 # yamllint enable
108 - string:
109 name: GERRIT_BRANCH
110 default: '{branch}'
111 description: 'JJB configured GERRIT_BRANCH parameter'
112 - string:
113 name: GERRIT_PROJECT
114 default: '{project}'
115 description: 'GERRIT_PROJECT parameter if not given by trigger'
116 - string:
117 name: GERRIT_REFSPEC
118 default: '{refspec}'
119 description: 'GERRIT_REFSPEC parameter if not given by trigger'
120 - string:
121 name: STACK_NAME
122 default: '$JOB_NAME-$BUILD_NUMBER'
123 description: 'Used by Heat to generate a unique stack & vm name'
124
125- parameter:
Jessica Wagantalld25908c2018-03-28 12:06:39 -0700126 name: maven-params
127 parameters:
128 - string:
129 name: MAVEN_PARAMS
130 default: '{mvn-params}'
131 description: Maven parameters to pass to the mvn command.
132
133- parameter:
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800134 name: maven-exec
135 parameters:
136 - string:
137 name: MVN
138 # yamllint disable rule:line-length
139 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{maven-version}/bin/mvn'
140 # yamllint enable
141 description: 'Maven selector to be used by shell scripts'
142
Gary Wudc3f2952017-08-23 16:48:59 -0700143- parameter:
144 name: docker-image-name
145 parameters:
146 - string:
147 name: DOCKER_IMAGE_NAME
148 # yamllint disable rule:line-length
149 default: '{docker-image-name}'
150 # yamllint enable
151 description: 'Docker image name, e.g. onap/appc'
152
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800153# PROPERTIES
154- property:
Andrew Grimberg4307a1c2017-03-16 13:00:00 -0700155 name: infra-properties
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800156 properties:
157 - build-discarder:
158 days-to-keep: '{build-days-to-keep}'
159 num-to-keep: 40
160 artifact-days-to-keep: -1
161 artifact-num-to-keep: 5
162
163# PUBLISHERS
164- publisher:
165 name: archive-artifacts
166 publishers:
167 - archive:
168 artifacts: '{artifacts}'
169 allow-empty: true
170 fingerprint: true
171 latest-only: true
172
173- publisher:
174 name: email-notification
175 publishers:
176 - email-ext:
177 recipients: 'nobody@open-o.org'
178 reply-to:
179 content-type: default
180 # yamllint disable rule:line-length
181 subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
182 # yamllint enable
183 body: |
184 $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
185
186 Check console output at $BUILD_URL to view the results.
187 unstable: true
188 fixed: true
189 send-to:
190 - developers
191 - recipients
192
193- publisher:
194 name: jacoco-report
195 publishers:
196 - jacoco:
197 exec-pattern: '**/**.exec'
198 class-pattern: '**/classes'
199 source-pattern: '**/src/main/java'
200 # yamllint disable rule:line-length
201 exclusion-pattern: '**/gen**,**/generated-sources/**,**/yang-gen**,**/pax/**'
202 # yamllint enable
203 status-update: true
204 targets:
205 - branch:
206 healthy: 10
207 unhealthy: 20
208 - method:
209 healthy: 50
210 unhealthy: 40
211
212- publisher:
JulienBe77903ed2017-07-17 15:30:26 +0200213 name: checkstyle-result
214 publishers:
215 - checkstyle:
216 pattern: '**/checkstyle-result.xml'
217 healthy: 0
218 unhealthy: 100
219 health-threshold: 'high'
220 thresholds:
221 unstable:
222 total-all: 30
223 total-high: 15
224 total-normal: 20
225 total-low: 25
226 new-all: 5
227 new-high: 0
228 new-normal: 2
229 new-low: 5
230
231- publisher:
232 name: checkstyle-result-daily
233 publishers:
234 - checkstyle:
235 pattern: '**/checkstyle-result.xml'
236 healthy: 0
237 unhealthy: 100
238 health-threshold: 'high'
239 thresholds:
240 unstable:
241 total-all: 30
242 total-high: 15
243 total-normal: 20
244 total-low: 25
245 new-all: 1
246 new-high: 0
247 new-normal: 1
248 new-low: 1
249
250- publisher:
Andrew Grimberg4307a1c2017-03-16 13:00:00 -0700251 name: infra-shiplogs
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800252 # To archive things, the job will need to create an "archives" directory in
253 # the workspace and this macro will handle copying the contents of the
254 # archives directory.
255 #
256 # Uses the build parameter ARCHIVE_ARTIFACTS if not empty to find files to
257 # archive. You can pass globstar patterns for example "**/*.xml **/*.log" as
258 # the archive pattern. This is a space separated list of files to archive.
259 #
260 # Also ensure that the workspace is cleaned up at the end of the build.
261 publishers:
262 - postbuildscript:
263 builders:
Andrew Grimberg8c8f8d52017-04-06 11:08:29 -0700264 - shell: !include-raw-escape: include-raw-deploy-archives.sh
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800265 - maven-target:
266 maven-version: '{maven-version}'
267 pom: '.archives/deploy-archives.xml'
268 goals: 'clean deploy -V -B -q -Dmaven.repo.local=/tmp/r'
269 settings: 'jenkins-log-archives-settings'
270 settings-type: cfp
271 global-settings: 'global-settings'
272 global-settings-type: cfp
273 - description-setter:
274 regexp: '^Build logs: .*'
275 script-only-if-succeeded: false
276 script-only-if-failed: false
277 mark-unstable-if-failed: true
278 - workspace-cleanup:
279 fail-build: false`
280
281# SCMS
282- scm:
283 name: git-scm
284 scm:
285 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700286 credentials-id: 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800287 url: '$GIT_BASE'
288 refspec: ''
289 branches:
Andrew Grimberg1ac7c2d2017-02-08 12:40:56 -0800290 - 'origin/{branch}'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800291 skip-tag: true
292 wipe-workspace: true
293 timeout: 30
294
295- scm:
296 name: gerrit-trigger-scm
297 scm:
298 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700299 credentials-id: 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800300 url: '$GIT_BASE'
301 refspec: '{refspec}'
302 branches:
303 - 'origin/$GERRIT_BRANCH'
304 skip-tag: true
305 timeout: 30
306 choosing-strategy: '{choosing-strategy}'
Jeremy Phelps2c76e492017-07-12 13:45:40 -0500307 submodule:
308 recursive: '{submodule-recursive}'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800309
310- scm:
311 name: gerrit-trigger-scm-basedir
312 scm:
313 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700314 credentials-id: 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800315 url: '$GIT_BASE'
316 refspec: '{refspec}'
317 branches:
318 - 'origin/$GERRIT_BRANCH'
319 skip-tag: true
320 timeout: 30
321 choosing-strategy: '{choosing-strategy}'
322 basedir: '{basedir}'
323
324- scm:
325 name: git-branch-scm
326 scm:
327 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700328 credentials-id: 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800329 url: '$GIT_BASE'
330 refspec: ''
331 branches:
332 - 'origin/{branch}'
333 skip-tag: true
334 timeout: 30
335 wipe-workspace: true
336
Andrew Grimberg1ac7c2d2017-02-08 12:40:56 -0800337- scm:
338 name: git-extra-project
339 scm:
340 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700341 credentials-id: 'onap-jenkins-ssh'
Andrew Grimberg1ac7c2d2017-02-08 12:40:56 -0800342 url: '$GIT_NO_PROJECT/{project}'
343 refspec: '{refspec}'
344 branches:
345 - 'origin/{branch}'
346 skip-tag: true
347 timeoute: 30
348 wipe-workspace: false
349 basedir: '{checkout-dir}'
350
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800351# TRIGGERS
352
353# This is a single macro to use for all jobs who vote on every (relevant) patch
354# set. Only 'recheck' trigger word is supported, it always triggers the full set
355# of relevant jobs, in order to prevent Jenkins from starting only a subset and
356# still voting Verified+1
357# Arguments:
358# server: name of gerrit server to listen to
359# project: pattern to match triggering projects
360# branch: triggering branch name
361# files: pattern to match triggering filepaths
362- trigger:
363 name: gerrit-trigger-patch-submitted
364 triggers:
365 - gerrit:
366 server-name: '{server}'
367 trigger-on:
368 - patchset-created-event:
369 exclude-drafts: 'false'
370 exclude-trivial-rebase: 'false'
371 exclude-no-code-change: 'false'
372 - draft-published-event
373 - comment-added-contains-event:
374 comment-contains-value: 'recheck'
375 projects:
376 - project-compare-type: 'ANT'
377 project-pattern: '{project}'
378 branches:
379 - branch-compare-type: 'ANT'
380 branch-pattern: '**/{branch}'
381 file-paths:
382 - compare-type: 'ANT'
383 pattern: '{files}'
384
385- trigger:
386 name: gerrit-trigger-patch-merged
387 triggers:
388 - gerrit:
389 server-name: '{server}'
390 trigger-on:
391 - change-merged-event
392 - comment-added-contains-event:
393 comment-contains-value: 'remerge'
394 projects:
395 - project-compare-type: 'ANT'
396 project-pattern: '{project}'
397 branches:
398 - branch-compare-type: 'ANT'
399 branch-pattern: '**/{branch}'
400 file-paths:
401 - compare-type: 'ANT'
402 pattern: '{files}'
403
JulienBe0d8c2c32017-02-16 11:50:48 -0800404- trigger:
405 name: gerrit-trigger-release-manually
406 triggers:
407 - gerrit:
408 server-name: '{server}'
409 trigger-on:
410 - comment-added-contains-event:
411 comment-contains-value: 'please release'
412 projects:
413 - project-compare-type: 'ANT'
414 project-pattern: '{project}'
415 branches:
416 - branch-compare-type: 'ANT'
417 branch-pattern: '**/{branch}'
418 file-paths:
419 - compare-type: 'ANT'
420 pattern: '**'
421
Anaël Clossonadcb39d2017-03-10 15:39:09 +0100422- trigger:
423 name: trigger-on-build-success
424 triggers:
Anaël Closson41ddffd2017-03-13 13:39:57 +0100425 - reverse:
426 jobs: '{job-name}'
427 result: 'success'
428
Anaël Clossonadcb39d2017-03-10 15:39:09 +0100429
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800430# WRAPPERS
431- wrapper:
432 name: build-timeout
433 wrappers:
434 - timeout:
435 type: absolute
436 timeout: 360
437 fail: true
438
439- wrapper:
Kiran Kamineni85b44e82018-03-21 11:14:29 -0700440 name: golang
441 wrappers:
442 - raw:
443 xml: |
444 <org.jenkinsci.plugins.golang.GolangBuildWrapper plugin="golang@1.2">
445 <goVersion>Golang 1.10</goVersion>
446 </org.jenkinsci.plugins.golang.GolangBuildWrapper>
447
448- wrapper:
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800449 # This wrapper is required for all jobs as it configures the wrappers
450 # needed by the eCOMP infra.
Andrew Grimberg4307a1c2017-03-16 13:00:00 -0700451 name: infra-wrappers
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800452 wrappers:
Jessica Wagantall4fecf312017-04-25 11:40:31 -0700453 - timestamps
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800454 - timeout:
455 type: absolute
456 timeout: '{build-timeout}'
457 timeout-var: 'BUILD_TIMEOUT'
458 fail: true
459 - ssh-agent-credentials:
460 users:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700461 - 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800462 - openstack:
463 single-use: true