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