[doctor] clean pep8 job
[releng.git] / jjb / doctor / doctor.yml
1 ---
2 - project:
3     name: doctor
4
5     project: '{name}'
6
7     stream:
8       - master:
9           branch: '{stream}'
10           gs-pathname: ''
11           docker-tag: 'latest'
12           disabled: false
13       - fraser: &fraser
14           branch: 'stable/{stream}'
15           gs-pathname: '/{stream}'
16           docker-tag: 'stable'
17           disabled: false
18
19     installer:
20       - 'apex'
21       - 'fuel'
22       - 'daisy'
23
24     arch:
25       - 'x86_64'
26       - 'aarch64'
27
28     inspector:
29       - 'sample'
30       - 'congress'
31
32     exclude:
33       - installer: 'apex'
34         arch: 'aarch64'
35       - installer: 'daisy'
36         arch: 'aarch64'
37
38     jobs:
39       - 'doctor-verify-{inspector}-{stream}'
40       - 'doctor-verify-{installer}-{inspector}-{arch}-{stream}'
41
42 - job-template:
43     name: 'doctor-verify-{inspector}-{stream}'
44     disabled: '{obj:disabled}'
45     project-type: 'multijob'
46     parameters:
47       - project-parameter:
48           project: '{project}'
49           branch: '{branch}'
50       - 'doctor-slave-parameter'
51     scm:
52       - git-scm-gerrit
53     triggers:
54       - 'doctor-verify':
55           project: '{project}'
56           branch: '{branch}'
57           files: 'doctor_tests/**'
58
59     builders:
60       - shell: |
61          #!/bin/bash
62          # we do nothing here as the main stuff will be done
63          # in phase jobs
64          echo "Triggering phase jobs!"
65       - multijob:
66           name: 'doctor-verify-apex-inspector'
67           execution-type: PARALLEL
68           projects:
69             - name: 'doctor-verify-apex-{inspector}-x86_64-{stream}'
70               predefined-parameters: |
71                 PROJECT=$PROJECT
72                 GERRIT_BRANCH=$GERRIT_BRANCH
73                 GERRIT_REFSPEC=$GERRIT_REFSPEC
74                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
75                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
76               kill-phase-on: FAILURE
77               current-parameters: true
78               git-revision: true
79       - multijob:
80           name: 'doctor-verify-fuel-inspector'
81           execution-type: PARALLEL
82           projects:
83             - name: 'doctor-verify-fuel-{inspector}-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               current-parameters: true
92               git-revision: true
93       - multijob:
94           name: 'doctor-verify-fuel-inspector'
95           execution-type: PARALLEL
96           projects:
97             - name: 'doctor-verify-fuel-{inspector}-aarch64-{stream}'
98               predefined-parameters: |
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               current-parameters: true
105               git-revision: true
106       - multijob:
107           name: 'doctor-verify-daisy-inspector'
108           execution-type: PARALLEL
109           projects:
110             - name: 'doctor-verify-daisy-{inspector}-x86_64-{stream}'
111               predefined-parameters: |
112                 PROJECT=$PROJECT
113                 GERRIT_BRANCH=$GERRIT_BRANCH
114                 GERRIT_REFSPEC=$GERRIT_REFSPEC
115                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
116                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
117               kill-phase-on: FAILURE
118               current-parameters: true
119               git-revision: true
120
121 - job-template:
122     name: 'doctor-verify-{installer}-{inspector}-{arch}-{stream}'
123     disabled: '{obj:disabled}'
124     node: 'doctor-{installer}-{arch}'
125     wrappers:
126       - ssh-agent-wrapper
127       - build-timeout:
128           timeout: 30
129     parameters:
130       - project-parameter:
131           project: '{project}'
132           branch: '{branch}'
133       - '{installer}-defaults'
134       - 'doctor-slave-parameter'
135       - 'doctor-parameter'
136       - 'doctor-functest-parameter'
137     scm:
138       - git-scm-gerrit
139     builders:
140       - 'doctor-verify-installer-inspector-builders-macro'
141     publishers:
142       - 'doctor-verify-publishers-macro'
143
144
145 # -------------------------------
146 # parameter macros
147 # -------------------------------
148 - parameter:
149     name: 'doctor-parameter'
150     parameters:
151       - string:
152           name: OS_CREDS
153           default: /home/jenkins/openstack.creds
154           description: 'OpenStack credentials'
155       - string:
156           name: DOCKER_TAG
157           default: '{docker-tag}'
158           description: 'Tag to pull docker image'
159       - string:
160           name: CLEAN_DOCKER_IMAGES
161           default: 'false'
162           description: 'Remove downloaded docker images (opnfv/functest:*)'
163       - string:
164           name: DEPLOY_SCENARIO
165           default: 'os-nosdn-nofeature-ha'
166           description: 'Scenario to deploy and test'
167
168 - parameter:
169     name: 'doctor-functest-parameter'
170     parameters:
171       # functest-suite-parameter
172       - string:
173           name: FUNCTEST_MODE
174           default: 'testcase'
175       - string:
176           name: FUNCTEST_SUITE_NAME
177           default: 'doctor-notification'
178       - string:
179           name: TESTCASE_OPTIONS
180           # yamllint disable rule:line-length
181           default: '-e INSPECTOR_TYPE={inspector} -v $WORKSPACE:/home/opnfv/repos/doctor'
182           # yamllint enable rule:line-length
183           description: 'Addtional parameters specific to test case(s)'
184       # functest-parameter
185       - string:
186           name: GS_PATHNAME
187           default: '{gs-pathname}'
188           # yamllint disable rule:line-length
189           description: "Version directory where the opnfv documents will be stored in gs repository"
190           # yamllint enable rule:line-length
191       - string:
192           name: FUNCTEST_REPO_DIR
193           default: "/home/opnfv/repos/functest"
194           description: "Directory where the Functest repository is cloned"
195       - string:
196           name: PUSH_RESULTS_TO_DB
197           default: "true"
198           description: "Push the results of all the tests to the resultDB"
199       - string:
200           name: CI_DEBUG
201           default: 'true'
202           description: "Show debug output information"
203 # -------------------------------
204 # builder macros
205 # -------------------------------
206
207 - builder:
208     name: 'doctor-verify-installer-inspector-builders-macro'
209     builders:
210       - 'clean-workspace-log'
211       # yamllint disable rule:line-length
212       - shell: |
213           # NOTE: Create symbolic link, so that we can archive file outside
214           #       of $WORKSPACE .
215           # NOTE: We are printing all logs under 'tests/' during test run,
216           #       so this symbolic link should not be in 'tests/'. Otherwise,
217           #       we'll have the same log twice in jenkins console log.
218           ln -sfn $HOME/opnfv/functest/results/{stream} functest_results
219           # NOTE: Get functest script in $WORKSPACE. This functest script is
220           #       needed to perform VM image download in set-functest-env.sh
221           #       from E release cycle.
222           mkdir -p functest/ci
223           wget https://git.opnfv.org/functest/plain/functest/ci/download_images.sh -O functest/ci/download_images.sh
224       - 'functest-suite-builder'
225       - shell: |
226           functest_log="$HOME/opnfv/functest/results/{stream}/$FUNCTEST_SUITE_NAME.log"
227           # NOTE: checking the test result, as the previous job could return
228           #       0 regardless the result of doctor test scenario.
229           grep -e 'doctor test successfully' $functest_log || exit 1
230       # yamllint enable rule:line-length
231
232 # -------------------------------
233 # publisher macros
234 # -------------------------------
235 - publisher:
236     name: 'doctor-verify-publishers-macro'
237     publishers:
238       - archive:
239           artifacts: 'doctor_tests/*.log'
240       - archive:
241           artifacts: 'functest_results/$FUNCTEST_SUITE_NAME.log'
242       - email-jenkins-admins-on-failure
243
244
245 #####################################
246 # trigger macros
247 #####################################
248 - trigger:
249     name: 'doctor-verify'
250     triggers:
251       - gerrit:
252           server-name: 'gerrit.opnfv.org'
253           trigger-on:
254             - patchset-created-event:
255                 exclude-drafts: 'false'
256                 exclude-trivial-rebase: 'false'
257                 exclude-no-code-change: 'false'
258             - draft-published-event
259             - comment-added-contains-event:
260                 comment-contains-value: 'recheck'
261             - comment-added-contains-event:
262                 comment-contains-value: 'reverify'
263           projects:
264             - project-compare-type: 'ANT'
265               project-pattern: '{project}'
266               branches:
267                 - branch-compare-type: 'ANT'
268                   branch-pattern: '**/{branch}'
269               file-paths:
270                 - compare-type: ANT
271                   pattern: '{files}'
272           skip-vote:
273             successful: true
274             failed: true
275             unstable: true
276             notbuilt: true