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