e0de9aa2e95ff6914b597e13984c55f81b9b5157
[releng.git] / jjb / doctor / doctor.yml
1 ---
2 - project:
3     name: doctor
4
5     project: '{name}'
6
7     stream:
8       - master:
9           branch: '{stream}'
10           gs-pathname: ''
11           docker-tag: 'latest'
12           disabled: false
13       - euphrates:
14           branch: 'stable/{stream}'
15           gs-pathname: '/{stream}'
16           docker-tag: 'stable'
17           disabled: false
18
19     installer:
20       - apex:
21           slave-label: 'doctor-apex-verify'
22       - fuel:
23           slave-label: 'doctor-fuel-verify'
24     # - joid:
25     #     slave-label: 'ool-virtual3'
26     #     pod: 'ool-virtual3'
27
28     phase:
29       - 'build-x86_64':
30           slave-label: 'doctor-{installer}-verify'
31       - 'build-aarch64':
32           slave-label: 'doctor-{installer}-{phase}-verify'
33
34     inspector:
35       - 'sample'
36       - 'congress'
37
38     task:
39       - verify:
40           auto-trigger-name: 'doctor-verify'
41           is-python: false
42       - python-verify:
43           auto-trigger-name: 'doctor-verify'
44           is-python: true
45
46     exclude:
47       - installer: 'apex'
48         phase: 'build-aarch64'
49
50     jobs:
51       - 'doctor-verify-{stream}'
52       - 'doctor-verify-unit-test-{stream}'
53       - 'doctor-{task}-{inspector}-{stream}'
54       - 'doctor-{task}-{installer}-{inspector}-{phase}-{stream}'
55
56 - job-template:
57     name: 'doctor-verify-{stream}'
58
59     disabled: '{obj:disabled}'
60
61     project-type: 'multijob'
62
63     parameters:
64       - project-parameter:
65           project: '{project}'
66           branch: '{branch}'
67       - 'opnfv-build-ubuntu-defaults'
68
69     scm:
70       - git-scm-gerrit
71
72     triggers:
73       - gerrit:
74           server-name: 'gerrit.opnfv.org'
75           trigger-on:
76             - patchset-created-event:
77                 exclude-drafts: 'false'
78                 exclude-trivial-rebase: 'false'
79                 exclude-no-code-change: 'false'
80             - draft-published-event
81             - comment-added-contains-event:
82                 comment-contains-value: 'recheck'
83             - comment-added-contains-event:
84                 comment-contains-value: 'reverify'
85           projects:
86             - project-compare-type: 'ANT'
87               project-pattern: '{project}'
88               branches:
89                 - branch-compare-type: 'ANT'
90                   branch-pattern: '**/{branch}'
91               file-paths:
92                 - compare-type: ANT
93                   pattern: 'doctor_tests/**'
94
95     builders:
96       - shell: |
97          #!/bin/bash
98          # we do nothing here as the main stuff will be done
99          # in phase jobs
100          echo "Triggering phase jobs!"
101       - multijob:
102           name: 'doctor-build-and-unittest'
103           execution-type: PARALLEL
104           projects:
105             - name: 'doctor-verify-unit-test-{stream}'
106               current-parameters: false
107               predefined-parameters: |
108                 GERRIT_BRANCH=$GERRIT_BRANCH
109                 GERRIT_REFSPEC=$GERRIT_REFSPEC
110                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
111                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
112               git-revision: true
113               node-parameters: false
114               kill-phase-on: FAILURE
115               abort-all-job: false
116
117 - job-template:
118     name: 'doctor-verify-unit-test-{stream}'
119     disabled: '{obj:disabled}'
120     wrappers:
121       - ssh-agent-wrapper
122       - build-timeout:
123           timeout: 60
124     parameters:
125       - project-parameter:
126           project: '{project}'
127           branch: '{branch}'
128       - 'opnfv-build-ubuntu-defaults'
129     scm:
130       - git-scm-gerrit
131     builders:
132       - 'doctor-verify-unit-test-builders-macro'
133     publishers:
134       - 'doctor-verify-unit-test-publishers-macro'
135
136
137 - job-template:
138     name: 'doctor-{task}-{inspector}-{stream}'
139
140     disabled: '{obj:disabled}'
141
142     project-type: 'multijob'
143
144     parameters:
145       - project-parameter:
146           project: '{project}'
147           branch: '{branch}'
148       - 'opnfv-build-ubuntu-defaults'
149       - string:
150           name: OS_CREDS
151           default: /home/jenkins/openstack.creds
152           description: 'OpenStack credentials'
153       - string:
154           name: DOCKER_TAG
155           default: '{docker-tag}'
156           description: 'Tag to pull docker image'
157       - string:
158           name: CLEAN_DOCKER_IMAGES
159           default: 'false'
160           description: 'Remove downloaded docker images (opnfv/functest:*)'
161       - string:
162           name: DEPLOY_SCENARIO
163           default: 'os-nosdn-nofeature-ha'
164           description: 'Scenario to deploy and test'
165       # functest-suite-parameter
166       - string:
167           name: FUNCTEST_MODE
168           default: 'testcase'
169       - string:
170           name: FUNCTEST_SUITE_NAME
171           default: 'doctor-notification'
172       - string:
173           name: TESTCASE_OPTIONS
174           # yamllint disable rule:line-length
175           default: '-e INSPECTOR_TYPE={inspector} -e PYTHON_ENABLE={is-python} -v $WORKSPACE:/home/opnfv/repos/doctor'
176           # yamllint enable rule:line-length
177           description: 'Addtional parameters specific to test case(s)'
178       # functest-parameter
179       - string:
180           name: GS_PATHNAME
181           default: '{gs-pathname}'
182           # yamllint disable rule:line-length
183           description: "Version directory where the opnfv documents will be stored in gs repository"
184           # yamllint enable rule:line-length
185       - string:
186           name: FUNCTEST_REPO_DIR
187           default: "/home/opnfv/repos/functest"
188           description: "Directory where the Functest repository is cloned"
189       - string:
190           name: PUSH_RESULTS_TO_DB
191           default: "true"
192           description: "Push the results of all the tests to the resultDB"
193       - string:
194           name: CI_DEBUG
195           default: 'true'
196           description: "Show debug output information"
197
198     scm:
199       - git-scm-gerrit
200
201     triggers:
202       - '{auto-trigger-name}':
203           project: '{project}'
204           branch: '{branch}'
205           files: 'doctor_tests/**'
206
207     builders:
208       - shell: |
209          #!/bin/bash
210          # we do nothing here as the main stuff will be done
211          # in phase jobs
212          echo "Triggering phase jobs!"
213       - multijob:
214           name: 'doctor-verify-apex-inspector'
215           execution-type: PARALLEL
216           projects:
217             - name: 'doctor-{task}-apex-{inspector}-build-x86_64-{stream}'
218               current-parameters: false
219               predefined-parameters: |
220                 GERRIT_BRANCH=$GERRIT_BRANCH
221                 GERRIT_REFSPEC=$GERRIT_REFSPEC
222                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
223                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
224               git-revision: true
225               node-parameters: false
226               kill-phase-on: FAILURE
227               abort-all-job: false
228       - multijob:
229           name: 'doctor-verify-fuel-inspector'
230           execution-type: PARALLEL
231           projects:
232             - name: 'doctor-{task}-fuel-{inspector}-build-x86_64-{stream}'
233               current-parameters: false
234               predefined-parameters: |
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               git-revision: true
240               node-parameters: false
241               kill-phase-on: FAILURE
242               abort-all-job: false
243       - multijob:
244           name: 'doctor-verify-fuel-inspector'
245           execution-type: PARALLEL
246           projects:
247             - name: 'doctor-{task}-fuel-{inspector}-build-aarch64-{stream}'
248               current-parameters: false
249               predefined-parameters: |
250                 GERRIT_BRANCH=$GERRIT_BRANCH
251                 GERRIT_REFSPEC=$GERRIT_REFSPEC
252                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
253                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
254               git-revision: true
255               node-parameters: false
256               kill-phase-on: FAILURE
257               abort-all-job: false
258
259 - job-template:
260     name: 'doctor-{task}-{installer}-{inspector}-{phase}-{stream}'
261     disabled: '{obj:disabled}'
262     node: '{slave-label}'
263     wrappers:
264       - ssh-agent-wrapper
265       - build-timeout:
266           timeout: 30
267     parameters:
268       - project-parameter:
269           project: '{project}'
270           branch: '{branch}'
271       - '{installer}-defaults'
272       - '{slave-label}-defaults'
273     scm:
274       - git-scm-gerrit
275     builders:
276       - 'doctor-verify-installer-inspector-builders-macro'
277     publishers:
278       - 'doctor-verify-publishers-macro'
279 # -------------------------------
280 # builder macros
281 # -------------------------------
282
283 - builder:
284     name: 'doctor-verify-unit-test-builders-macro'
285     builders:
286       - shell: "[ -e tests/run.sh ] && bash -n ./tests/run.sh"
287 - builder:
288     name: 'doctor-verify-installer-inspector-builders-macro'
289     builders:
290       - 'clean-workspace-log'
291       # yamllint disable rule:line-length
292       - shell: |
293           # NOTE: Create symbolic link, so that we can archive file outside
294           #       of $WORKSPACE .
295           # NOTE: We are printing all logs under 'tests/' during test run,
296           #       so this symbolic link should not be in 'tests/'. Otherwise,
297           #       we'll have the same log twice in jenkins console log.
298           ln -sfn $HOME/opnfv/functest/results/{stream} functest_results
299           # NOTE: Get functest script in $WORKSPACE. This functest script is
300           #       needed to perform VM image download in set-functest-env.sh
301           #       from E release cycle.
302           mkdir -p functest/ci
303           wget https://git.opnfv.org/functest/plain/functest/ci/download_images.sh -O functest/ci/download_images.sh
304       - 'functest-suite-builder'
305       - shell: |
306           functest_log="$HOME/opnfv/functest/results/{stream}/$FUNCTEST_SUITE_NAME.log"
307           # NOTE: checking the test result, as the previous job could return
308           #       0 regardless the result of doctor test scenario.
309           grep -e 'doctor test successfully' $functest_log || exit 1
310       # yamllint enable rule:line-length
311
312 # -------------------------------
313 # publisher macros
314 # -------------------------------
315 - publisher:
316     name: 'doctor-verify-publishers-macro'
317     publishers:
318       - archive:
319           artifacts: 'doctor_tests/*.log'
320       - archive:
321           artifacts: 'functest_results/$FUNCTEST_SUITE_NAME.log'
322       - email-jenkins-admins-on-failure
323 - publisher:
324     name: 'doctor-verify-unit-test-publishers-macro'
325     publishers:
326       - email-jenkins-admins-on-failure
327
328 #####################################
329 # trigger macros
330 #####################################
331 - trigger:
332     name: 'doctor-verify'
333     triggers:
334       - gerrit:
335           server-name: 'gerrit.opnfv.org'
336           trigger-on:
337             - patchset-created-event:
338                 exclude-drafts: 'false'
339                 exclude-trivial-rebase: 'false'
340                 exclude-no-code-change: 'false'
341             - draft-published-event
342             - comment-added-contains-event:
343                 comment-contains-value: 'recheck'
344             - comment-added-contains-event:
345                 comment-contains-value: 'reverify'
346           projects:
347             - project-compare-type: 'ANT'
348               project-pattern: '{project}'
349               branches:
350                 - branch-compare-type: 'ANT'
351                   branch-pattern: '**/{branch}'
352               file-paths:
353                 - compare-type: ANT
354                   pattern: '{files}'
355           skip-vote:
356             successful: true
357             failed: true
358             unstable: true
359             notbuilt: true