Merge "No-activity timeout for csit-perf jobs"
[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     name: build-no-activity-timeout
107     wrappers:
108         - timeout:
109             type: no-activity
110             timeout: '{build-timeout}'
111             fail: true
112
113 - wrapper:
114     # This wrapper is required for all jobs as it configures the wrappers
115     # needed by the fd.io infra.
116     name: fdio-infra-wrappers
117     wrappers:
118       - timeout:
119           type: absolute
120           timeout: '{build-timeout}'
121           timeout-var: 'BUILD_TIMEOUT'
122           fail: true
123       - timestamps
124       - ssh-agent-credentials:
125           users:
126               - 'jenkins-gerrit-credentials'
127       - jclouds:
128           single-use: True
129
130 ###### TRIGGERS
131 - trigger:
132     name: gerrit-trigger-patch-submitted
133     triggers:
134         - gerrit:
135             server-name: 'Primary'
136             trigger-on:
137                 - patchset-created-event:
138                     exclude-drafts: 'false'
139                     exclude-trivial-rebase: 'false'
140                     exclude-no-code-change: 'false'
141                 - draft-published-event
142                 - comment-added-contains-event:
143                     comment-contains-value: 'recheck'
144                 - comment-added-contains-event:
145                     comment-contains-value: 'reverify'
146             projects:
147                 - project-compare-type: 'ANT'
148                   project-pattern: '{name}'
149                   branches:
150                     - branch-compare-type: 'ANT'
151                       branch-pattern: '**/{branch}'
152
153 - trigger:
154     name: gerrit-trigger-manually-triggered
155     triggers:
156         - gerrit:
157             server-name: 'Primary'
158             trigger-on:
159                 - comment-added-contains-event:
160                     comment-contains-value: '{comment-trigger-value}'
161             projects:
162                 - project-compare-type: 'ANT'
163                   project-pattern: '{name}'
164                   branches:
165                     - branch-compare-type: 'ANT'
166                       branch-pattern: '**/{branch}'
167
168 - trigger:
169     name: gerrit-trigger-patch-merged
170     triggers:
171         - gerrit:
172             server-name: 'Primary'
173             trigger-on:
174                 - change-merged-event
175                 - comment-added-contains-event:
176                     comment-contains-value: 'remerge'
177             projects:
178                 - project-compare-type: 'ANT'
179                   project-pattern: '{name}'
180                   branches:
181                     - branch-compare-type: 'ANT'
182                       branch-pattern: '**/{branch}'
183             # Force Jenkins always vote the values it should already have voted
184             # during the prior verify phase
185             override-votes: true
186             gerrit-build-started-verified-value: 1
187             gerrit-build-successful-verified-value: 1
188             gerrit-build-failed-verified-value: 1
189             gerrit-build-unstable-verified-value: 1
190             gerrit-build-notbuilt-verified-value: 1
191             gerrit-build-started-codereview-value: 0
192             gerrit-build-successful-codereview-value: 0
193             gerrit-build-failed-codereview-value: 0
194             gerrit-build-unstable-codereview-value: 0
195             gerrit-build-notbuilt-codereview-value: 0
196
197 # Publishers
198 - publisher:
199     name: archive-artifacts
200     publishers:
201         - archive:
202             artifacts: '{artifacts}'
203             allow-empty: true
204             fingerprint: true
205             latest-only: true
206
207 - publisher:
208     name: email-notification
209     publishers:
210         - email-ext:
211             recipients: 'nobody@projectrotterdam.info'
212             reply-to:
213             content-type: default
214             subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
215             body: |
216                 $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
217
218                 Check console output at $BUILD_URL to view the results.
219             unstable: true
220             fixed: true
221             send-to:
222                 - developers
223                 - recipients
224
225 - publisher:
226     name: jacoco-report
227     publishers:
228         - jacoco:
229             exec-pattern: '**/**.exec'
230             class-pattern: '**/classes'
231             source-pattern: '**/src/main/java'
232             exclusion-pattern: '**/gen**,**/generated-sources/**,**/yang-gen**,**/pax/**'
233             status-update: true
234             targets:
235                 - branch:
236                     healthy: 10
237                     unhealthy: 20
238                 - method:
239                     healthy: 50
240                     unhealthy: 40
241
242 - publisher:
243     name: robot-report
244     publishers:
245         - robot:
246             output-path: '{output-path}'
247             other-files: ''
248
249 ###### BUILDERS
250 - builder:
251     name: ci-management-check-unicode
252     builders:
253         - shell: |
254             $WORKSPACE/scripts/check-unicode.sh jjb/
255
256 - builder:
257     name: provide-maven-settings
258     builders:
259         - config-file-provider:
260             files:
261                 - file-id: '{global-settings-file}'
262                   variable: 'GLOBAL_SETTINGS_FILE'
263                 - file-id: '{settings-file}'
264                   variable: 'SETTINGS_FILE'