Restrict Gerrit Triggers to OPNFV Gerrit Server
[releng.git] / jjb / escalator / escalator.yml
1 - project:
2     name: 'escalator'
3
4     project: 'escalator'
5 #####################################
6 # branch definitions
7 #####################################
8     stream:
9         - master:
10             branch: '{stream}'
11             gs-pathname: ''
12             disabled: false
13 #####################################
14 # phases
15 #####################################
16     phase:
17         - 'basic':
18             slave-label: 'opnfv-build-centos'
19         - 'build':
20             slave-label: 'opnfv-build-centos'
21 #####################################
22 # jobs
23 #####################################
24     jobs:
25         - 'escalator-verify-{stream}'
26         - 'escalator-verify-{phase}-{stream}'
27         - 'escalator-merge-{stream}'
28         - 'escalator-merge-{phase}-{stream}'
29 #####################################
30 # job templates
31 #####################################
32 - job-template:
33     name: 'escalator-verify-{stream}'
34
35     project-type: multijob
36
37     disabled: false
38
39     concurrent: true
40
41     properties:
42         - throttle:
43             enabled: true
44             max-total: 4
45             option: 'project'
46
47     scm:
48         - gerrit-trigger-scm:
49             credentials-id: '{ssh-credentials}'
50             refspec: '$GERRIT_REFSPEC'
51             choosing-strategy: 'gerrit'
52
53     wrappers:
54         - ssh-agent-credentials:
55             users:
56                 - '{ssh-credentials}'
57         - timeout:
58             timeout: 360
59             fail: true
60
61     triggers:
62         - gerrit:
63             server-name: 'gerrit.opnfv.org'
64             trigger-on:
65                 - patchset-created-event:
66                     exclude-drafts: 'false'
67                     exclude-trivial-rebase: 'false'
68                     exclude-no-code-change: 'false'
69                 - draft-published-event
70                 - comment-added-contains-event:
71                     comment-contains-value: 'recheck'
72                 - comment-added-contains-event:
73                     comment-contains-value: 'reverify'
74             projects:
75               - project-compare-type: 'ANT'
76                 project-pattern: '{project}'
77                 branches:
78                   - branch-compare-type: 'ANT'
79                     branch-pattern: '**/{branch}'
80                 forbidden-file-paths:
81                   - compare-type: ANT
82                     pattern: 'docs/**|.gitignore'
83             readable-message: true
84
85     parameters:
86         - project-parameter:
87             project: '{project}'
88         - gerrit-parameter:
89             branch: '{branch}'
90         - 'opnfv-build-defaults'
91         - 'escalator-defaults':
92             gs-pathname: '{gs-pathname}'
93
94     builders:
95         - description-setter:
96             description: "Built on $NODE_NAME"
97         - multijob:
98             name: basic
99             condition: SUCCESSFUL
100             projects:
101                 - name: 'escalator-verify-basic-{stream}'
102                   current-parameters: false
103                   predefined-parameters: |
104                     GERRIT_BRANCH=$GERRIT_BRANCH
105                     GERRIT_REFSPEC=$GERRIT_REFSPEC
106                     GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
107                     GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
108                   node-parameters: false
109                   kill-phase-on: FAILURE
110                   abort-all-job: true
111         - multijob:
112             name: build
113             condition: SUCCESSFUL
114             projects:
115                 - name: 'escalator-verify-build-{stream}'
116                   current-parameters: false
117                   predefined-parameters: |
118                     GERRIT_BRANCH=$GERRIT_BRANCH
119                     GERRIT_REFSPEC=$GERRIT_REFSPEC
120                     GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
121                     GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
122                   node-parameters: false
123                   kill-phase-on: FAILURE
124                   abort-all-job: true
125
126 - job-template:
127     name: 'escalator-verify-{phase}-{stream}'
128
129     disabled: '{obj:disabled}'
130
131     concurrent: true
132
133     scm:
134         - gerrit-trigger-scm:
135             credentials-id: '{ssh-credentials}'
136             refspec: '$GERRIT_REFSPEC'
137             choosing-strategy: 'gerrit'
138
139     wrappers:
140         - ssh-agent-credentials:
141             users:
142                 - '{ssh-credentials}'
143         - timeout:
144             timeout: 360
145             fail: true
146
147     parameters:
148         - project-parameter:
149             project: '{project}'
150         - gerrit-parameter:
151             branch: '{branch}'
152         - '{slave-label}-defaults'
153         - 'escalator-defaults':
154             gs-pathname: '{gs-pathname}'
155
156     builders:
157         - description-setter:
158             description: "Built on $NODE_NAME"
159         - '{project}-verify-{phase}-macro'
160
161 - job-template:
162     name: 'escalator-merge-{stream}'
163
164     project-type: multijob
165
166     disabled: false
167
168     concurrent: true
169
170     properties:
171         - throttle:
172             enabled: true
173             max-total: 4
174             option: 'project'
175
176     scm:
177         - gerrit-trigger-scm:
178             credentials-id: '{ssh-credentials}'
179             refspec: '$GERRIT_REFSPEC'
180             choosing-strategy: 'gerrit'
181
182     wrappers:
183         - ssh-agent-credentials:
184             users:
185                 - '{ssh-credentials}'
186         - timeout:
187             timeout: 360
188             fail: true
189
190     triggers:
191         - gerrit:
192             server-name: 'gerrit.opnfv.org'
193             trigger-on:
194                 - change-merged-event
195                 - comment-added-contains-event:
196                     comment-contains-value: 'remerge'
197             projects:
198               - project-compare-type: 'ANT'
199                 project-pattern: '{project}'
200                 branches:
201                   - branch-compare-type: 'ANT'
202                     branch-pattern: '**/{branch}'
203                 forbidden-file-paths:
204                   - compare-type: ANT
205                     pattern: 'docs/**|.gitignore'
206             readable-message: true
207
208     parameters:
209         - project-parameter:
210             project: '{project}'
211         - gerrit-parameter:
212             branch: '{branch}'
213         - 'opnfv-build-defaults'
214         - 'escalator-defaults':
215             gs-pathname: '{gs-pathname}'
216
217     builders:
218         - description-setter:
219             description: "Built on $NODE_NAME"
220         - multijob:
221             name: basic
222             condition: SUCCESSFUL
223             projects:
224                 - name: 'escalator-merge-basic-{stream}'
225                   current-parameters: false
226                   predefined-parameters: |
227                     GERRIT_BRANCH=$GERRIT_BRANCH
228                     GERRIT_REFSPEC=$GERRIT_REFSPEC
229                     GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
230                     GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
231                   node-parameters: false
232                   kill-phase-on: FAILURE
233                   abort-all-job: true
234         - multijob:
235             name: build
236             condition: SUCCESSFUL
237             projects:
238                 - name: 'escalator-merge-build-{stream}'
239                   current-parameters: false
240                   predefined-parameters: |
241                     GERRIT_BRANCH=$GERRIT_BRANCH
242                     GERRIT_REFSPEC=$GERRIT_REFSPEC
243                     GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
244                     GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
245                   node-parameters: false
246                   kill-phase-on: FAILURE
247                   abort-all-job: true
248
249 - job-template:
250     name: 'escalator-merge-{phase}-{stream}'
251
252     disabled: '{obj:disabled}'
253
254     concurrent: true
255
256     scm:
257         - gerrit-trigger-scm:
258             credentials-id: '{ssh-credentials}'
259             refspec: '$GERRIT_REFSPEC'
260             choosing-strategy: 'gerrit'
261
262     wrappers:
263         - ssh-agent-credentials:
264             users:
265                 - '{ssh-credentials}'
266         - timeout:
267             timeout: 360
268             fail: true
269
270     parameters:
271         - project-parameter:
272             project: '{project}'
273         - gerrit-parameter:
274             branch: '{branch}'
275         - '{slave-label}-defaults'
276         - 'escalator-defaults':
277             gs-pathname: '{gs-pathname}'
278
279     builders:
280         - description-setter:
281             description: "Built on $NODE_NAME"
282         - '{project}-merge-{phase}-macro'
283 #####################################
284 # builder macros
285 #####################################
286 - builder:
287     name: 'escalator-verify-basic-macro'
288     builders:
289         - shell:
290             !include-raw: ./escalator-basic.sh
291
292 - builder:
293     name: 'escalator-verify-build-macro'
294     builders:
295         - shell:
296             !include-raw: ./escalator-build.sh
297
298 - builder:
299     name: 'escalator-merge-basic-macro'
300     builders:
301         - shell:
302             !include-raw: ./escalator-basic.sh
303
304 - builder:
305     name: 'escalator-merge-build-macro'
306     builders:
307         - shell:
308             !include-raw:
309                 - ./escalator-build.sh
310                 - ./escalator-upload-artifact.sh
311 #####################################
312 # parameter macros
313 #####################################
314 - parameter:
315     name: 'escalator-defaults'
316     parameters:
317         - string:
318             name: BUILD_DIRECTORY
319             default: $WORKSPACE/build_output
320             description: "Directory where the build artifact will be located upon the completion of the build."
321         - string:
322             name: CACHE_DIRECTORY
323             default: $HOME/opnfv/cache/$INSTALLER_TYPE
324             description: "Directory where the cache to be used during the build is located."
325         - string:
326             name: GS_URL
327             default: artifacts.opnfv.org/$PROJECT{gs-pathname}
328             description: "URL to Google Storage."