Create Stable Branch Jobs 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       - jerma: &jerma
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-fuel'
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             - name: 'doctor-verify-maintenance-fuel-sample-x86_64-{stream}'
74               predefined-parameters: |
75                 PROJECT=$PROJECT
76                 GERRIT_BRANCH=$GERRIT_BRANCH
77                 GERRIT_REFSPEC=$GERRIT_REFSPEC
78                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
79                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
80               kill-phase-on: FAILURE
81               git-revision: true
82
83 - job-template:
84     name: 'doctor-verify-fault_management-{installer}-{inspector}-{arch}-{stream}'
85     disabled: '{obj:disabled}'
86     node: 'zte-virtual4'
87     wrappers:
88       - ssh-agent-wrapper
89       - build-timeout:
90           timeout: 30
91     parameters:
92       - project-parameter:
93           project: '{project}'
94           branch: '{branch}'
95       - '{installer}-defaults'
96       - 'doctor-slave-parameter'
97       - 'doctor-parameter':
98           inspector: '{inspector}'
99           scenario: '{scenario}'
100           test_case: 'fault_management'
101           admin_tool_type: 'fenix'
102           app_manager_type: 'vnfm'
103     scm:
104       - git-scm-gerrit
105     builders:
106       - 'doctor-verify-installer-inspector-builders-macro'
107     publishers:
108       - 'doctor-verify-publishers-macro'
109
110 - job-template:
111     name: 'doctor-verify-maintenance-{installer}-{inspector}-{arch}-{stream}'
112     disabled: '{obj:disabled}'
113     node: 'nokia-pod1'
114     wrappers:
115       - ssh-agent-wrapper
116       - build-timeout:
117           timeout: 40
118     parameters:
119       - project-parameter:
120           project: '{project}'
121           branch: '{branch}'
122       - '{installer}-defaults'
123       - 'doctor-slave-parameter'
124       - 'doctor-parameter':
125           inspector: '{inspector}'
126           scenario: '{scenario}'
127           test_case: 'maintenance'
128           admin_tool_type: 'fenix'
129           app_manager_type: 'vnfm'
130     scm:
131       - git-scm-gerrit
132     builders:
133       - 'doctor-verify-installer-inspector-builders-macro'
134     publishers:
135       - 'doctor-verify-publishers-macro'
136
137 - job-template:
138     name: 'doctor-verify-all-{installer}-{inspector}-{arch}-{stream}'
139     disabled: '{obj:disabled}'
140     node: 'doctor-{installer}-{arch}'
141     wrappers:
142       - ssh-agent-wrapper
143       - build-timeout:
144           timeout: 50
145     parameters:
146       - project-parameter:
147           project: '{project}'
148           branch: '{branch}'
149       - '{installer}-defaults'
150       - 'doctor-slave-parameter'
151       - 'doctor-parameter':
152           inspector: '{inspector}'
153           scenario: '{scenario}'
154           test_case: 'all'
155           admin_tool_type: 'fenix'
156           app_manager_type: 'vnfm'
157     scm:
158       - git-scm-gerrit
159     builders:
160       - 'doctor-verify-installer-inspector-builders-macro'
161     publishers:
162       - 'doctor-verify-publishers-macro'
163
164
165 # -------------------------------
166 # parameter macros
167 # -------------------------------
168 - parameter:
169     name: 'doctor-parameter'
170     parameters:
171       - string:
172           name: INSPECTOR_TYPE
173           default: '{inspector}'
174           description: 'inspector component'
175       - string:
176           name: TEST_CASE
177           default: '{test_case}'
178           description: 'test case: all, fault_management or maintenance'
179       - string:
180           name: DEPLOY_SCENARIO
181           default: '{scenario}'
182           description: 'Scenario to deploy and test'
183       - string:
184           name: ADMIN_TOOL_TYPE
185           default: '{admin_tool_type}'
186           description: 'admin_tool_type: sample, fenix'
187       - string:
188           name: APP_MANAGER_TYPE
189           default: '{app_manager_type}'
190           description: 'app_manager_type: sample, vnfm'
191
192 # -------------------------------
193 # builder macros
194 # -------------------------------
195
196 - builder:
197     name: 'doctor-verify-installer-inspector-builders-macro'
198     builders:
199       # yamllint disable rule:indentation
200       - shell: !include-raw:
201           - ./doctor-env-presetup.sh
202           - ../../utils/fetch_os_creds.sh
203       - shell: |
204           #!/bin/bash
205
206           # prepare the env for test
207           . $HOME/opnfv-openrc.sh
208           if [ -f $HOME/os_cacert ]; then
209               export OS_CACERT=$HOME/os_cacert
210           fi
211           . $HOME/opnfv-installer.sh
212
213           # run tox to trigger the test
214           # As Jenkins user, it has no permission to send ICMP package
215           sudo -E tox -e py36
216
217
218 # -------------------------------
219 # publisher macros
220 # -------------------------------
221 - publisher:
222     name: 'doctor-verify-publishers-macro'
223     publishers:
224       - archive:
225           artifacts: 'doctor_tests/*.log'
226       - email-jenkins-admins-on-failure
227       - workspace-cleanup
228
229 #####################################
230 # trigger macros
231 #####################################
232 - trigger:
233     name: 'doctor-verify'
234     triggers:
235       - gerrit:
236           server-name: 'gerrit.opnfv.org'
237           trigger-on:
238             - patchset-created-event:
239                 exclude-drafts: 'false'
240                 exclude-trivial-rebase: 'false'
241                 exclude-no-code-change: 'false'
242             - draft-published-event
243             - comment-added-contains-event:
244                 comment-contains-value: 'recheck'
245             - comment-added-contains-event:
246                 comment-contains-value: 'reverify'
247           projects:
248             - project-compare-type: 'ANT'
249               project-pattern: '{project}'
250               branches:
251                 - branch-compare-type: 'ANT'
252                   branch-pattern: '**/{branch}'
253               file-paths:
254                 - compare-type: ANT
255                   pattern: '{files}'
256           skip-vote:
257             successful: true
258             failed: true
259             unstable: true
260             notbuilt: true