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