Merge "Add scalability jjb for ocpplugin"
[releng/builder.git] / jjb / releng-macros.yaml
1 # OLD Releng macros
2
3 - parameter:
4     name: project-parameter
5     parameters:
6         - string:
7             name: PROJECT
8             default: '{project}'
9             description: "JJB configured PROJECT parameter to identify an ODL Gerrit project"
10
11 - parameter:
12     name: gerrit-parameters
13     parameters:
14         - string:
15             name: GERRIT_PROJECT
16             default: '{project}'
17             description: "GERRIT_PROJECT parameter if not given by trigger"
18         - string:
19             name: GERRIT_BRANCH
20             default: '{branch}'
21             description: "JJB configured GERRIT_BRANCH parameter"
22         - string:
23             name: GERRIT_REFSPEC
24             default: '{refspec}'
25             description: "GERRIT_REFSPEC parameter if not given by trigger"
26
27 - parameter:
28     name: build-tag
29     parameters:
30         - string:
31             name: BUILD_TAG
32             default: ''
33             description: 'Tag in Git to checkout'
34
35 - parameter:
36     name: controller-version-parameter
37     parameters:
38         - string:
39             name: ODL_VERSION
40             default: '{odl_version}'
41             description: 'Controller version (for use with openstacks networking_odl project)'
42
43 - parameter:
44     name: patches-to-build-parameter
45     parameters:
46         - string:
47             name: PATCHES_TO_BUILD
48             default: ''
49             description: 'csv list of patches in project:changeset format to build distribution with'
50
51 - parameter:
52     name: distribution-branch-to-build-parameter
53     parameters:
54         - string:
55             name: DISTRIBUTION_BRANCH_TO_BUILD
56             default: 'master'
57             description: 'distribution repo branch to build with'
58
59 - parameter:
60     name: p2zip-parameter
61     parameters:
62         - string:
63             name: P2ZIP_URL
64             default: ''
65             description: 'Nexus staging profile id'
66
67 - parameter:
68     name: stage-id-parameter
69     parameters:
70         - string:
71             name: STAGING_PROFILE_ID
72             default: '{stage-id}'
73             description: 'Nexus staging profile id'
74
75 - scm:
76     name: git-scm
77     scm:
78         - git:
79             credentials-id: '{credentials-id}'
80             url: '$GIT_BASE'
81             refspec: ''
82             branches:
83                 - 'origin/{branch}'
84             skip-tag: true
85             wipe-workspace: true
86
87 - scm:
88     name: git-scm-with-submodules
89     scm:
90         - git:
91             credentials-id: '{credentials-id}'
92             url: '$GIT_BASE'
93             refspec: ''
94             branches:
95                 - 'refs/heads/{branch}'
96             skip-tag: true
97             wipe-workspace: true
98             submodule:
99                 recursive: true
100
101 - scm:
102     name: gerrit-trigger-scm
103     scm:
104         - git:
105             credentials-id: '{credentials-id}'
106             url: '$GIT_BASE'
107             refspec: '{refspec}'
108             branches:
109                 - 'origin/$GERRIT_BRANCH'
110             skip-tag: true
111             choosing-strategy: '{choosing-strategy}'
112
113 - wrapper:
114     name: build-timeout
115     wrappers:
116         - timeout:
117             type: absolute
118             timeout: 360
119             fail: true
120
121 - trigger:
122     name: gerrit-trigger-patch-submitted
123     triggers:
124         - gerrit:
125             server-name: 'OpenDaylight'
126             trigger-on:
127                 - patchset-created-event:
128                     exclude-drafts: 'false'
129                     exclude-trivial-rebase: 'false'
130                     exclude-no-code-change: 'false'
131                 - draft-published-event
132                 - comment-added-contains-event:
133                     comment-contains-value: 'recheck'
134                 - comment-added-contains-event:
135                     comment-contains-value: 'reverify'
136             projects:
137               - project-compare-type: 'ANT'
138                 project-pattern: '{name}'
139                 branches:
140                   - branch-compare-type: 'ANT'
141                     branch-pattern: '**/{branch}'
142
143 - trigger:
144     name: gerrit-trigger-relevant-patch-submitted
145     triggers:
146         - gerrit:
147             server-name: 'OpenDaylight'
148             trigger-on:
149                 - patchset-created-event:
150                     exclude-drafts: 'true'
151                     exclude-trivial-rebase: 'false'
152                     exclude-no-code-change: 'true'
153                 - draft-published-event
154                 - comment-added-contains-event:
155                     comment-contains-value: 'recheck'
156                 - comment-added-contains-event:
157                     comment-contains-value: 'reverify'
158             projects:
159               - project-compare-type: 'ANT'
160                 project-pattern: '{name}'
161                 branches:
162                   - branch-compare-type: 'ANT'
163                     branch-pattern: '**/{branch}'
164
165 - trigger:
166     name: gerrit-trigger-patch-merged
167     triggers:
168         - gerrit:
169             server-name: 'OpenDaylight'
170             trigger-on:
171                 - change-merged-event
172                 - comment-added-contains-event:
173                     comment-contains-value: 'remerge'
174             projects:
175               - project-compare-type: 'ANT'
176                 project-pattern: '{name}'
177                 branches:
178                   - branch-compare-type: 'ANT'
179                     branch-pattern: '**/{branch}'
180
181 - trigger:
182     name: gerrit-trigger-patch-sonar
183     triggers:
184         - gerrit:
185             server-name: 'OpenDaylight'
186             trigger-on:
187                 - comment-added-contains-event:
188                     comment-contains-value: 'run-sonar'
189             projects:
190               - project-compare-type: 'ANT'
191                 project-pattern: '{name}'
192                 branches:
193                   - branch-compare-type: 'ANT'
194                     branch-pattern: '**/master'
195             skip-vote:
196                 successful: true
197                 failed: true
198                 unstable: true
199                 notbuilt: true
200
201 - trigger:
202     name: gerrit-trigger-patch-site-merged
203     triggers:
204         - gerrit:
205             server-name: 'OpenDaylight'
206             trigger-on:
207                 - change-merged-event
208                 - comment-added-contains-event:
209                     comment-contains-value: 'republish'
210             projects:
211               - project-compare-type: 'ANT'
212                 project-pattern: '{name}'
213                 branches:
214                     - branch-compare-type: 'ANT'
215                       branch-pattern: '**/{branch}'
216
217 - publisher:
218     name: archive-artifacts
219     publishers:
220         - archive:
221             artifacts: '{artifacts}'
222             allow-empty: true
223             fingerprint: true
224             latest-only: true
225
226 - publisher:
227     name: email-notification
228     publishers:
229         - email-ext:
230             recipients: 'jenkins@lists.opendaylight.org'
231             reply-to:
232             content-type: default
233             subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
234             body: |
235                 $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
236
237                 Check console output at $BUILD_URL to view the results.
238             unstable: true
239             fixed: true
240             send-to:
241                 - developers
242                 - recipients
243
244 - publisher:
245         name: jacoco-report
246         publishers:
247             - jacoco:
248                 exec-pattern: "**/**.exec"
249                 class-pattern: "**/classes"
250                 source-pattern: "**/src/main/java"
251                 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
252                 status-update: true
253                 targets:
254                   - branch:
255                       healthy: 10
256                       unhealthy: 20
257                   - method:
258                       healthy: 50
259                       unhealthy: 40
260
261 - publisher:
262     name: archive-build
263     # To archive things the job will need to create a "archives" directory in
264     # the workspace and this macro will handle copying the contents of the
265     # archives directory.
266     publishers:
267         - postbuildscript:
268             builders:
269                 - shell: !include-raw: include-raw-deploy-archives.sh
270                 - maven-target:
271                         maven-version: '{maven-version}'
272                         pom: '.archives/deploy-archives.xml'
273                         goals: 'clean deploy -V -B -q -Dmaven.repo.local=/tmp/r'
274                         settings: 'jenkins-log-archives-settings'
275                         settings-type: cfp
276                         global-settings: 'odl-global-settings'
277                         global-settings-type: cfp
278                 - description-setter:
279                     regexp: '^Build logs: .*'
280             script-only-if-succeeded: False
281             script-only-if-failed: False
282             mark-unstable-if-failed: True
283
284 - builder:
285     name: wipe-org-opendaylight-repo
286     builders:
287         - shell: 'if [ -d /tmp/r/org/opendaylight ]; then rm -rf /tmp/r/org/opendaylight; fi'
288
289 - builder:
290     name: wipe-local-maven-repo
291     builders:
292         - shell: 'if [ -d /tmp/r ]; then rm -rf /tmp/r; fi'
293
294 - builder:
295     name: jacoco-nojava-workaround
296     builders:
297         - shell: 'mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes'
298
299 - builder:
300     name: check-clm
301     builders:
302         - sonatype-clm:
303             application-name: '{application-name}'
304
305 - builder:
306     name: releng-check-unicode
307     builders:
308         - shell: |
309             $WORKSPACE/scripts/check-unicode.sh jjb/
310
311 - builder:
312     name: provide-maven-settings
313     builders:
314     - config-file-provider:
315         files:
316         - file-id: '{global-settings-file}'
317           variable: 'GLOBAL_SETTINGS_FILE'
318         - file-id: '{settings-file}'
319           variable: 'SETTINGS_FILE'
320
321 - builder:
322     name: releng-fetch-p2zip-if-necessary
323     builders:
324     - shell: |
325         # Cleanup any existing zips and metadata before we download the new update site
326         rm -f *.zip *.xml
327     - conditional-step:
328         condition-kind: strings-match
329         condition-string1: '$P2ZIP_URL'
330         condition-string2: ''
331         condition-basedir: workspace
332         steps:
333             # TODO: Figure out latest snapshot version number to pull rather than hardcoding 1.1.1-SNAPSHOT
334             - maven-target:
335                 maven-version: '{maven-version}'
336                 goals: 'org.apache.maven.plugins:maven-dependency-plugin:get org.apache.maven.plugins:maven-dependency-plugin:copy -V -B -Dartifact=org.opendaylight.yangide:org.opendaylight.yangide.update-site:1.1.1-SNAPSHOT:zip -DoutputDirectory=$WORKSPACE'
337                 settings: '{settings}'
338                 global-settings: '{global-settings}'
339
340 - builder:
341     name: releng-generate-p2pom
342     builders:
343         - shell: !include-raw: include-raw-generate-p2pom.sh
344
345 - builder:
346     name: releng-update-p2composite-metadata
347     builders:
348     - shell: !include-raw: include-raw-update-p2composite-metadata.sh
349     - conditional-step:
350         condition-kind: file-exists
351         condition-filename: deploy-composite-repo.xml
352         condition-basedir: workspace
353         steps:
354             - maven-target:
355                 maven-version: '{maven-version}'
356                 pom: 'deploy-composite-repo.xml'
357                 goals: 'clean deploy -V -B -Dmaven.repo.local=/tmp/r'
358                 settings: '{settings}'
359                 global-settings: '{global-settings}'
360
361 - builder:
362     name: releng-stage-release
363     builders:
364         - shell: !include-raw: include-raw-stage-release.sh