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