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