Add a vpp-verify-{stream}-{os}-clang job
[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
52 - parameter:
53     name: maven-exec
54     parameters:
55       - string:
56           name: MVN
57           default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{maven-version}/bin/mvn'
58           description: 'Maven selector to be used by shell scripts'
59
60 - parameter:
61     name: repo-name-parameter
62     parameters:
63         - string:
64             name: REPO_NAME
65             default: '{repo-name}'
66             description: 'Name of repo to which to publish packaging'
67
68 - parameter:
69     name: compiler-parameter
70     parameters:
71         - string:
72             name: CC
73             default: '{cc}'
74             description: "CC parameter, can be gnu or clang"
75
76
77 ##### SCMS
78 - scm:
79     name: git-scm
80     scm:
81         - git:
82             credentials-id: '{credentials-id}'
83             url: '$GIT_BASE'
84             refspec: ''
85             branches:
86                 - 'origin/{branch}'
87             skip-tag: true
88             wipe-workspace: true
89
90 - scm:
91     name: gerrit-trigger-scm
92     scm:
93         - git:
94             credentials-id: '{credentials-id}'
95             url: '$GIT_BASE'
96             refspec: '{refspec}'
97             branches:
98                 - 'origin/$GERRIT_BRANCH'
99             skip-tag: true
100             choosing-strategy: '{choosing-strategy}'
101
102 - scm:
103     name: zuul-trigger-scm
104     scm:
105       - git:
106           url: '$ZUUL_URL/$ZUUL_PROJECT'
107           refspec: '{refspec}'
108           branches:
109             - '{commit}'
110           skip-tag: true
111           wipe-workspace: true
112
113 ###### WRAPPERS
114 - wrapper:
115     name: build-timeout
116     wrappers:
117         - timeout:
118             type: absolute
119             timeout: 360
120             fail: true
121
122 - wrapper:
123     # This wrapper is used for all jobs that require no-activity timeouts
124     name: fdio-infra-wrappers-non-activity-timeout
125     wrappers:
126       - timeout:
127           type: no-activity
128           timeout: '{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 - wrapper:
138     # This wrapper is required for all jobs as it configures the wrappers
139     # needed by the fd.io infra.
140     name: fdio-infra-wrappers
141     wrappers:
142       - timeout:
143           type: absolute
144           timeout: '{build-timeout}'
145           timeout-var: 'BUILD_TIMEOUT'
146           fail: true
147       - timestamps
148       - ssh-agent-credentials:
149           users:
150               - 'jenkins-gerrit-credentials'
151       - jclouds:
152           single-use: True
153
154 ###### TRIGGERS
155 - trigger:
156     name: gerrit-trigger-patch-submitted
157     triggers:
158         - gerrit:
159             server-name: 'Primary'
160             trigger-on:
161                 - patchset-created-event:
162                     exclude-drafts: 'false'
163                     exclude-trivial-rebase: 'false'
164                     exclude-no-code-change: 'false'
165                 - draft-published-event
166                 - comment-added-contains-event:
167                     comment-contains-value: 'recheck'
168                 - comment-added-contains-event:
169                     comment-contains-value: 'reverify'
170             projects:
171                 - project-compare-type: 'ANT'
172                   project-pattern: '{name}'
173                   branches:
174                     - branch-compare-type: 'ANT'
175                       branch-pattern: '**/{branch}'
176
177 - trigger:
178     name: gerrit-trigger-manually-triggered
179     triggers:
180         - gerrit:
181             server-name: 'Primary'
182             trigger-on:
183                 - comment-added-contains-event:
184                     comment-contains-value: '{comment-trigger-value}'
185             projects:
186                 - project-compare-type: 'ANT'
187                   project-pattern: '{name}'
188                   branches:
189                     - branch-compare-type: 'ANT'
190                       branch-pattern: '**/{branch}'
191
192 - trigger:
193     name: gerrit-trigger-patch-merged
194     triggers:
195         - gerrit:
196             server-name: 'Primary'
197             trigger-on:
198                 - change-merged-event
199                 - comment-added-contains-event:
200                     comment-contains-value: 'remerge'
201             projects:
202                 - project-compare-type: 'ANT'
203                   project-pattern: '{name}'
204                   branches:
205                     - branch-compare-type: 'ANT'
206                       branch-pattern: '**/{branch}'
207             # Force Jenkins always vote the values it should already have voted
208             # during the prior verify phase
209             override-votes: true
210             gerrit-build-started-verified-value: 1
211             gerrit-build-successful-verified-value: 1
212             gerrit-build-failed-verified-value: 1
213             gerrit-build-unstable-verified-value: 1
214             gerrit-build-notbuilt-verified-value: 1
215             gerrit-build-started-codereview-value: 0
216             gerrit-build-successful-codereview-value: 0
217             gerrit-build-failed-codereview-value: 0
218             gerrit-build-unstable-codereview-value: 0
219             gerrit-build-notbuilt-codereview-value: 0
220
221 # Publishers
222 - publisher:
223     name: archive-artifacts
224     publishers:
225         - archive:
226             artifacts: '{artifacts}'
227             allow-empty: true
228             fingerprint: true
229             latest-only: true
230
231 - publisher:
232     name: email-notification
233     publishers:
234         - email-ext:
235             recipients: 'nobody@projectrotterdam.info'
236             reply-to:
237             content-type: default
238             subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
239             body: |
240                 $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
241
242                 Check console output at $BUILD_URL to view the results.
243             unstable: true
244             fixed: true
245             send-to:
246                 - developers
247                 - recipients
248
249 - publisher:
250     name: jacoco-report
251     publishers:
252         - jacoco:
253             exec-pattern: '**/**.exec'
254             class-pattern: '**/classes'
255             source-pattern: '**/src/main/java'
256             exclusion-pattern: '**/gen**,**/generated-sources/**,**/yang-gen**,**/pax/**'
257             status-update: true
258             targets:
259                 - branch:
260                     healthy: 10
261                     unhealthy: 20
262                 - method:
263                     healthy: 50
264                     unhealthy: 40
265
266 - publisher:
267     name: robot-report
268     publishers:
269         - robot:
270             output-path: '{output-path}'
271             other-files: ''
272
273 ###### BUILDERS
274 - builder:
275     name: ci-management-check-unicode
276     builders:
277         - shell: |
278             $WORKSPACE/scripts/check-unicode.sh jjb/
279
280 - builder:
281     name: provide-maven-settings
282     builders:
283         - config-file-provider:
284             files:
285                 - file-id: '{global-settings-file}'
286                   variable: 'GLOBAL_SETTINGS_FILE'
287                 - file-id: '{settings-file}'
288                   variable: 'SETTINGS_FILE'