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