blob: 454d056ef6e8badf03605c8743b043a013eeda58 [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
112# PROPERTIES
113- property:
Andrew Grimberg4307a1c2017-03-16 13:00:00 -0700114 name: infra-properties
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800115 properties:
116 - build-discarder:
117 days-to-keep: '{build-days-to-keep}'
118 num-to-keep: 40
119 artifact-days-to-keep: -1
120 artifact-num-to-keep: 5
121
122# PUBLISHERS
123- publisher:
124 name: archive-artifacts
125 publishers:
126 - archive:
127 artifacts: '{artifacts}'
128 allow-empty: true
129 fingerprint: true
130 latest-only: true
131
132- publisher:
133 name: email-notification
134 publishers:
135 - email-ext:
136 recipients: 'nobody@open-o.org'
137 reply-to:
138 content-type: default
139 # yamllint disable rule:line-length
140 subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
141 # yamllint enable
142 body: |
143 $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
144
145 Check console output at $BUILD_URL to view the results.
146 unstable: true
147 fixed: true
148 send-to:
149 - developers
150 - recipients
151
152- publisher:
153 name: jacoco-report
154 publishers:
155 - jacoco:
156 exec-pattern: '**/**.exec'
157 class-pattern: '**/classes'
158 source-pattern: '**/src/main/java'
159 # yamllint disable rule:line-length
160 exclusion-pattern: '**/gen**,**/generated-sources/**,**/yang-gen**,**/pax/**'
161 # yamllint enable
162 status-update: true
163 targets:
164 - branch:
165 healthy: 10
166 unhealthy: 20
167 - method:
168 healthy: 50
169 unhealthy: 40
170
171- publisher:
JulienBe77903ed2017-07-17 15:30:26 +0200172 name: checkstyle-result
173 publishers:
174 - checkstyle:
175 pattern: '**/checkstyle-result.xml'
176 healthy: 0
177 unhealthy: 100
178 health-threshold: 'high'
179 thresholds:
180 unstable:
181 total-all: 30
182 total-high: 15
183 total-normal: 20
184 total-low: 25
185 new-all: 5
186 new-high: 0
187 new-normal: 2
188 new-low: 5
189
190- publisher:
191 name: checkstyle-result-daily
192 publishers:
193 - checkstyle:
194 pattern: '**/checkstyle-result.xml'
195 healthy: 0
196 unhealthy: 100
197 health-threshold: 'high'
198 thresholds:
199 unstable:
200 total-all: 30
201 total-high: 15
202 total-normal: 20
203 total-low: 25
204 new-all: 1
205 new-high: 0
206 new-normal: 1
207 new-low: 1
208
209- publisher:
Andrew Grimberg4307a1c2017-03-16 13:00:00 -0700210 name: infra-shiplogs
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800211 # To archive things, the job will need to create an "archives" directory in
212 # the workspace and this macro will handle copying the contents of the
213 # archives directory.
214 #
215 # Uses the build parameter ARCHIVE_ARTIFACTS if not empty to find files to
216 # archive. You can pass globstar patterns for example "**/*.xml **/*.log" as
217 # the archive pattern. This is a space separated list of files to archive.
218 #
219 # Also ensure that the workspace is cleaned up at the end of the build.
220 publishers:
221 - postbuildscript:
222 builders:
Andrew Grimberg8c8f8d52017-04-06 11:08:29 -0700223 - shell: !include-raw-escape: include-raw-deploy-archives.sh
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800224 - maven-target:
225 maven-version: '{maven-version}'
226 pom: '.archives/deploy-archives.xml'
227 goals: 'clean deploy -V -B -q -Dmaven.repo.local=/tmp/r'
228 settings: 'jenkins-log-archives-settings'
229 settings-type: cfp
230 global-settings: 'global-settings'
231 global-settings-type: cfp
232 - description-setter:
233 regexp: '^Build logs: .*'
234 script-only-if-succeeded: false
235 script-only-if-failed: false
236 mark-unstable-if-failed: true
237 - workspace-cleanup:
238 fail-build: false`
239
240# SCMS
241- scm:
242 name: git-scm
243 scm:
244 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700245 credentials-id: 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800246 url: '$GIT_BASE'
247 refspec: ''
248 branches:
Andrew Grimberg1ac7c2d2017-02-08 12:40:56 -0800249 - 'origin/{branch}'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800250 skip-tag: true
251 wipe-workspace: true
252 timeout: 30
253
254- scm:
255 name: gerrit-trigger-scm
256 scm:
257 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700258 credentials-id: 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800259 url: '$GIT_BASE'
260 refspec: '{refspec}'
261 branches:
262 - 'origin/$GERRIT_BRANCH'
263 skip-tag: true
264 timeout: 30
265 choosing-strategy: '{choosing-strategy}'
Jeremy Phelps2c76e492017-07-12 13:45:40 -0500266 submodule:
267 recursive: '{submodule-recursive}'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800268
269- scm:
270 name: gerrit-trigger-scm-basedir
271 scm:
272 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700273 credentials-id: 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800274 url: '$GIT_BASE'
275 refspec: '{refspec}'
276 branches:
277 - 'origin/$GERRIT_BRANCH'
278 skip-tag: true
279 timeout: 30
280 choosing-strategy: '{choosing-strategy}'
281 basedir: '{basedir}'
282
283- scm:
284 name: git-branch-scm
285 scm:
286 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700287 credentials-id: 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800288 url: '$GIT_BASE'
289 refspec: ''
290 branches:
291 - 'origin/{branch}'
292 skip-tag: true
293 timeout: 30
294 wipe-workspace: true
295
Andrew Grimberg1ac7c2d2017-02-08 12:40:56 -0800296- scm:
297 name: git-extra-project
298 scm:
299 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700300 credentials-id: 'onap-jenkins-ssh'
Andrew Grimberg1ac7c2d2017-02-08 12:40:56 -0800301 url: '$GIT_NO_PROJECT/{project}'
302 refspec: '{refspec}'
303 branches:
304 - 'origin/{branch}'
305 skip-tag: true
306 timeoute: 30
307 wipe-workspace: false
308 basedir: '{checkout-dir}'
309
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800310# TRIGGERS
311
312# This is a single macro to use for all jobs who vote on every (relevant) patch
313# set. Only 'recheck' trigger word is supported, it always triggers the full set
314# of relevant jobs, in order to prevent Jenkins from starting only a subset and
315# still voting Verified+1
316# Arguments:
317# server: name of gerrit server to listen to
318# project: pattern to match triggering projects
319# branch: triggering branch name
320# files: pattern to match triggering filepaths
321- trigger:
322 name: gerrit-trigger-patch-submitted
323 triggers:
324 - gerrit:
325 server-name: '{server}'
326 trigger-on:
327 - patchset-created-event:
328 exclude-drafts: 'false'
329 exclude-trivial-rebase: 'false'
330 exclude-no-code-change: 'false'
331 - draft-published-event
332 - comment-added-contains-event:
333 comment-contains-value: 'recheck'
334 projects:
335 - project-compare-type: 'ANT'
336 project-pattern: '{project}'
337 branches:
338 - branch-compare-type: 'ANT'
339 branch-pattern: '**/{branch}'
340 file-paths:
341 - compare-type: 'ANT'
342 pattern: '{files}'
343
344- trigger:
345 name: gerrit-trigger-patch-merged
346 triggers:
347 - gerrit:
348 server-name: '{server}'
349 trigger-on:
350 - change-merged-event
351 - comment-added-contains-event:
352 comment-contains-value: 'remerge'
353 projects:
354 - project-compare-type: 'ANT'
355 project-pattern: '{project}'
356 branches:
357 - branch-compare-type: 'ANT'
358 branch-pattern: '**/{branch}'
359 file-paths:
360 - compare-type: 'ANT'
361 pattern: '{files}'
362
JulienBe0d8c2c32017-02-16 11:50:48 -0800363- trigger:
364 name: gerrit-trigger-release-manually
365 triggers:
366 - gerrit:
367 server-name: '{server}'
368 trigger-on:
369 - comment-added-contains-event:
370 comment-contains-value: 'please release'
371 projects:
372 - project-compare-type: 'ANT'
373 project-pattern: '{project}'
374 branches:
375 - branch-compare-type: 'ANT'
376 branch-pattern: '**/{branch}'
377 file-paths:
378 - compare-type: 'ANT'
379 pattern: '**'
380
Anaël Clossonadcb39d2017-03-10 15:39:09 +0100381- trigger:
382 name: trigger-on-build-success
383 triggers:
Anaël Closson41ddffd2017-03-13 13:39:57 +0100384 - reverse:
385 jobs: '{job-name}'
386 result: 'success'
387
Anaël Clossonadcb39d2017-03-10 15:39:09 +0100388
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800389# WRAPPERS
390- wrapper:
391 name: build-timeout
392 wrappers:
393 - timeout:
394 type: absolute
395 timeout: 360
396 fail: true
397
398- wrapper:
399 # This wrapper is required for all jobs as it configures the wrappers
400 # needed by the eCOMP infra.
Andrew Grimberg4307a1c2017-03-16 13:00:00 -0700401 name: infra-wrappers
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800402 wrappers:
Jessica Wagantall4fecf312017-04-25 11:40:31 -0700403 - timestamps
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800404 - timeout:
405 type: absolute
406 timeout: '{build-timeout}'
407 timeout-var: 'BUILD_TIMEOUT'
408 fail: true
409 - ssh-agent-credentials:
410 users:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700411 - 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800412 - openstack:
413 single-use: true