4551dc5d48eef93b0e1de1676d7e91d2d303d998
[releng.git] / jjb / doctor / doctor.yaml
1 ---
2 - project:
3     name: doctor
4
5     project: '{name}'
6     project-name: '{name}'
7     project-pattern: '{project}'
8
9     stream:
10       - master:
11           branch: '{stream}'
12           gs-pathname: ''
13           disabled: false
14       - hunter:
15           branch: 'stable/{stream}'
16           gs-pathname: '/{stream}'
17           disabled: false
18
19     installer:
20       - 'fuel':
21           scenario: 'os-nosdn-nofeature-noha'
22
23     arch:
24       - 'x86_64'
25       - 'aarch64'
26
27     inspector:
28       - 'sample'
29       - 'congress'
30
31     jobs:
32       - 'doctor-verify-{stream}'
33       - 'doctor-verify-fault_management-{installer}-{inspector}-{arch}-{stream}'
34       - 'doctor-verify-maintenance-{installer}-{inspector}-{arch}-{stream}'
35       - 'doctor-verify-all-{installer}-{inspector}-{arch}-{stream}'
36
37 - job-template:
38     name: 'doctor-verify-{stream}'
39     disabled: '{obj:disabled}'
40     project-type: 'multijob'
41     parameters:
42       - project-parameter:
43           project: '{project}'
44           branch: '{branch}'
45       - 'doctor-slave-parameter'
46     scm:
47       - git-scm-gerrit
48     triggers:
49       - 'doctor-verify':
50           project: '{project}'
51           branch: '{branch}'
52           files: 'doctor_tests/**'
53
54     builders:
55       - shell: |
56           #!/bin/bash
57           # we do nothing here as the main stuff will be done
58           # in phase jobs
59           echo "Triggering phase jobs!"
60       - multijob:
61           name: 'doctor-verify-fault_management'
62           execution-type: PARALLEL
63           projects:
64             - name: 'doctor-verify-fault_management-fuel-sample-x86_64-{stream}'
65               predefined-parameters: |
66                 PROJECT=$PROJECT
67                 GERRIT_BRANCH=$GERRIT_BRANCH
68                 GERRIT_REFSPEC=$GERRIT_REFSPEC
69                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
70                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
71               kill-phase-on: FAILURE
72               git-revision: true
73       - multijob:
74           name: 'doctor-verify-maintenance'
75           execution-type: PARALLEL
76           projects:
77             - name: doctor-verify-maintenance-fuel-sample-x86_64-{stream}'
78               predefined-parameters: |
79                 PROJECT=$PROJECT
80                 GERRIT_BRANCH=$GERRIT_BRANCH
81                 GERRIT_REFSPEC=$GERRIT_REFSPEC
82                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
83                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
84               kill-phase-on: FAILURE
85               git-revision: true
86
87 - job-template:
88     name: 'doctor-verify-fault_management-{installer}-{inspector}-{arch}-{stream}'
89     disabled: '{obj:disabled}'
90     node: 'zte-virtual4'
91     wrappers:
92       - ssh-agent-wrapper
93       - build-timeout:
94           timeout: 30
95     parameters:
96       - project-parameter:
97           project: '{project}'
98           branch: '{branch}'
99       - '{installer}-defaults'
100       - 'doctor-slave-parameter'
101       - 'doctor-parameter':
102           inspector: '{inspector}'
103           scenario: '{scenario}'
104           test_case: 'fault_management'
105           admin_tool_type: 'sample'
106     scm:
107       - git-scm-gerrit
108     builders:
109       - 'doctor-verify-installer-inspector-builders-macro'
110     publishers:
111       - 'doctor-verify-publishers-macro'
112
113 - job-template:
114     name: 'doctor-verify-maintenance-{installer}-{inspector}-{arch}-{stream}'
115     disabled: '{obj:disabled}'
116     node: 'nokia-pod1'
117     wrappers:
118       - ssh-agent-wrapper
119       - build-timeout:
120           timeout: 40
121     parameters:
122       - project-parameter:
123           project: '{project}'
124           branch: '{branch}'
125       - '{installer}-defaults'
126       - 'doctor-slave-parameter'
127       - 'doctor-parameter':
128           inspector: '{inspector}'
129           scenario: '{scenario}'
130           test_case: 'maintenance'
131           admin_tool_type: 'fenix'
132     scm:
133       - git-scm-gerrit
134     builders:
135       - 'doctor-verify-installer-inspector-builders-macro'
136     publishers:
137       - 'doctor-verify-publishers-macro'
138
139 - job-template:
140     name: 'doctor-verify-all-{installer}-{inspector}-{arch}-{stream}'
141     disabled: '{obj:disabled}'
142     node: 'doctor-{installer}-{arch}'
143     wrappers:
144       - ssh-agent-wrapper
145       - build-timeout:
146           timeout: 50
147     parameters:
148       - project-parameter:
149           project: '{project}'
150           branch: '{branch}'
151       - '{installer}-defaults'
152       - 'doctor-slave-parameter'
153       - 'doctor-parameter':
154           inspector: '{inspector}'
155           scenario: '{scenario}'
156           test_case: 'all'
157           admin_tool_type: 'sample'
158     scm:
159       - git-scm-gerrit
160     builders:
161       - 'doctor-verify-installer-inspector-builders-macro'
162     publishers:
163       - 'doctor-verify-publishers-macro'
164
165
166 # -------------------------------
167 # parameter macros
168 # -------------------------------
169 - parameter:
170     name: 'doctor-parameter'
171     parameters:
172       - string:
173           name: INSPECTOR_TYPE
174           default: '{inspector}'
175           description: 'inspector component'
176       - string:
177           name: TEST_CASE
178           default: '{test_case}'
179           description: 'test case: all, fault_management or maintenance'
180       - string:
181           name: DEPLOY_SCENARIO
182           default: '{scenario}'
183           description: 'Scenario to deploy and test'
184       - string:
185           name: ADMIN_TOOL_TYPE
186           default: '{admin_tool_type}'
187           description: 'admin_tool_type: sample, fenix'
188
189
190 # -------------------------------
191 # builder macros
192 # -------------------------------
193
194 - builder:
195     name: 'doctor-verify-installer-inspector-builders-macro'
196     builders:
197       # yamllint disable rule:indentation
198       - shell: !include-raw:
199           - ./doctor-env-presetup.sh
200           - ../../utils/fetch_os_creds.sh
201       - shell: |
202           #!/bin/bash
203
204           # prepare the env for test
205           . $HOME/opnfv-openrc.sh
206           if [ -f $HOME/os_cacert ]; then
207               export OS_CACERT=$HOME/os_cacert
208           fi
209           . $HOME/opnfv-installer.sh
210
211           # run tox to trigger the test
212           # As Jenkins user, it has no permission to send ICMP package
213           sudo -E tox -e py34
214
215
216 # -------------------------------
217 # publisher macros
218 # -------------------------------
219 - publisher:
220     name: 'doctor-verify-publishers-macro'
221     publishers:
222       - archive:
223           artifacts: 'doctor_tests/*.log'
224       - email-jenkins-admins-on-failure
225       - workspace-cleanup
226
227 #####################################
228 # trigger macros
229 #####################################
230 - trigger:
231     name: 'doctor-verify'
232     triggers:
233       - gerrit:
234           server-name: 'gerrit.opnfv.org'
235           trigger-on:
236             - patchset-created-event:
237                 exclude-drafts: 'false'
238                 exclude-trivial-rebase: 'false'
239                 exclude-no-code-change: 'false'
240             - draft-published-event
241             - comment-added-contains-event:
242                 comment-contains-value: 'recheck'
243             - comment-added-contains-event:
244                 comment-contains-value: 'reverify'
245           projects:
246             - project-compare-type: 'ANT'
247               project-pattern: '{project}'
248               branches:
249                 - branch-compare-type: 'ANT'
250                   branch-pattern: '**/{branch}'
251               file-paths:
252                 - compare-type: ANT
253                   pattern: '{files}'
254           skip-vote:
255             successful: true
256             failed: true
257             unstable: true
258             notbuilt: true