Merge "Update repo archive script to handle empty repos"
[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           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     # feature projects' tests are not triggered by functest
20     # doctor verify Pods need to deploy with these scenario
21     installer:
22       - 'apex':
23           scenario: 'os-nosdn-kvm-ha'
24       - 'fuel':
25           scenario: 'os-nosdn-ovs-ha'
26       - 'daisy':
27           scenario: 'os-nosdn-ovs_dpdk-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       - installer: 'daisy'
41         arch: 'aarch64'
42
43     jobs:
44       - 'doctor-verify-{inspector}-{stream}'
45       - 'doctor-verify-{installer}-{inspector}-{arch}-{stream}'
46
47 - job-template:
48     name: 'doctor-verify-{inspector}-{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'
72           execution-type: PARALLEL
73           projects:
74             - name: 'doctor-verify-apex-{inspector}-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-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               git-revision: true
92             - name: 'doctor-verify-fuel-{inspector}-aarch64-{stream}'
93               predefined-parameters: |
94                 GERRIT_BRANCH=$GERRIT_BRANCH
95                 GERRIT_REFSPEC=$GERRIT_REFSPEC
96                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
97                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
98               kill-phase-on: FAILURE
99               git-revision: true
100             - name: 'doctor-verify-daisy-{inspector}-x86_64-{stream}'
101               predefined-parameters: |
102                 PROJECT=$PROJECT
103                 GERRIT_BRANCH=$GERRIT_BRANCH
104                 GERRIT_REFSPEC=$GERRIT_REFSPEC
105                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
106                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
107               kill-phase-on: FAILURE
108               git-revision: true
109
110 - job-template:
111     name: 'doctor-verify-{installer}-{inspector}-{arch}-{stream}'
112     disabled: '{obj:disabled}'
113     node: 'doctor-{installer}-{arch}'
114     wrappers:
115       - ssh-agent-wrapper
116       - build-timeout:
117           timeout: 30
118     parameters:
119       - project-parameter:
120           project: '{project}'
121           branch: '{branch}'
122       - '{installer}-defaults'
123       - 'doctor-slave-parameter'
124       - 'doctor-parameter':
125           docker-tag: '{docker-tag}'
126           scenario: '{scenario}'
127       - 'doctor-functest-parameter':
128           gs-pathname: '{gs-pathname}'
129           inspector: '{inspector}'
130     scm:
131       - git-scm-gerrit
132     builders:
133       - 'doctor-verify-installer-inspector-builders-macro'
134     publishers:
135       - 'doctor-verify-publishers-macro'
136
137
138 # -------------------------------
139 # parameter macros
140 # -------------------------------
141 - parameter:
142     name: 'doctor-parameter'
143     parameters:
144       - string:
145           name: OS_CREDS
146           default: /home/jenkins/openstack.creds
147           description: 'OpenStack credentials'
148       - string:
149           name: DOCKER_TAG
150           default: '{docker-tag}'
151           description: 'Tag to pull docker image'
152       - string:
153           name: CLEAN_DOCKER_IMAGES
154           default: 'false'
155           description: 'Remove downloaded docker images (opnfv/functest:*)'
156       - string:
157           name: DEPLOY_SCENARIO
158           default: '{scenario}'
159           description: 'Scenario to deploy and test'
160
161 - parameter:
162     name: 'doctor-functest-parameter'
163     parameters:
164       # functest-suite-parameter
165       - string:
166           name: FUNCTEST_MODE
167           default: 'testcase'
168       - string:
169           name: FUNCTEST_SUITE_NAME
170           default: 'doctor-notification'
171       - string:
172           name: TESTCASE_OPTIONS
173           # yamllint disable rule:line-length
174           default: '-e INSPECTOR_TYPE={inspector} -v $WORKSPACE:/home/opnfv/repos/doctor'
175           # yamllint enable rule:line-length
176           description: 'Addtional parameters specific to test case(s)'
177       # functest-parameter
178       - string:
179           name: GS_PATHNAME
180           default: '{gs-pathname}'
181           # yamllint disable rule:line-length
182           description: "Version directory where the opnfv documents will be stored in gs repository"
183           # yamllint enable rule:line-length
184       - string:
185           name: FUNCTEST_REPO_DIR
186           default: "/home/opnfv/repos/functest"
187           description: "Directory where the Functest repository is cloned"
188       - string:
189           name: PUSH_RESULTS_TO_DB
190           default: "true"
191           description: "Push the results of all the tests to the resultDB"
192       - string:
193           name: CI_DEBUG
194           default: 'true'
195           description: "Show debug output information"
196 # -------------------------------
197 # builder macros
198 # -------------------------------
199
200 - builder:
201     name: 'doctor-verify-installer-inspector-builders-macro'
202     builders:
203       - 'clean-workspace-log'
204       # yamllint disable rule:line-length
205       - shell: |
206           # NOTE: Create symbolic link, so that we can archive file outside
207           #       of $WORKSPACE .
208           # NOTE: We are printing all logs under 'tests/' during test run,
209           #       so this symbolic link should not be in 'tests/'. Otherwise,
210           #       we'll have the same log twice in jenkins console log.
211           ln -sfn $HOME/opnfv/functest/results/{stream} functest_results
212           # NOTE: Get functest script in $WORKSPACE. This functest script is
213           #       needed to perform VM image download in set-functest-env.sh
214           #       from E release cycle.
215           mkdir -p functest/ci
216           wget https://git.opnfv.org/functest/plain/functest/ci/download_images.sh -O functest/ci/download_images.sh
217       - 'functest-suite-builder'
218       - shell: |
219           functest_log="$HOME/opnfv/functest/results/{stream}/$FUNCTEST_SUITE_NAME.log"
220           # NOTE: checking the test result, as the previous job could return
221           #       0 regardless the result of doctor test scenario.
222           grep -e 'doctor test successfully' $functest_log || exit 1
223       # yamllint enable rule:line-length
224
225 # -------------------------------
226 # publisher macros
227 # -------------------------------
228 - publisher:
229     name: 'doctor-verify-publishers-macro'
230     publishers:
231       - archive:
232           artifacts: 'doctor_tests/*.log'
233       - archive:
234           artifacts: 'functest_results/$FUNCTEST_SUITE_NAME.log'
235       - email-jenkins-admins-on-failure
236
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