blob: f7e14729751b83ecba6bdc377dbe64ba1bd21957 [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
Anaël Clossonabbafb52017-02-09 17:55:10 +010023- builder:
24 name: maven-docker-push-release
25 builders:
26 - maven-target:
27 maven-version: 'mvn33'
28 pom: '{pom}'
Anaël Closson09b59032017-02-16 15:44:51 +010029 goals: 'clean deploy -B -P {mvn-profile}'
Anaël Clossonabbafb52017-02-09 17:55:10 +010030 settings: '{mvn-settings}'
31 settings-type: cfp
32 global-settings: 'global-settings'
33 global-settings-type: cfp
34 properties:
35 - maven.test.skip=true
36 - docker.pull.registry=nexus3.openecomp.org:10001
37 - docker.push.registry=nexus3.openecomp.org:10002
38
39- builder:
40 name: maven-docker-push-daily
41 builders:
42 - maven-target:
43 maven-version: 'mvn33'
44 pom: '{pom}'
Anaël Closson09b59032017-02-16 15:44:51 +010045 goals: 'clean deploy -B -P {mvn-profile}'
Anaël Clossonabbafb52017-02-09 17:55:10 +010046 settings: '{mvn-settings}'
47 settings-type: cfp
48 global-settings: 'global-settings'
49 global-settings-type: cfp
50 properties:
51 - maven.test.skip=true
52 - docker.pull.registry=nexus3.openecomp.org:10001
53 - docker.push.registry=nexus3.openecomp.org:10003
54
Anaël Closson63e090e2017-02-15 14:50:45 +010055- builder:
56 name: docker-login
57 builders:
58 - shell: !include-raw: include-docker-login.sh
59
Andrew Grimbergebc710a2017-01-30 12:59:38 -080060# PARAMETERS
61- parameter:
62 name: ecomp-infra-parameters
63 parameters:
64 - string:
65 name: PROJECT
66 default: '{project}'
67 # yamllint disable rule:line-length
68 description: 'JJB configured PROJECT parameter to identify a Gerrit project'
69 # yamllint enable
70 - string:
71 name: ARCHIVE_ARTIFACTS
72 default: '{artifacts} **/target/surefire-reports/*-output.txt'
73 # yamllint disable rule:line-length
74 description: 'Space separated glob patterns for artifacts to archive to logs hosting'
75 # yamllint enable
76 - string:
77 name: GERRIT_BRANCH
78 default: '{branch}'
79 description: 'JJB configured GERRIT_BRANCH parameter'
80 - string:
81 name: GERRIT_PROJECT
82 default: '{project}'
83 description: 'GERRIT_PROJECT parameter if not given by trigger'
84 - string:
85 name: GERRIT_REFSPEC
86 default: '{refspec}'
87 description: 'GERRIT_REFSPEC parameter if not given by trigger'
88 - string:
89 name: STACK_NAME
90 default: '$JOB_NAME-$BUILD_NUMBER'
91 description: 'Used by Heat to generate a unique stack & vm name'
92
93- parameter:
94 name: maven-exec
95 parameters:
96 - string:
97 name: MVN
98 # yamllint disable rule:line-length
99 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{maven-version}/bin/mvn'
100 # yamllint enable
101 description: 'Maven selector to be used by shell scripts'
102
103# PROPERTIES
104- property:
105 name: ecomp-infra-properties
106 properties:
107 - build-discarder:
108 days-to-keep: '{build-days-to-keep}'
109 num-to-keep: 40
110 artifact-days-to-keep: -1
111 artifact-num-to-keep: 5
112
113# PUBLISHERS
114- publisher:
115 name: archive-artifacts
116 publishers:
117 - archive:
118 artifacts: '{artifacts}'
119 allow-empty: true
120 fingerprint: true
121 latest-only: true
122
123- publisher:
124 name: email-notification
125 publishers:
126 - email-ext:
127 recipients: 'nobody@open-o.org'
128 reply-to:
129 content-type: default
130 # yamllint disable rule:line-length
131 subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
132 # yamllint enable
133 body: |
134 $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
135
136 Check console output at $BUILD_URL to view the results.
137 unstable: true
138 fixed: true
139 send-to:
140 - developers
141 - recipients
142
143- publisher:
144 name: jacoco-report
145 publishers:
146 - jacoco:
147 exec-pattern: '**/**.exec'
148 class-pattern: '**/classes'
149 source-pattern: '**/src/main/java'
150 # yamllint disable rule:line-length
151 exclusion-pattern: '**/gen**,**/generated-sources/**,**/yang-gen**,**/pax/**'
152 # yamllint enable
153 status-update: true
154 targets:
155 - branch:
156 healthy: 10
157 unhealthy: 20
158 - method:
159 healthy: 50
160 unhealthy: 40
161
162- publisher:
163 name: ecomp-infra-shiplogs
164 # To archive things, the job will need to create an "archives" directory in
165 # the workspace and this macro will handle copying the contents of the
166 # archives directory.
167 #
168 # Uses the build parameter ARCHIVE_ARTIFACTS if not empty to find files to
169 # archive. You can pass globstar patterns for example "**/*.xml **/*.log" as
170 # the archive pattern. This is a space separated list of files to archive.
171 #
172 # Also ensure that the workspace is cleaned up at the end of the build.
173 publishers:
174 - postbuildscript:
175 builders:
176 - shell: !include-raw: include-raw-deploy-archives.sh
177 - maven-target:
178 maven-version: '{maven-version}'
179 pom: '.archives/deploy-archives.xml'
180 goals: 'clean deploy -V -B -q -Dmaven.repo.local=/tmp/r'
181 settings: 'jenkins-log-archives-settings'
182 settings-type: cfp
183 global-settings: 'global-settings'
184 global-settings-type: cfp
185 - description-setter:
186 regexp: '^Build logs: .*'
187 script-only-if-succeeded: false
188 script-only-if-failed: false
189 mark-unstable-if-failed: true
190 - workspace-cleanup:
191 fail-build: false`
192
193# SCMS
194- scm:
195 name: git-scm
196 scm:
197 - git:
198 credentials-id: 'ecomp-jenkins-ssh'
199 url: '$GIT_BASE'
200 refspec: ''
201 branches:
Andrew Grimberg1ac7c2d2017-02-08 12:40:56 -0800202 - 'origin/{branch}'
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800203 skip-tag: true
204 wipe-workspace: true
205 timeout: 30
206
207- scm:
208 name: gerrit-trigger-scm
209 scm:
210 - git:
211 credentials-id: 'ecomp-jenkins-ssh'
212 url: '$GIT_BASE'
213 refspec: '{refspec}'
214 branches:
215 - 'origin/$GERRIT_BRANCH'
216 skip-tag: true
217 timeout: 30
218 choosing-strategy: '{choosing-strategy}'
219
220- scm:
221 name: gerrit-trigger-scm-basedir
222 scm:
223 - git:
224 credentials-id: 'ecomp-jenkins-ssh'
225 url: '$GIT_BASE'
226 refspec: '{refspec}'
227 branches:
228 - 'origin/$GERRIT_BRANCH'
229 skip-tag: true
230 timeout: 30
231 choosing-strategy: '{choosing-strategy}'
232 basedir: '{basedir}'
233
234- scm:
235 name: git-branch-scm
236 scm:
237 - git:
238 credentials-id: 'ecomp-jenkins-ssh'
239 url: '$GIT_BASE'
240 refspec: ''
241 branches:
242 - 'origin/{branch}'
243 skip-tag: true
244 timeout: 30
245 wipe-workspace: true
246
Andrew Grimberg1ac7c2d2017-02-08 12:40:56 -0800247- scm:
248 name: git-extra-project
249 scm:
250 - git:
251 credentials-id: 'ecomp-jenkins-ssh'
252 url: '$GIT_NO_PROJECT/{project}'
253 refspec: '{refspec}'
254 branches:
255 - 'origin/{branch}'
256 skip-tag: true
257 timeoute: 30
258 wipe-workspace: false
259 basedir: '{checkout-dir}'
260
Andrew Grimbergebc710a2017-01-30 12:59:38 -0800261# TRIGGERS
262
263# This is a single macro to use for all jobs who vote on every (relevant) patch
264# set. Only 'recheck' trigger word is supported, it always triggers the full set
265# of relevant jobs, in order to prevent Jenkins from starting only a subset and
266# still voting Verified+1
267# Arguments:
268# server: name of gerrit server to listen to
269# project: pattern to match triggering projects
270# branch: triggering branch name
271# files: pattern to match triggering filepaths
272- trigger:
273 name: gerrit-trigger-patch-submitted
274 triggers:
275 - gerrit:
276 server-name: '{server}'
277 trigger-on:
278 - patchset-created-event:
279 exclude-drafts: 'false'
280 exclude-trivial-rebase: 'false'
281 exclude-no-code-change: 'false'
282 - draft-published-event
283 - comment-added-contains-event:
284 comment-contains-value: 'recheck'
285 projects:
286 - project-compare-type: 'ANT'
287 project-pattern: '{project}'
288 branches:
289 - branch-compare-type: 'ANT'
290 branch-pattern: '**/{branch}'
291 file-paths:
292 - compare-type: 'ANT'
293 pattern: '{files}'
294
295- trigger:
296 name: gerrit-trigger-patch-merged
297 triggers:
298 - gerrit:
299 server-name: '{server}'
300 trigger-on:
301 - change-merged-event
302 - comment-added-contains-event:
303 comment-contains-value: 'remerge'
304 projects:
305 - project-compare-type: 'ANT'
306 project-pattern: '{project}'
307 branches:
308 - branch-compare-type: 'ANT'
309 branch-pattern: '**/{branch}'
310 file-paths:
311 - compare-type: 'ANT'
312 pattern: '{files}'
313
314# WRAPPERS
315- wrapper:
316 name: build-timeout
317 wrappers:
318 - timeout:
319 type: absolute
320 timeout: 360
321 fail: true
322
323- wrapper:
324 # This wrapper is required for all jobs as it configures the wrappers
325 # needed by the eCOMP infra.
326 name: ecomp-infra-wrappers
327 wrappers:
328 - timeout:
329 type: absolute
330 timeout: '{build-timeout}'
331 timeout-var: 'BUILD_TIMEOUT'
332 fail: true
333 - ssh-agent-credentials:
334 users:
335 - 'ecomp-jenkins-ssh'
336 - openstack:
337 single-use: true