Apex: add missing builders path to trigger
[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/builders/**'
178                 - compare-type: ANT
179                   pattern: 'apex/common/**'
180                 - compare-type: ANT
181                   pattern: 'apex/inventory/**'
182                 - compare-type: ANT
183                   pattern: 'apex/network/**'
184                 - compare-type: ANT
185                   pattern: 'apex/overcloud/**'
186                 - compare-type: ANT
187                   pattern: 'apex/settings/**'
188                 - compare-type: ANT
189                   pattern: 'apex/undercloud/**'
190                 - compare-type: ANT
191                   pattern: 'apex/virtual/**'
192               forbidden-file-paths:
193                 - compare-type: ANT
194                   pattern: 'apex/tests/**'
195                 - compare-type: ANT
196                   pattern: 'docs/**'
197
198     properties:
199       - logrotate-default
200       - throttle:
201           max-per-node: 3
202           max-total: 10
203           option: 'project'
204       - build-blocker:
205           use-build-blocker: true
206           blocking-level: 'NODE'
207           blocking-jobs:
208             - 'apex-.*-promote.*'
209     builders:
210       - description-setter:
211           description: "Built on $NODE_NAME"
212       - multijob:
213           name: basic
214           condition: SUCCESSFUL
215           projects:
216             - name: 'apex-verify-unit-tests-{stream}'
217               current-parameters: false
218               predefined-parameters: |
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: build
229           condition: SUCCESSFUL
230           projects:
231             - name: 'apex-build-{stream}'
232               current-parameters: false
233               predefined-parameters: |
234                 ARTIFACT_VERSION=$ARTIFACT_VERSION
235                 GERRIT_BRANCH=$GERRIT_BRANCH
236                 GERRIT_REFSPEC=$GERRIT_REFSPEC
237                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
238                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
239               node-parameters: false
240               kill-phase-on: FAILURE
241               abort-all-job: true
242               git-revision: true
243       - multijob:
244           name: deploy-virtual
245           condition: SUCCESSFUL
246           projects:
247             - name: 'apex-virtual-{stream}'
248               current-parameters: false
249               predefined-parameters: |
250                 ARTIFACT_VERSION=$ARTIFACT_VERSION
251                 DEPLOY_SCENARIO={verify-scenario}
252                 OPNFV_CLEAN=yes
253                 GERRIT_BRANCH=$GERRIT_BRANCH
254                 GERRIT_REFSPEC=$GERRIT_REFSPEC
255                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
256                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
257                 FUNCTEST_SUITE_NAME=tempest_smoke
258                 FUNCTEST_MODE=testcase
259               node-parameters: true
260               kill-phase-on: FAILURE
261               abort-all-job: true
262               git-revision: true
263
264 # Verify Scenario Gate
265 - job-template:
266     name: 'apex-verify-gate-{stream}'
267
268     concurrent: true
269
270     disabled: '{obj:disabled}'
271
272     project-type: 'multijob'
273
274     parameters:
275       - '{project}-virtual-{stream}-defaults'
276       - apex-parameter:
277           gs-pathname: '{gs-pathname}/dev'
278       - project-parameter:
279           project: '{project}'
280           branch: '{branch}'
281       - string:
282           name: GIT_BASE
283           default: https://gerrit.opnfv.org/gerrit/$PROJECT
284           description: "Used for overriding the GIT URL coming from parameters macro."
285       - string:
286           name: ARTIFACT_VERSION
287           default: dev
288           description: "Used for overriding the ARTIFACT_VERSION"
289
290     scm:
291       - git-scm-gerrit
292
293     triggers:
294       - gerrit:
295           server-name: 'gerrit.opnfv.org'
296           trigger-on:
297             - comment-added-contains-event:
298                 comment-contains-value: '^Patch Set [0-9]+: Code-Review\+2.*start-gate-scenario:.*'
299           projects:
300             - project-compare-type: 'ANT'
301               project-pattern: 'apex'
302               branches:
303                 - branch-compare-type: 'ANT'
304                   branch-pattern: '**/{branch}'
305               file-paths:
306                 - compare-type: ANT
307                   pattern: 'ci/**'
308                 - compare-type: ANT
309                   pattern: 'build/**'
310                 - compare-type: ANT
311                   pattern: 'lib/**'
312                 - compare-type: ANT
313                   pattern: 'config/**'
314                 - compare-type: ANT
315                   pattern: 'apex/**'
316
317     properties:
318       - logrotate-default
319       - build-blocker:
320           use-build-blocker: true
321           blocking-level: 'NODE'
322           blocking-jobs:
323             - 'apex-verify.*'
324             - 'apex-virtual.*'
325             - 'apex-.*-promote.*'
326             - 'odl-netvirt.*'
327       - throttle:
328           max-per-node: 1
329           max-total: 10
330           option: 'project'
331
332     builders:
333       # yamllint disable rule:line-length
334       - shell: |
335           echo DEPLOY_SCENARIO=$(echo $GERRIT_EVENT_COMMENT_TEXT | grep start-gate-scenario | grep -Eo '(os|k8s)-.*$') > detected_scenario
336       # yamllint enable rule:line-length
337       - inject:
338           properties-file: detected_scenario
339       - multijob:
340           name: deploy-virtual
341           condition: SUCCESSFUL
342           projects:
343             - name: 'apex-deploy-virtual-{stream}'
344               current-parameters: false
345               predefined-parameters: |
346                 ARTIFACT_VERSION=$ARTIFACT_VERSION
347                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
348                 OPNFV_CLEAN=yes
349                 GERRIT_BRANCH=$GERRIT_BRANCH
350                 GERRIT_REFSPEC=$GERRIT_REFSPEC
351                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
352                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
353                 GERRIT_EVENT_COMMENT_TEXT=$GERRIT_EVENT_COMMENT_TEXT
354               node-parameters: true
355               kill-phase-on: FAILURE
356               abort-all-job: true
357               git-revision: true
358       - shell: |
359           features=$(echo $DEPLOY_SCENARIO | sed -r -n 's/os-.+-(.+)-(noha|ha)/\1/p')
360           if [ "$features" == 'rocky' ]; then
361             echo "DOCKER_TAG=hunter" > functest_tag
362           elif [[ "$features" =~ 'rocky' ]]; then
363             echo "DOCKER_TAG=hunter" > functest_tag
364           else
365             echo "DOCKER_TAG=''" > functest_tag
366           fi
367       - inject:
368           properties-file: functest_tag
369           override-build-parameters: true
370       - multijob:
371           name: functest-smoke
372           condition: ALWAYS
373           projects:
374             - name: 'functest-apex-virtual-suite-{stream}'
375               current-parameters: false
376               predefined-parameters: |
377                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
378                 DOCKER_TAG=$DOCKER_TAG
379                 FUNCTEST_SUITE_NAME=tempest_smoke
380                 FUNCTEST_MODE=testcase
381                 GERRIT_BRANCH=$GERRIT_BRANCH
382                 GERRIT_REFSPEC=$GERRIT_REFSPEC
383                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
384                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
385               node-parameters: true
386               kill-phase-on: NEVER
387               enable-condition: "def m = '$DEPLOY_SCENARIO' != 'k8s-nosdn-nofeature-noha'"
388               abort-all-job: true
389               git-revision: false
390       - multijob:
391           name: apex-fetch-logs
392           projects:
393             - name: 'apex-fetch-logs-{stream}'
394               current-parameters: true
395               predefined-parameters: |
396                 GERRIT_BRANCH=$GERRIT_BRANCH
397                 GERRIT_REFSPEC=$GERRIT_REFSPEC
398                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
399               node-parameters: true
400               kill-phase-on: NEVER
401               abort-all-job: true
402               git-revision: false
403
404 ########################
405 # builder macros
406 ########################
407 - builder:
408     name: apex-unit-test
409     builders:
410       - shell:
411           !include-raw: ./apex-unit-test.sh