blob: 826b6041d2feda51101898685f2b2cd4d98d9c9e [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:
65 name: docker-login
66 builders:
67 - shell: !include-raw: include-docker-login.sh
68
Andrew Grimbergebc710a2017-01-30 12:59:38 -080069# PARAMETERS
70- parameter:
Andrew Grimberg4307a1c2017-03-16 13:00:00 -070071 name: infra-parameters
Andrew Grimbergebc710a2017-01-30 12:59:38 -080072 parameters:
73 - string:
74 name: PROJECT
75 default: '{project}'
76 # yamllint disable rule:line-length
77 description: 'JJB configured PROJECT parameter to identify a Gerrit project'
78 # yamllint enable
79 - string:
80 name: ARCHIVE_ARTIFACTS
81 default: '{artifacts} **/target/surefire-reports/*-output.txt'
82 # yamllint disable rule:line-length
83 description: 'Space separated glob patterns for artifacts to archive to logs hosting'
84 # yamllint enable
85 - string:
86 name: GERRIT_BRANCH
87 default: '{branch}'
88 description: 'JJB configured GERRIT_BRANCH parameter'
89 - string:
90 name: GERRIT_PROJECT
91 default: '{project}'
92 description: 'GERRIT_PROJECT parameter if not given by trigger'
93 - string:
94 name: GERRIT_REFSPEC
95 default: '{refspec}'
96 description: 'GERRIT_REFSPEC parameter if not given by trigger'
97 - string:
98 name: STACK_NAME
99 default: '$JOB_NAME-$BUILD_NUMBER'
100 description: 'Used by Heat to generate a unique stack & vm name'
101
102- parameter:
103 name: maven-exec
104 parameters:
105 - string:
106 name: MVN
107 # yamllint disable rule:line-length
108 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{maven-version}/bin/mvn'
109 # yamllint enable
110 description: 'Maven selector to be used by shell scripts'
111
Gary Wudc3f2952017-08-23 16:48:59 -0700112- parameter:
113 name: docker-image-name
114 parameters:
115 - string:
116 name: DOCKER_IMAGE_NAME
117 # yamllint disable rule:line-length
118 default: '{docker-image-name}'
119 # yamllint enable
120 description: 'Docker image name, e.g. onap/appc'
121
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800122# PROPERTIES
123- property:
Andrew Grimberg4307a1c2017-03-16 13:00:00 -0700124 name: infra-properties
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800125 properties:
126 - build-discarder:
127 days-to-keep: '{build-days-to-keep}'
128 num-to-keep: 40
129 artifact-days-to-keep: -1
130 artifact-num-to-keep: 5
131
132# PUBLISHERS
133- publisher:
134 name: archive-artifacts
135 publishers:
136 - archive:
137 artifacts: '{artifacts}'
138 allow-empty: true
139 fingerprint: true
140 latest-only: true
141
142- publisher:
143 name: email-notification
144 publishers:
145 - email-ext:
146 recipients: 'nobody@open-o.org'
147 reply-to:
148 content-type: default
149 # yamllint disable rule:line-length
150 subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
151 # yamllint enable
152 body: |
153 $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
154
155 Check console output at $BUILD_URL to view the results.
156 unstable: true
157 fixed: true
158 send-to:
159 - developers
160 - recipients
161
162- publisher:
163 name: jacoco-report
164 publishers:
165 - jacoco:
166 exec-pattern: '**/**.exec'
167 class-pattern: '**/classes'
168 source-pattern: '**/src/main/java'
169 # yamllint disable rule:line-length
170 exclusion-pattern: '**/gen**,**/generated-sources/**,**/yang-gen**,**/pax/**'
171 # yamllint enable
172 status-update: true
173 targets:
174 - branch:
175 healthy: 10
176 unhealthy: 20
177 - method:
178 healthy: 50
179 unhealthy: 40
180
181- publisher:
JulienBe77903ed2017-07-17 15:30:26 +0200182 name: checkstyle-result
183 publishers:
184 - checkstyle:
185 pattern: '**/checkstyle-result.xml'
186 healthy: 0
187 unhealthy: 100
188 health-threshold: 'high'
189 thresholds:
190 unstable:
191 total-all: 30
192 total-high: 15
193 total-normal: 20
194 total-low: 25
195 new-all: 5
196 new-high: 0
197 new-normal: 2
198 new-low: 5
199
200- publisher:
201 name: checkstyle-result-daily
202 publishers:
203 - checkstyle:
204 pattern: '**/checkstyle-result.xml'
205 healthy: 0
206 unhealthy: 100
207 health-threshold: 'high'
208 thresholds:
209 unstable:
210 total-all: 30
211 total-high: 15
212 total-normal: 20
213 total-low: 25
214 new-all: 1
215 new-high: 0
216 new-normal: 1
217 new-low: 1
218
219- publisher:
Andrew Grimberg4307a1c2017-03-16 13:00:00 -0700220 name: infra-shiplogs
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800221 # To archive things, the job will need to create an "archives" directory in
222 # the workspace and this macro will handle copying the contents of the
223 # archives directory.
224 #
225 # Uses the build parameter ARCHIVE_ARTIFACTS if not empty to find files to
226 # archive. You can pass globstar patterns for example "**/*.xml **/*.log" as
227 # the archive pattern. This is a space separated list of files to archive.
228 #
229 # Also ensure that the workspace is cleaned up at the end of the build.
230 publishers:
231 - postbuildscript:
232 builders:
Andrew Grimberg8c8f8d52017-04-06 11:08:29 -0700233 - shell: !include-raw-escape: include-raw-deploy-archives.sh
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800234 - maven-target:
235 maven-version: '{maven-version}'
236 pom: '.archives/deploy-archives.xml'
237 goals: 'clean deploy -V -B -q -Dmaven.repo.local=/tmp/r'
238 settings: 'jenkins-log-archives-settings'
239 settings-type: cfp
240 global-settings: 'global-settings'
241 global-settings-type: cfp
242 - description-setter:
243 regexp: '^Build logs: .*'
244 script-only-if-succeeded: false
245 script-only-if-failed: false
246 mark-unstable-if-failed: true
247 - workspace-cleanup:
248 fail-build: false`
249
250# SCMS
251- scm:
252 name: git-scm
253 scm:
254 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700255 credentials-id: 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800256 url: '$GIT_BASE'
257 refspec: ''
258 branches:
Andrew Grimberg1ac7c2d2017-02-08 12:40:56 -0800259 - 'origin/{branch}'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800260 skip-tag: true
261 wipe-workspace: true
262 timeout: 30
263
264- scm:
265 name: gerrit-trigger-scm
266 scm:
267 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700268 credentials-id: 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800269 url: '$GIT_BASE'
270 refspec: '{refspec}'
271 branches:
272 - 'origin/$GERRIT_BRANCH'
273 skip-tag: true
274 timeout: 30
275 choosing-strategy: '{choosing-strategy}'
Jeremy Phelps2c76e492017-07-12 13:45:40 -0500276 submodule:
277 recursive: '{submodule-recursive}'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800278
279- scm:
280 name: gerrit-trigger-scm-basedir
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: '{refspec}'
286 branches:
287 - 'origin/$GERRIT_BRANCH'
288 skip-tag: true
289 timeout: 30
290 choosing-strategy: '{choosing-strategy}'
291 basedir: '{basedir}'
292
293- scm:
294 name: git-branch-scm
295 scm:
296 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700297 credentials-id: 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800298 url: '$GIT_BASE'
299 refspec: ''
300 branches:
301 - 'origin/{branch}'
302 skip-tag: true
303 timeout: 30
304 wipe-workspace: true
305
Andrew Grimberg1ac7c2d2017-02-08 12:40:56 -0800306- scm:
307 name: git-extra-project
308 scm:
309 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700310 credentials-id: 'onap-jenkins-ssh'
Andrew Grimberg1ac7c2d2017-02-08 12:40:56 -0800311 url: '$GIT_NO_PROJECT/{project}'
312 refspec: '{refspec}'
313 branches:
314 - 'origin/{branch}'
315 skip-tag: true
316 timeoute: 30
317 wipe-workspace: false
318 basedir: '{checkout-dir}'
319
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800320# TRIGGERS
321
322# This is a single macro to use for all jobs who vote on every (relevant) patch
323# set. Only 'recheck' trigger word is supported, it always triggers the full set
324# of relevant jobs, in order to prevent Jenkins from starting only a subset and
325# still voting Verified+1
326# Arguments:
327# server: name of gerrit server to listen to
328# project: pattern to match triggering projects
329# branch: triggering branch name
330# files: pattern to match triggering filepaths
331- trigger:
332 name: gerrit-trigger-patch-submitted
333 triggers:
334 - gerrit:
335 server-name: '{server}'
336 trigger-on:
337 - patchset-created-event:
338 exclude-drafts: 'false'
339 exclude-trivial-rebase: 'false'
340 exclude-no-code-change: 'false'
341 - draft-published-event
342 - comment-added-contains-event:
343 comment-contains-value: 'recheck'
344 projects:
345 - project-compare-type: 'ANT'
346 project-pattern: '{project}'
347 branches:
348 - branch-compare-type: 'ANT'
349 branch-pattern: '**/{branch}'
350 file-paths:
351 - compare-type: 'ANT'
352 pattern: '{files}'
353
354- trigger:
355 name: gerrit-trigger-patch-merged
356 triggers:
357 - gerrit:
358 server-name: '{server}'
359 trigger-on:
360 - change-merged-event
361 - comment-added-contains-event:
362 comment-contains-value: 'remerge'
363 projects:
364 - project-compare-type: 'ANT'
365 project-pattern: '{project}'
366 branches:
367 - branch-compare-type: 'ANT'
368 branch-pattern: '**/{branch}'
369 file-paths:
370 - compare-type: 'ANT'
371 pattern: '{files}'
372
JulienBe0d8c2c32017-02-16 11:50:48 -0800373- trigger:
374 name: gerrit-trigger-release-manually
375 triggers:
376 - gerrit:
377 server-name: '{server}'
378 trigger-on:
379 - comment-added-contains-event:
380 comment-contains-value: 'please release'
381 projects:
382 - project-compare-type: 'ANT'
383 project-pattern: '{project}'
384 branches:
385 - branch-compare-type: 'ANT'
386 branch-pattern: '**/{branch}'
387 file-paths:
388 - compare-type: 'ANT'
389 pattern: '**'
390
Anaël Clossonadcb39d2017-03-10 15:39:09 +0100391- trigger:
392 name: trigger-on-build-success
393 triggers:
Anaël Closson41ddffd2017-03-13 13:39:57 +0100394 - reverse:
395 jobs: '{job-name}'
396 result: 'success'
397
Anaël Clossonadcb39d2017-03-10 15:39:09 +0100398
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800399# WRAPPERS
400- wrapper:
401 name: build-timeout
402 wrappers:
403 - timeout:
404 type: absolute
405 timeout: 360
406 fail: true
407
408- wrapper:
409 # This wrapper is required for all jobs as it configures the wrappers
410 # needed by the eCOMP infra.
Andrew Grimberg4307a1c2017-03-16 13:00:00 -0700411 name: infra-wrappers
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800412 wrappers:
Jessica Wagantall4fecf312017-04-25 11:40:31 -0700413 - timestamps
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800414 - timeout:
415 type: absolute
416 timeout: '{build-timeout}'
417 timeout-var: 'BUILD_TIMEOUT'
418 fail: true
419 - ssh-agent-credentials:
420 users:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700421 - 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800422 - openstack:
423 single-use: true