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