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