Set Jenkins parameter 'GIT_BASE' for overriding the default value
[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     concurrent: true
112
113     disabled: '{obj:disabled}'
114
115     project-type: 'multijob'
116
117     parameters:
118       - '{project}-virtual-{stream}-defaults'
119       - apex-parameter:
120           gs-pathname: '{gs-pathname}/dev'
121       - project-parameter:
122           project: '{project}'
123           branch: '{branch}'
124       - string:
125           name: ARTIFACT_VERSION
126           default: dev
127           description: "Used for overriding the ARTIFACT_VERSION"
128     scm:
129       - git-scm-gerrit
130
131     triggers:
132       - gerrit:
133           server-name: 'gerrit.opnfv.org'
134           trigger-on:
135             - patchset-created-event:
136                 exclude-drafts: 'false'
137                 exclude-trivial-rebase: 'false'
138                 exclude-no-code-change: 'true'
139             - draft-published-event
140             - comment-added-contains-event:
141                 comment-contains-value: 'recheck'
142             - comment-added-contains-event:
143                 comment-contains-value: 'reverify'
144           projects:
145             - project-compare-type: 'ANT'
146               project-pattern: 'apex'
147               branches:
148                 - branch-compare-type: 'ANT'
149                   branch-pattern: '**/{branch}'
150               disable-strict-forbidden-file-verification: 'true'
151               file-paths:
152                 - compare-type: ANT
153                   pattern: '*'
154                 - compare-type: ANT
155                   pattern: 'apex/*'
156                 - compare-type: ANT
157                   pattern: 'build/**'
158                 - compare-type: ANT
159                   pattern: 'ci/**'
160                 - compare-type: ANT
161                   pattern: 'lib/**'
162                 - compare-type: ANT
163                   pattern: 'config/**'
164                 - compare-type: ANT
165                   pattern: 'apex/build/**'
166                 - compare-type: ANT
167                   pattern: 'apex/common/**'
168                 - compare-type: ANT
169                   pattern: 'apex/inventory/**'
170                 - compare-type: ANT
171                   pattern: 'apex/network/**'
172                 - compare-type: ANT
173                   pattern: 'apex/overcloud/**'
174                 - compare-type: ANT
175                   pattern: 'apex/settings/**'
176                 - compare-type: ANT
177                   pattern: 'apex/undercloud/**'
178                 - compare-type: ANT
179                   pattern: 'apex/virtual/**'
180               forbidden-file-paths:
181                 - compare-type: ANT
182                   pattern: 'apex/tests/**'
183                 - compare-type: ANT
184                   pattern: 'docs/**'
185
186     properties:
187       - logrotate-default
188       - throttle:
189           max-per-node: 3
190           max-total: 10
191           option: 'project'
192
193     builders:
194       - description-setter:
195           description: "Built on $NODE_NAME"
196       - multijob:
197           name: basic
198           condition: SUCCESSFUL
199           projects:
200             - name: 'apex-verify-unit-tests-{stream}'
201               current-parameters: false
202               predefined-parameters: |
203                 GERRIT_BRANCH=$GERRIT_BRANCH
204                 GERRIT_REFSPEC=$GERRIT_REFSPEC
205                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
206                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
207               node-parameters: false
208               kill-phase-on: FAILURE
209               abort-all-job: true
210               git-revision: true
211       - multijob:
212           name: build
213           condition: SUCCESSFUL
214           projects:
215             - name: 'apex-build-{stream}'
216               current-parameters: false
217               predefined-parameters: |
218                 ARTIFACT_VERSION=$ARTIFACT_VERSION
219                 GERRIT_BRANCH=$GERRIT_BRANCH
220                 GERRIT_REFSPEC=$GERRIT_REFSPEC
221                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
222                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
223               node-parameters: false
224               kill-phase-on: FAILURE
225               abort-all-job: true
226               git-revision: true
227       - multijob:
228           name: deploy-virtual
229           condition: SUCCESSFUL
230           projects:
231             - name: 'apex-virtual-{stream}'
232               current-parameters: false
233               predefined-parameters: |
234                 ARTIFACT_VERSION=$ARTIFACT_VERSION
235                 DEPLOY_SCENARIO={verify-scenario}
236                 OPNFV_CLEAN=yes
237                 GERRIT_BRANCH=$GERRIT_BRANCH
238                 GERRIT_REFSPEC=$GERRIT_REFSPEC
239                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
240                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
241               node-parameters: false
242               kill-phase-on: FAILURE
243               abort-all-job: true
244               git-revision: true
245
246 # Verify Scenario Gate
247 - job-template:
248     name: 'apex-verify-gate-{stream}'
249
250     concurrent: true
251
252     disabled: '{obj:disabled}'
253
254     project-type: 'multijob'
255
256     parameters:
257       - '{project}-virtual-{stream}-defaults'
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