Enable shallow clone for git repos
[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-parameter
13     parameters:
14         - string:
15             name: GERRIT_BRANCH
16             default: '{branch}'
17             description: "JJB configured GERRIT_BRANCH parameter"
18
19 - parameter:
20     name: gerrit-project-parameter
21     parameters:
22         - string:
23             name: GERRIT_PROJECT
24             default: '{project}'
25             description: "GERRIT_PROJECT parameter if not given by trigger"
26
27 - parameter:
28     name: gerrit-refspec-parameter
29     parameters:
30         - string:
31             name: GERRIT_REFSPEC
32             default: '{refspec}'
33             description: "GERRIT_REFSPEC parameter if not given by trigger"
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 - scm:
60     name: git-scm
61     scm:
62         - git:
63             credentials-id: '{credentials-id}'
64             url: '$GIT_BASE'
65             refspec: ''
66             branches:
67                 - 'origin/{branch}'
68             skip-tag: true
69             shallow-clone: true
70             wipe-workspace: true
71
72 - scm:
73     name: gerrit-trigger-scm
74     scm:
75         - git:
76             credentials-id: '{credentials-id}'
77             url: '$GIT_BASE'
78             refspec: '{refspec}'
79             branches:
80                 - 'origin/$GERRIT_BRANCH'
81             skip-tag: true
82             shallow-clone: true
83             choosing-strategy: '{choosing-strategy}'
84
85 - wrapper:
86     name: build-timeout
87     wrappers:
88         - timeout:
89             type: absolute
90             timeout: 360
91             fail: true
92
93 - trigger:
94     name: gerrit-trigger-patch-submitted
95     triggers:
96         - gerrit:
97             server-name: 'OpenDaylight'
98             trigger-on:
99                 - patchset-created-event:
100                     exclude-drafts: 'false'
101                     exclude-trivial-rebase: 'false'
102                     exclude-no-code-change: 'false'
103                 - draft-published-event
104                 - comment-added-contains-event:
105                     comment-contains-value: 'recheck'
106                 - comment-added-contains-event:
107                     comment-contains-value: 'reverify'
108             projects:
109               - project-compare-type: 'ANT'
110                 project-pattern: '{name}'
111                 branches:
112                   - branch-compare-type: 'ANT'
113                     branch-pattern: '**/{branch}'
114
115 - trigger:
116     name: gerrit-trigger-patch-merged
117     triggers:
118         - gerrit:
119             server-name: 'OpenDaylight'
120             trigger-on:
121                 - change-merged-event
122                 - comment-added-contains-event:
123                     comment-contains-value: 'remerge'
124             projects:
125               - project-compare-type: 'ANT'
126                 project-pattern: '{name}'
127                 branches:
128                   - branch-compare-type: 'ANT'
129                     branch-pattern: '**/{branch}'
130
131 - trigger:
132     name: gerrit-trigger-patch-sonar
133     triggers:
134         - gerrit:
135             server-name: 'OpenDaylight'
136             trigger-on:
137                 - comment-added-contains-event:
138                     comment-contains-value: 'run-sonar'
139             projects:
140               - project-compare-type: 'ANT'
141                 project-pattern: '{name}'
142                 branches:
143                   - branch-compare-type: 'ANT'
144                     branch-pattern: '**/master'
145             skip-vote:
146                 successful: true
147                 failed: true
148                 unstable: true
149                 notbuilt: true
150
151 - trigger:
152     name: gerrit-trigger-patch-site-merged
153     triggers:
154         - gerrit:
155             server-name: 'OpenDaylight'
156             trigger-on:
157                 - change-merged-event
158                 - comment-added-contains-event:
159                     comment-contains-value: 'republish'
160             projects:
161               - project-compare-type: 'ANT'
162                 project-pattern: '{name}'
163                 branches:
164                     - branch-compare-type: 'ANT'
165                       branch-pattern: '**/{branch}'
166
167 - publisher:
168     name: archive-artifacts
169     publishers:
170         - archive:
171             artifacts: '{artifacts}'
172             allow-empty: true
173             fingerprint: true
174             latest-only: true
175
176 - publisher:
177     name: email-notification
178     publishers:
179         - email-ext:
180             recipients: 'jenkins@lists.opendaylight.org'
181             reply-to:
182             content-type: default
183             subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
184             body: |
185                 $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
186
187                 Check console output at $BUILD_URL to view the results.
188             unstable: true
189             fixed: true
190             send-to:
191                 - developers
192                 - recipients
193
194 - publisher:
195         name: jacoco-report
196         publishers:
197             - jacoco:
198                 exec-pattern: "**/**.exec"
199                 class-pattern: "**/classes"
200                 source-pattern: "**/src/main/java"
201                 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
202                 status-update: true
203                 targets:
204                   - branch:
205                       healthy: 10
206                       unhealthy: 20
207                   - method:
208                       healthy: 50
209                       unhealthy: 40
210
211 - builder:
212     name: wipe-org-opendaylight-repo
213     builders:
214         - shell: 'if [ -d /tmp/r/org/opendaylight ]; then rm -rf /tmp/r/org/opendaylight; fi'
215
216 - builder:
217     name: jacoco-nojava-workaround
218     builders:
219         - shell: 'mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes'
220
221 - builder:
222     name: check-clm
223     builders:
224         - sonatype-clm:
225             application-name: '{application-name}'
226
227 - builder:
228     name: releng-check-unicode
229     builders:
230         - shell: |
231             $WORKSPACE/scripts/check-unicode.sh jjb/
232
233 - builder:
234     name: provide-maven-settings
235     builders:
236     - config-file-provider:
237         files:
238         - file-id: '{global-settings-file}'
239           variable: 'GLOBAL_SETTINGS_FILE'
240         - file-id: '{settings-file}'
241           variable: 'SETTINGS_FILE'