blob: 2270f576c1baa6a8398c22495f1b9b76a45343d7 [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:
Andrew Grimberg4307a1c2017-03-16 13:00:00 -0700172 name: infra-shiplogs
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800173 # To archive things, the job will need to create an "archives" directory in
174 # the workspace and this macro will handle copying the contents of the
175 # archives directory.
176 #
177 # Uses the build parameter ARCHIVE_ARTIFACTS if not empty to find files to
178 # archive. You can pass globstar patterns for example "**/*.xml **/*.log" as
179 # the archive pattern. This is a space separated list of files to archive.
180 #
181 # Also ensure that the workspace is cleaned up at the end of the build.
182 publishers:
183 - postbuildscript:
184 builders:
Andrew Grimberg8c8f8d52017-04-06 11:08:29 -0700185 - shell: !include-raw-escape: include-raw-deploy-archives.sh
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800186 - maven-target:
187 maven-version: '{maven-version}'
188 pom: '.archives/deploy-archives.xml'
189 goals: 'clean deploy -V -B -q -Dmaven.repo.local=/tmp/r'
190 settings: 'jenkins-log-archives-settings'
191 settings-type: cfp
192 global-settings: 'global-settings'
193 global-settings-type: cfp
194 - description-setter:
195 regexp: '^Build logs: .*'
196 script-only-if-succeeded: false
197 script-only-if-failed: false
198 mark-unstable-if-failed: true
199 - workspace-cleanup:
200 fail-build: false`
201
202# SCMS
203- scm:
204 name: git-scm
205 scm:
206 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700207 credentials-id: 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800208 url: '$GIT_BASE'
209 refspec: ''
210 branches:
Andrew Grimberg1ac7c2d2017-02-08 12:40:56 -0800211 - 'origin/{branch}'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800212 skip-tag: true
213 wipe-workspace: true
214 timeout: 30
215
216- scm:
217 name: gerrit-trigger-scm
218 scm:
219 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700220 credentials-id: 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800221 url: '$GIT_BASE'
222 refspec: '{refspec}'
223 branches:
224 - 'origin/$GERRIT_BRANCH'
225 skip-tag: true
226 timeout: 30
227 choosing-strategy: '{choosing-strategy}'
Jeremy Phelps2c76e492017-07-12 13:45:40 -0500228 submodule:
229 recursive: '{submodule-recursive}'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800230
231- scm:
232 name: gerrit-trigger-scm-basedir
233 scm:
234 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700235 credentials-id: 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800236 url: '$GIT_BASE'
237 refspec: '{refspec}'
238 branches:
239 - 'origin/$GERRIT_BRANCH'
240 skip-tag: true
241 timeout: 30
242 choosing-strategy: '{choosing-strategy}'
243 basedir: '{basedir}'
244
245- scm:
246 name: git-branch-scm
247 scm:
248 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700249 credentials-id: 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800250 url: '$GIT_BASE'
251 refspec: ''
252 branches:
253 - 'origin/{branch}'
254 skip-tag: true
255 timeout: 30
256 wipe-workspace: true
257
Andrew Grimberg1ac7c2d2017-02-08 12:40:56 -0800258- scm:
259 name: git-extra-project
260 scm:
261 - git:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700262 credentials-id: 'onap-jenkins-ssh'
Andrew Grimberg1ac7c2d2017-02-08 12:40:56 -0800263 url: '$GIT_NO_PROJECT/{project}'
264 refspec: '{refspec}'
265 branches:
266 - 'origin/{branch}'
267 skip-tag: true
268 timeoute: 30
269 wipe-workspace: false
270 basedir: '{checkout-dir}'
271
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800272# TRIGGERS
273
274# This is a single macro to use for all jobs who vote on every (relevant) patch
275# set. Only 'recheck' trigger word is supported, it always triggers the full set
276# of relevant jobs, in order to prevent Jenkins from starting only a subset and
277# still voting Verified+1
278# Arguments:
279# server: name of gerrit server to listen to
280# project: pattern to match triggering projects
281# branch: triggering branch name
282# files: pattern to match triggering filepaths
283- trigger:
284 name: gerrit-trigger-patch-submitted
285 triggers:
286 - gerrit:
287 server-name: '{server}'
288 trigger-on:
289 - patchset-created-event:
290 exclude-drafts: 'false'
291 exclude-trivial-rebase: 'false'
292 exclude-no-code-change: 'false'
293 - draft-published-event
294 - comment-added-contains-event:
295 comment-contains-value: 'recheck'
296 projects:
297 - project-compare-type: 'ANT'
298 project-pattern: '{project}'
299 branches:
300 - branch-compare-type: 'ANT'
301 branch-pattern: '**/{branch}'
302 file-paths:
303 - compare-type: 'ANT'
304 pattern: '{files}'
305
306- trigger:
307 name: gerrit-trigger-patch-merged
308 triggers:
309 - gerrit:
310 server-name: '{server}'
311 trigger-on:
312 - change-merged-event
313 - comment-added-contains-event:
314 comment-contains-value: 'remerge'
315 projects:
316 - project-compare-type: 'ANT'
317 project-pattern: '{project}'
318 branches:
319 - branch-compare-type: 'ANT'
320 branch-pattern: '**/{branch}'
321 file-paths:
322 - compare-type: 'ANT'
323 pattern: '{files}'
324
JulienBe0d8c2c32017-02-16 11:50:48 -0800325- trigger:
326 name: gerrit-trigger-release-manually
327 triggers:
328 - gerrit:
329 server-name: '{server}'
330 trigger-on:
331 - comment-added-contains-event:
332 comment-contains-value: 'please release'
333 projects:
334 - project-compare-type: 'ANT'
335 project-pattern: '{project}'
336 branches:
337 - branch-compare-type: 'ANT'
338 branch-pattern: '**/{branch}'
339 file-paths:
340 - compare-type: 'ANT'
341 pattern: '**'
342
Anaël Clossonadcb39d2017-03-10 15:39:09 +0100343- trigger:
344 name: trigger-on-build-success
345 triggers:
Anaël Closson41ddffd2017-03-13 13:39:57 +0100346 - reverse:
347 jobs: '{job-name}'
348 result: 'success'
349
Anaël Clossonadcb39d2017-03-10 15:39:09 +0100350
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800351# WRAPPERS
352- wrapper:
353 name: build-timeout
354 wrappers:
355 - timeout:
356 type: absolute
357 timeout: 360
358 fail: true
359
360- wrapper:
361 # This wrapper is required for all jobs as it configures the wrappers
362 # needed by the eCOMP infra.
Andrew Grimberg4307a1c2017-03-16 13:00:00 -0700363 name: infra-wrappers
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800364 wrappers:
Jessica Wagantall4fecf312017-04-25 11:40:31 -0700365 - timestamps
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800366 - timeout:
367 type: absolute
368 timeout: '{build-timeout}'
369 timeout-var: 'BUILD_TIMEOUT'
370 fail: true
371 - ssh-agent-credentials:
372 users:
Andrew Grimberg7d5be572017-03-16 12:33:21 -0700373 - 'onap-jenkins-ssh'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800374 - openstack:
375 single-use: true