Merge "Various fixes to the deb_dpkg build script"
[ci-management.git] / jjb / global-macros.yaml
1 # Global macros
2
3 #### PARAMETERS
4 - parameter:
5     name: project-parameter
6     parameters:
7         - string:
8             name: PROJECT
9             default: '{project}'
10             description: "JJB configured PROJECT parameter to identify a Gerrit project"
11
12 - parameter:
13     name: gerrit-parameter
14     parameters:
15         - string:
16             name: GERRIT_BRANCH
17             default: '{branch}'
18             description: "JJB configured GERRIT_BRANCH parameter"
19
20 - parameter:
21     name: gerrit-project-parameter
22     parameters:
23         - string:
24             name: GERRIT_PROJECT
25             default: '{project}'
26             description: "GERRIT_PROJECT parameter if not given by trigger"
27
28 - parameter:
29     name: os-parameter
30     parameters:
31         - string:
32             name: OS
33             default: '{os}'
34             description: "OS parameter"
35
36 - parameter:
37     name: gerrit-refspec-parameter
38     parameters:
39         - string:
40             name: GERRIT_REFSPEC
41             default: '{refspec}'
42             description: "GERRIT_REFSPEC parameter not given by trigger"
43
44 - parameter:
45     name: maven-project-parameter
46     parameters:
47         - string:
48             name: MAVEN_SELECTOR
49             default: '{maven}'
50             description: 'Maven selector to be used by shell scripts'
51 - parameter:
52     name: repo-name-parameter
53     parameters:
54         - string:
55             name: REPO_NAME
56             default: '{repo-name}'
57             description: 'Name of repo to which to publish packaging'
58
59
60 ##### SCMS
61 - scm:
62     name: git-scm
63     scm:
64         - git:
65             credentials-id: '{credentials-id}'
66             url: '$GIT_BASE'
67             refspec: ''
68             branches:
69                 - 'origin/{branch}'
70             skip-tag: true
71             wipe-workspace: true
72
73 - scm:
74     name: gerrit-trigger-scm
75     scm:
76         - git:
77             credentials-id: '{credentials-id}'
78             url: '$GIT_BASE'
79             refspec: '{refspec}'
80             branches:
81                 - 'origin/$GERRIT_BRANCH'
82             skip-tag: true
83             choosing-strategy: '{choosing-strategy}'
84
85 - scm:
86     name: zuul-trigger-scm
87     scm:
88       - git:
89           url: '$ZUUL_URL/$ZUUL_PROJECT'
90           refspec: '{refspec}'
91           branches:
92             - '{commit}'
93           skip-tag: true
94           wipe-workspace: true
95
96 ###### WRAPPERS
97 - wrapper:
98     name: build-timeout
99     wrappers:
100         - timeout:
101             type: absolute
102             timeout: 360
103             fail: true
104
105 - wrapper:
106     # This wrapper is used for all jobs that require no-activity timeouts
107     name: fdio-infra-wrappers-non-activity-timeout
108     wrappers:
109       - timeout:
110           type: no-activity
111           timeout: '{build-timeout}'
112           fail: true
113       - timestamps
114       - ssh-agent-credentials:
115           users:
116             - 'jenkins-gerrit-credentials'
117       - jclouds:
118           single-use: True
119
120 - wrapper:
121     # This wrapper is required for all jobs as it configures the wrappers
122     # needed by the fd.io infra.
123     name: fdio-infra-wrappers
124     wrappers:
125       - timeout:
126           type: absolute
127           timeout: '{build-timeout}'
128           timeout-var: 'BUILD_TIMEOUT'
129           fail: true
130       - timestamps
131       - ssh-agent-credentials:
132           users:
133               - 'jenkins-gerrit-credentials'
134       - jclouds:
135           single-use: True
136
137 ###### TRIGGERS
138 - trigger:
139     name: gerrit-trigger-patch-submitted
140     triggers:
141         - gerrit:
142             server-name: 'Primary'
143             trigger-on:
144                 - patchset-created-event:
145                     exclude-drafts: 'false'
146                     exclude-trivial-rebase: 'false'
147                     exclude-no-code-change: 'false'
148                 - draft-published-event
149                 - comment-added-contains-event:
150                     comment-contains-value: 'recheck'
151                 - comment-added-contains-event:
152                     comment-contains-value: 'reverify'
153             projects:
154                 - project-compare-type: 'ANT'
155                   project-pattern: '{name}'
156                   branches:
157                     - branch-compare-type: 'ANT'
158                       branch-pattern: '**/{branch}'
159
160 - trigger:
161     name: gerrit-trigger-manually-triggered
162     triggers:
163         - gerrit:
164             server-name: 'Primary'
165             trigger-on:
166                 - comment-added-contains-event:
167                     comment-contains-value: '{comment-trigger-value}'
168             projects:
169                 - project-compare-type: 'ANT'
170                   project-pattern: '{name}'
171                   branches:
172                     - branch-compare-type: 'ANT'
173                       branch-pattern: '**/{branch}'
174
175 - trigger:
176     name: gerrit-trigger-patch-merged
177     triggers:
178         - gerrit:
179             server-name: 'Primary'
180             trigger-on:
181                 - change-merged-event
182                 - comment-added-contains-event:
183                     comment-contains-value: 'remerge'
184             projects:
185                 - project-compare-type: 'ANT'
186                   project-pattern: '{name}'
187                   branches:
188                     - branch-compare-type: 'ANT'
189                       branch-pattern: '**/{branch}'
190             # Force Jenkins always vote the values it should already have voted
191             # during the prior verify phase
192             override-votes: true
193             gerrit-build-started-verified-value: 1
194             gerrit-build-successful-verified-value: 1
195             gerrit-build-failed-verified-value: 1
196             gerrit-build-unstable-verified-value: 1
197             gerrit-build-notbuilt-verified-value: 1
198             gerrit-build-started-codereview-value: 0
199             gerrit-build-successful-codereview-value: 0
200             gerrit-build-failed-codereview-value: 0
201             gerrit-build-unstable-codereview-value: 0
202             gerrit-build-notbuilt-codereview-value: 0
203
204 # Publishers
205 - publisher:
206     name: archive-artifacts
207     publishers:
208         - archive:
209             artifacts: '{artifacts}'
210             allow-empty: true
211             fingerprint: true
212             latest-only: true
213
214 - publisher:
215     name: email-notification
216     publishers:
217         - email-ext:
218             recipients: 'nobody@projectrotterdam.info'
219             reply-to:
220             content-type: default
221             subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
222             body: |
223                 $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
224
225                 Check console output at $BUILD_URL to view the results.
226             unstable: true
227             fixed: true
228             send-to:
229                 - developers
230                 - recipients
231
232 - publisher:
233     name: jacoco-report
234     publishers:
235         - jacoco:
236             exec-pattern: '**/**.exec'
237             class-pattern: '**/classes'
238             source-pattern: '**/src/main/java'
239             exclusion-pattern: '**/gen**,**/generated-sources/**,**/yang-gen**,**/pax/**'
240             status-update: true
241             targets:
242                 - branch:
243                     healthy: 10
244                     unhealthy: 20
245                 - method:
246                     healthy: 50
247                     unhealthy: 40
248
249 - publisher:
250     name: robot-report
251     publishers:
252         - robot:
253             output-path: '{output-path}'
254             other-files: ''
255
256 ###### BUILDERS
257 - builder:
258     name: ci-management-check-unicode
259     builders:
260         - shell: |
261             $WORKSPACE/scripts/check-unicode.sh jjb/
262
263 - builder:
264     name: provide-maven-settings
265     builders:
266         - config-file-provider:
267             files:
268                 - file-id: '{global-settings-file}'
269                   variable: 'GLOBAL_SETTINGS_FILE'
270                 - file-id: '{settings-file}'
271                   variable: 'SETTINGS_FILE'