c57ac1d6091ab2a695f368f019162fc48cc01186
[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: 'lib/**'
161                 - compare-type: ANT
162                   pattern: 'config/**'
163                 - compare-type: ANT
164                   pattern: 'apex/build/**'
165                 - compare-type: ANT
166                   pattern: 'apex/common/**'
167                 - compare-type: ANT
168                   pattern: 'apex/inventory/**'
169                 - compare-type: ANT
170                   pattern: 'apex/network/**'
171                 - compare-type: ANT
172                   pattern: 'apex/overcloud/**'
173                 - compare-type: ANT
174                   pattern: 'apex/settings/**'
175                 - compare-type: ANT
176                   pattern: 'apex/undercloud/**'
177                 - compare-type: ANT
178                   pattern: 'apex/virtual/**'
179               forbidden-file-paths:
180                 - compare-type: ANT
181                   pattern: 'apex/tests/**'
182                 - compare-type: ANT
183                   pattern: 'docs/**'
184
185     properties:
186       - logrotate-default
187       - throttle:
188           max-per-node: 3
189           max-total: 10
190           option: 'project'
191
192     builders:
193       - description-setter:
194           description: "Built on $NODE_NAME"
195       - multijob:
196           name: basic
197           condition: SUCCESSFUL
198           projects:
199             - name: 'apex-verify-unit-tests-{stream}'
200               current-parameters: false
201               predefined-parameters: |
202                 GERRIT_BRANCH=$GERRIT_BRANCH
203                 GERRIT_REFSPEC=$GERRIT_REFSPEC
204                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
205                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
206               node-parameters: false
207               kill-phase-on: FAILURE
208               abort-all-job: true
209               git-revision: true
210       - multijob:
211           name: build
212           condition: SUCCESSFUL
213           projects:
214             - name: 'apex-build-{stream}'
215               current-parameters: false
216               predefined-parameters: |
217                 ARTIFACT_VERSION=$ARTIFACT_VERSION
218                 GERRIT_BRANCH=$GERRIT_BRANCH
219                 GERRIT_REFSPEC=$GERRIT_REFSPEC
220                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
221                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
222               node-parameters: false
223               kill-phase-on: FAILURE
224               abort-all-job: true
225               git-revision: true
226       - multijob:
227           name: deploy-virtual
228           condition: SUCCESSFUL
229           projects:
230             - name: 'apex-virtual-{stream}'
231               current-parameters: false
232               predefined-parameters: |
233                 ARTIFACT_VERSION=$ARTIFACT_VERSION
234                 DEPLOY_SCENARIO={verify-scenario}
235                 OPNFV_CLEAN=yes
236                 GERRIT_BRANCH=$GERRIT_BRANCH
237                 GERRIT_REFSPEC=$GERRIT_REFSPEC
238                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
239                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
240               node-parameters: false
241               kill-phase-on: FAILURE
242               abort-all-job: true
243               git-revision: true
244
245 # Verify Scenario Gate
246 - job-template:
247     name: 'apex-verify-gate-{stream}'
248
249     node: 'apex-build-{stream}'
250
251     concurrent: true
252
253     disabled: '{obj:disabled}'
254
255     project-type: 'multijob'
256
257     parameters:
258       - apex-parameter:
259           gs-pathname: '{gs-pathname}/dev'
260       - project-parameter:
261           project: '{project}'
262           branch: '{branch}'
263       - string:
264           name: GIT_BASE
265           default: https://gerrit.opnfv.org/gerrit/$PROJECT
266           description: "Used for overriding the GIT URL coming from parameters macro."
267       - string:
268           name: ARTIFACT_VERSION
269           default: dev
270           description: "Used for overriding the ARTIFACT_VERSION"
271
272     scm:
273       - git-scm-gerrit
274
275     triggers:
276       - gerrit:
277           server-name: 'gerrit.opnfv.org'
278           trigger-on:
279             - comment-added-contains-event:
280                 comment-contains-value: '^Patch Set [0-9]+: Code-Review\+2.*start-gate-scenario:.*'
281           projects:
282             - project-compare-type: 'ANT'
283               project-pattern: 'apex'
284               branches:
285                 - branch-compare-type: 'ANT'
286                   branch-pattern: '**/{branch}'
287               file-paths:
288                 - compare-type: ANT
289                   pattern: 'ci/**'
290                 - compare-type: ANT
291                   pattern: 'build/**'
292                 - compare-type: ANT
293                   pattern: 'lib/**'
294                 - compare-type: ANT
295                   pattern: 'config/**'
296                 - compare-type: ANT
297                   pattern: 'apex/**'
298
299     properties:
300       - logrotate-default
301       - build-blocker:
302           use-build-blocker: true
303           block-level: 'NODE'
304           blocking-jobs:
305             - 'apex-verify.*'
306             - 'apex-virtual.*'
307       - throttle:
308           max-per-node: 1
309           max-total: 10
310           option: 'project'
311
312     builders:
313       - multijob:
314           name: deploy-virtual
315           condition: SUCCESSFUL
316           projects:
317             - name: 'apex-deploy-virtual-{stream}'
318               current-parameters: false
319               predefined-parameters: |
320                 ARTIFACT_VERSION=$ARTIFACT_VERSION
321                 DEPLOY_SCENARIO=gate
322                 OPNFV_CLEAN=yes
323                 GERRIT_BRANCH=$GERRIT_BRANCH
324                 GERRIT_REFSPEC=$GERRIT_REFSPEC
325                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
326                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
327                 GERRIT_EVENT_COMMENT_TEXT=$GERRIT_EVENT_COMMENT_TEXT
328               node-parameters: true
329               kill-phase-on: FAILURE
330               abort-all-job: true
331               git-revision: true
332       # yamllint disable rule:line-length
333       - shell: |
334           echo DEPLOY_SCENARIO=$(echo $GERRIT_EVENT_COMMENT_TEXT | grep start-gate-scenario | grep -Eo 'os-.*') > detected_scenario
335       # yamllint enable rule:line-length
336       - inject:
337           properties-file: detected_scenario
338       - multijob:
339           name: functest-smoke
340           condition: SUCCESSFUL
341           projects:
342             - name: 'functest-apex-virtual-suite-{stream}'
343               current-parameters: false
344               predefined-parameters: |
345                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
346                 FUNCTEST_MODE=tier
347                 FUNCTEST_TIER=healthcheck
348                 GERRIT_BRANCH=$GERRIT_BRANCH
349                 GERRIT_REFSPEC=$GERRIT_REFSPEC
350                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
351                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
352               node-parameters: true
353               kill-phase-on: NEVER
354               abort-all-job: true
355               git-revision: false
356
357 ########################
358 # builder macros
359 ########################
360 - builder:
361     name: apex-unit-test
362     builders:
363       - shell:
364           !include-raw: ./apex-unit-test.sh