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