Apex: Enables verify trigger for ci directory
[releng.git] / jjb / apex / apex-verify-jobs.yml
1 ---
2 - project:
3     name: 'apex-verify-jobs'
4     project: 'apex'
5     jobs:
6       - 'apex-verify-{stream}'
7       - 'apex-verify-gate-{stream}'
8       - 'apex-verify-unit-tests-{stream}'
9     stream:
10       - master: &master
11           branch: '{stream}'
12           gs-pathname: ''
13           verify-scenario: 'os-odl-nofeature-ha'
14           disabled: false
15       - danube: &danube
16           branch: 'stable/{stream}'
17           gs-pathname: '/{stream}'
18           verify-scenario: 'os-odl_l3-nofeature-ha'
19           disabled: true
20       - euphrates: &euphrates
21           branch: 'stable/{stream}'
22           gs-pathname: '/{stream}'
23           verify-scenario: 'os-odl-nofeature-ha'
24           disabled: false
25
26 # Unit Test
27 - job-template:
28     name: 'apex-verify-unit-tests-{stream}'
29
30     node: 'apex-build-{stream}'
31
32     concurrent: true
33
34     disabled: '{obj:disabled}'
35
36     parameters:
37       - apex-parameter:
38           gs-pathname: '{gs-pathname}'
39       - project-parameter:
40           project: '{project}'
41           branch: '{branch}'
42
43     scm:
44       - git-scm-gerrit
45
46     triggers:
47       - gerrit:
48           server-name: 'gerrit.opnfv.org'
49           trigger-on:
50             - patchset-created-event:
51                 exclude-drafts: 'false'
52                 exclude-trivial-rebase: 'false'
53                 exclude-no-code-change: 'true'
54             - draft-published-event
55             - comment-added-contains-event:
56                 comment-contains-value: 'recheck'
57             - comment-added-contains-event:
58                 comment-contains-value: 'reverify'
59           projects:
60             - project-compare-type: 'ANT'
61               project-pattern: 'apex'
62               branches:
63                 - branch-compare-type: 'ANT'
64                   branch-pattern: '**/{branch}'
65               disable-strict-forbidden-file-verification: 'false'
66               file-paths:
67                 - compare-type: ANT
68                   pattern: 'apex/tests/**'
69               forbidden-file-paths:
70                 - compare-type: ANT
71                   pattern: '*'
72                 - compare-type: ANT
73                   pattern: 'apex/*'
74                 - compare-type: ANT
75                   pattern: 'build/**'
76                 - compare-type: ANT
77                   pattern: 'lib/**'
78                 - compare-type: ANT
79                   pattern: 'config/**'
80                 - compare-type: ANT
81                   pattern: 'apex/build/**'
82                 - compare-type: ANT
83                   pattern: 'apex/common/**'
84                 - compare-type: ANT
85                   pattern: 'apex/inventory/**'
86                 - compare-type: ANT
87                   pattern: 'apex/network/**'
88                 - compare-type: ANT
89                   pattern: 'apex/overcloud/**'
90                 - compare-type: ANT
91                   pattern: 'apex/settings/**'
92                 - compare-type: ANT
93                   pattern: 'apex/undercloud/**'
94                 - compare-type: ANT
95                   pattern: 'apex/virtual/**'
96
97     properties:
98       - logrotate-default
99       - throttle:
100           max-per-node: 1
101           max-total: 10
102           option: 'project'
103
104     builders:
105       - apex-unit-test
106
107 # Verify
108 - job-template:
109     name: 'apex-verify-{stream}'
110
111     node: 'apex-virtual-master'
112
113     concurrent: true
114
115     disabled: '{obj:disabled}'
116
117     project-type: 'multijob'
118
119     parameters:
120       - apex-parameter:
121           gs-pathname: '{gs-pathname}/dev'
122       - project-parameter:
123           project: '{project}'
124           branch: '{branch}'
125       - string:
126           name: ARTIFACT_VERSION
127           default: dev
128           description: "Used for overriding the ARTIFACT_VERSION"
129     scm:
130       - git-scm-gerrit
131
132     triggers:
133       - gerrit:
134           server-name: 'gerrit.opnfv.org'
135           trigger-on:
136             - patchset-created-event:
137                 exclude-drafts: 'false'
138                 exclude-trivial-rebase: 'false'
139                 exclude-no-code-change: 'true'
140             - draft-published-event
141             - comment-added-contains-event:
142                 comment-contains-value: 'recheck'
143             - comment-added-contains-event:
144                 comment-contains-value: 'reverify'
145           projects:
146             - project-compare-type: 'ANT'
147               project-pattern: 'apex'
148               branches:
149                 - branch-compare-type: 'ANT'
150                   branch-pattern: '**/{branch}'
151               disable-strict-forbidden-file-verification: 'true'
152               file-paths:
153                 - compare-type: ANT
154                   pattern: '*'
155                 - compare-type: ANT
156                   pattern: 'apex/*'
157                 - compare-type: ANT
158                   pattern: 'build/**'
159                 - compare-type: ANT
160                   pattern: 'ci/**'
161                 - compare-type: ANT
162                   pattern: 'lib/**'
163                 - compare-type: ANT
164                   pattern: 'config/**'
165                 - compare-type: ANT
166                   pattern: 'apex/build/**'
167                 - compare-type: ANT
168                   pattern: 'apex/common/**'
169                 - compare-type: ANT
170                   pattern: 'apex/inventory/**'
171                 - compare-type: ANT
172                   pattern: 'apex/network/**'
173                 - compare-type: ANT
174                   pattern: 'apex/overcloud/**'
175                 - compare-type: ANT
176                   pattern: 'apex/settings/**'
177                 - compare-type: ANT
178                   pattern: 'apex/undercloud/**'
179                 - compare-type: ANT
180                   pattern: 'apex/virtual/**'
181               forbidden-file-paths:
182                 - compare-type: ANT
183                   pattern: 'apex/tests/**'
184                 - compare-type: ANT
185                   pattern: 'docs/**'
186
187     properties:
188       - logrotate-default
189       - throttle:
190           max-per-node: 3
191           max-total: 10
192           option: 'project'
193
194     builders:
195       - description-setter:
196           description: "Built on $NODE_NAME"
197       - multijob:
198           name: basic
199           condition: SUCCESSFUL
200           projects:
201             - name: 'apex-verify-unit-tests-{stream}'
202               current-parameters: false
203               predefined-parameters: |
204                 GERRIT_BRANCH=$GERRIT_BRANCH
205                 GERRIT_REFSPEC=$GERRIT_REFSPEC
206                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
207                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
208               node-parameters: false
209               kill-phase-on: FAILURE
210               abort-all-job: true
211               git-revision: true
212       - multijob:
213           name: build
214           condition: SUCCESSFUL
215           projects:
216             - name: 'apex-build-{stream}'
217               current-parameters: false
218               predefined-parameters: |
219                 ARTIFACT_VERSION=$ARTIFACT_VERSION
220                 GERRIT_BRANCH=$GERRIT_BRANCH
221                 GERRIT_REFSPEC=$GERRIT_REFSPEC
222                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
223                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
224               node-parameters: false
225               kill-phase-on: FAILURE
226               abort-all-job: true
227               git-revision: true
228       - multijob:
229           name: deploy-virtual
230           condition: SUCCESSFUL
231           projects:
232             - name: 'apex-virtual-{stream}'
233               current-parameters: false
234               predefined-parameters: |
235                 ARTIFACT_VERSION=$ARTIFACT_VERSION
236                 DEPLOY_SCENARIO={verify-scenario}
237                 OPNFV_CLEAN=yes
238                 GERRIT_BRANCH=$GERRIT_BRANCH
239                 GERRIT_REFSPEC=$GERRIT_REFSPEC
240                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
241                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
242               node-parameters: false
243               kill-phase-on: FAILURE
244               abort-all-job: true
245               git-revision: true
246
247 # Verify Scenario Gate
248 - job-template:
249     name: 'apex-verify-gate-{stream}'
250
251     node: 'apex-build-{stream}'
252
253     concurrent: true
254
255     disabled: '{obj:disabled}'
256
257     project-type: 'multijob'
258
259     parameters:
260       - apex-parameter:
261           gs-pathname: '{gs-pathname}/dev'
262       - project-parameter:
263           project: '{project}'
264           branch: '{branch}'
265       - string:
266           name: GIT_BASE
267           default: https://gerrit.opnfv.org/gerrit/$PROJECT
268           description: "Used for overriding the GIT URL coming from parameters macro."
269       - string:
270           name: ARTIFACT_VERSION
271           default: dev
272           description: "Used for overriding the ARTIFACT_VERSION"
273
274     scm:
275       - git-scm-gerrit
276
277     triggers:
278       - gerrit:
279           server-name: 'gerrit.opnfv.org'
280           trigger-on:
281             - comment-added-contains-event:
282                 comment-contains-value: '^Patch Set [0-9]+: Code-Review\+2.*start-gate-scenario:.*'
283           projects:
284             - project-compare-type: 'ANT'
285               project-pattern: 'apex'
286               branches:
287                 - branch-compare-type: 'ANT'
288                   branch-pattern: '**/{branch}'
289               file-paths:
290                 - compare-type: ANT
291                   pattern: 'ci/**'
292                 - compare-type: ANT
293                   pattern: 'build/**'
294                 - compare-type: ANT
295                   pattern: 'lib/**'
296                 - compare-type: ANT
297                   pattern: 'config/**'
298                 - compare-type: ANT
299                   pattern: 'apex/**'
300
301     properties:
302       - logrotate-default
303       - build-blocker:
304           use-build-blocker: true
305           block-level: 'NODE'
306           blocking-jobs:
307             - 'apex-verify.*'
308             - 'apex-virtual.*'
309       - throttle:
310           max-per-node: 1
311           max-total: 10
312           option: 'project'
313
314     builders:
315       - multijob:
316           name: deploy-virtual
317           condition: SUCCESSFUL
318           projects:
319             - name: 'apex-deploy-virtual-{stream}'
320               current-parameters: false
321               predefined-parameters: |
322                 ARTIFACT_VERSION=$ARTIFACT_VERSION
323                 DEPLOY_SCENARIO=gate
324                 OPNFV_CLEAN=yes
325                 GERRIT_BRANCH=$GERRIT_BRANCH
326                 GERRIT_REFSPEC=$GERRIT_REFSPEC
327                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
328                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
329                 GERRIT_EVENT_COMMENT_TEXT=$GERRIT_EVENT_COMMENT_TEXT
330               node-parameters: true
331               kill-phase-on: FAILURE
332               abort-all-job: true
333               git-revision: true
334       # yamllint disable rule:line-length
335       - shell: |
336           echo DEPLOY_SCENARIO=$(echo $GERRIT_EVENT_COMMENT_TEXT | grep start-gate-scenario | grep -Eo 'os-.*') > detected_scenario
337       # yamllint enable rule:line-length
338       - inject:
339           properties-file: detected_scenario
340       - multijob:
341           name: functest-smoke
342           condition: SUCCESSFUL
343           projects:
344             - name: 'functest-apex-virtual-suite-{stream}'
345               current-parameters: false
346               predefined-parameters: |
347                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
348                 FUNCTEST_MODE=tier
349                 FUNCTEST_TIER=healthcheck
350                 GERRIT_BRANCH=$GERRIT_BRANCH
351                 GERRIT_REFSPEC=$GERRIT_REFSPEC
352                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
353                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
354               node-parameters: true
355               kill-phase-on: NEVER
356               abort-all-job: true
357               git-revision: false
358
359 ########################
360 # builder macros
361 ########################
362 - builder:
363     name: apex-unit-test
364     builders:
365       - shell:
366           !include-raw: ./apex-unit-test.sh