blob: 6be0e0f941dc1de047f4a059a55cf50a7a731e81 [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:
126 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
242- publisher:
Andrew Grimberg4307a1c2017-03-16 13:00:00 -0700243 name: infra-shiplogs
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800244 # To archive things, the job will need to create an "archives" directory in
245 # the workspace and this macro will handle copying the contents of the
246 # archives directory.
247 #
248 # Uses the build parameter ARCHIVE_ARTIFACTS if not empty to find files to
249 # archive. You can pass globstar patterns for example "**/*.xml **/*.log" as
250 # the archive pattern. This is a space separated list of files to archive.
251 #
252 # Also ensure that the workspace is cleaned up at the end of the build.
253 publishers:
254 - postbuildscript:
255 builders:
Andrew Grimberg8c8f8d52017-04-06 11:08:29 -0700256 - shell: !include-raw-escape: include-raw-deploy-archives.sh
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800257 - maven-target:
258 maven-version: '{maven-version}'
259 pom: '.archives/deploy-archives.xml'
260 goals: 'clean deploy -V -B -q -Dmaven.repo.local=/tmp/r'
261 settings: 'jenkins-log-archives-settings'
262 settings-type: cfp
263 global-settings: 'global-settings'
264 global-settings-type: cfp
265 - description-setter:
266 regexp: '^Build logs: .*'
267 script-only-if-succeeded: false
268 script-only-if-failed: false
269 mark-unstable-if-failed: true
270 - workspace-cleanup:
271 fail-build: false`
272
273# SCMS
274- scm:
275 name: git-scm
276 scm:
277 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700278 credentials-id: 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800279 url: '$GIT_BASE'
280 refspec: ''
281 branches:
Andrew Grimberg1ac7c2d2017-02-08 12:40:56 -0800282 - 'origin/{branch}'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800283 skip-tag: true
284 wipe-workspace: true
285 timeout: 30
286
287- scm:
288 name: gerrit-trigger-scm
289 scm:
290 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700291 credentials-id: 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800292 url: '$GIT_BASE'
293 refspec: '{refspec}'
294 branches:
295 - 'origin/$GERRIT_BRANCH'
296 skip-tag: true
297 timeout: 30
298 choosing-strategy: '{choosing-strategy}'
Jeremy Phelps2c76e492017-07-12 13:45:40 -0500299 submodule:
300 recursive: '{submodule-recursive}'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800301
302- scm:
303 name: gerrit-trigger-scm-basedir
304 scm:
305 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700306 credentials-id: 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800307 url: '$GIT_BASE'
308 refspec: '{refspec}'
309 branches:
310 - 'origin/$GERRIT_BRANCH'
311 skip-tag: true
312 timeout: 30
313 choosing-strategy: '{choosing-strategy}'
314 basedir: '{basedir}'
315
316- scm:
317 name: git-branch-scm
318 scm:
319 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700320 credentials-id: 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800321 url: '$GIT_BASE'
322 refspec: ''
323 branches:
324 - 'origin/{branch}'
325 skip-tag: true
326 timeout: 30
327 wipe-workspace: true
328
Andrew Grimberg1ac7c2d2017-02-08 12:40:56 -0800329- scm:
330 name: git-extra-project
331 scm:
332 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700333 credentials-id: 'onap-jenkins-ssh'
Andrew Grimberg1ac7c2d2017-02-08 12:40:56 -0800334 url: '$GIT_NO_PROJECT/{project}'
335 refspec: '{refspec}'
336 branches:
337 - 'origin/{branch}'
338 skip-tag: true
339 timeoute: 30
340 wipe-workspace: false
341 basedir: '{checkout-dir}'
342
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800343# TRIGGERS
344
345# This is a single macro to use for all jobs who vote on every (relevant) patch
346# set. Only 'recheck' trigger word is supported, it always triggers the full set
347# of relevant jobs, in order to prevent Jenkins from starting only a subset and
348# still voting Verified+1
349# Arguments:
350# server: name of gerrit server to listen to
351# project: pattern to match triggering projects
352# branch: triggering branch name
353# files: pattern to match triggering filepaths
354- trigger:
355 name: gerrit-trigger-patch-submitted
356 triggers:
357 - gerrit:
358 server-name: '{server}'
359 trigger-on:
360 - patchset-created-event:
361 exclude-drafts: 'false'
362 exclude-trivial-rebase: 'false'
363 exclude-no-code-change: 'false'
364 - draft-published-event
365 - comment-added-contains-event:
366 comment-contains-value: 'recheck'
367 projects:
368 - project-compare-type: 'ANT'
369 project-pattern: '{project}'
370 branches:
371 - branch-compare-type: 'ANT'
372 branch-pattern: '**/{branch}'
373 file-paths:
374 - compare-type: 'ANT'
375 pattern: '{files}'
376
377- trigger:
378 name: gerrit-trigger-patch-merged
379 triggers:
380 - gerrit:
381 server-name: '{server}'
382 trigger-on:
383 - change-merged-event
384 - comment-added-contains-event:
385 comment-contains-value: 'remerge'
386 projects:
387 - project-compare-type: 'ANT'
388 project-pattern: '{project}'
389 branches:
390 - branch-compare-type: 'ANT'
391 branch-pattern: '**/{branch}'
392 file-paths:
393 - compare-type: 'ANT'
394 pattern: '{files}'
395
JulienBe0d8c2c32017-02-16 11:50:48 -0800396- trigger:
397 name: gerrit-trigger-release-manually
398 triggers:
399 - gerrit:
400 server-name: '{server}'
401 trigger-on:
402 - comment-added-contains-event:
403 comment-contains-value: 'please release'
404 projects:
405 - project-compare-type: 'ANT'
406 project-pattern: '{project}'
407 branches:
408 - branch-compare-type: 'ANT'
409 branch-pattern: '**/{branch}'
410 file-paths:
411 - compare-type: 'ANT'
412 pattern: '**'
413
Anaël Clossonadcb39d2017-03-10 15:39:09 +0100414- trigger:
415 name: trigger-on-build-success
416 triggers:
Anaël Closson41ddffd2017-03-13 13:39:57 +0100417 - reverse:
418 jobs: '{job-name}'
419 result: 'success'
420
Anaël Clossonadcb39d2017-03-10 15:39:09 +0100421
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800422# WRAPPERS
423- wrapper:
424 name: build-timeout
425 wrappers:
426 - timeout:
427 type: absolute
428 timeout: 360
429 fail: true
430
431- wrapper:
Kiran Kamineni85b44e82018-03-21 11:14:29 -0700432 name: golang
433 wrappers:
434 - raw:
435 xml: |
436 <org.jenkinsci.plugins.golang.GolangBuildWrapper plugin="golang@1.2">
437 <goVersion>Golang 1.10</goVersion>
438 </org.jenkinsci.plugins.golang.GolangBuildWrapper>
439
440- wrapper:
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800441 # This wrapper is required for all jobs as it configures the wrappers
442 # needed by the eCOMP infra.
Andrew Grimberg4307a1c2017-03-16 13:00:00 -0700443 name: infra-wrappers
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800444 wrappers:
Jessica Wagantall4fecf312017-04-25 11:40:31 -0700445 - timestamps
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800446 - timeout:
447 type: absolute
448 timeout: '{build-timeout}'
449 timeout-var: 'BUILD_TIMEOUT'
450 fail: true
451 - ssh-agent-credentials:
452 users:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700453 - 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800454 - openstack:
455 single-use: true