dd76538a31305a8060e95bfc94bc72747a77f115
[releng.git] / jjb / releng / testapi-automate.yml
1 - project:
2     name: testapi-automate
3     stream:
4         - master:
5             branch: '{stream}'
6             gs-pathname: ''
7
8     phase:
9         - 'docker-update'
10         - 'docker-deploy':
11             slave-label: 'testresults'
12         - 'generate-doc'
13
14     jobs:
15         - 'testapi-automate-{stream}'
16         - 'testapi-automate-{phase}-{stream}'
17         - 'testapi-verify-{stream}'
18
19     project: 'releng'
20
21 - job:
22     name: 'testapi-mongodb-backup'
23
24     parameters:
25         - label:
26             name: SLAVE_LABEL
27             default: 'testresults'
28             description: 'Slave label on Jenkins'
29         - project-parameter:
30             project: 'releng'
31             branch: 'master'
32         - string:
33             name: GIT_BASE
34             default: https://gerrit.opnfv.org/gerrit/releng
35             description: 'Git URL to use on this Jenkins Slave'
36
37     scm:
38         - git-scm
39
40     triggers:
41         - timed: '@weekly'
42
43     builders:
44         - mongodb-backup
45
46 - job-template:
47     name: 'testapi-verify-{stream}'
48
49     parameters:
50         - project-parameter:
51             project: '{project}'
52             branch: '{branch}'
53         - 'opnfv-build-ubuntu-defaults'
54
55     scm:
56         - git-scm-gerrit
57
58     triggers:
59         - gerrit:
60             server-name: 'gerrit.opnfv.org'
61             trigger-on:
62                 - patchset-created-event:
63                     exclude-drafts: 'false'
64                     exclude-trivial-rebase: 'false'
65                     exclude-no-code-change: 'false'
66                 - draft-published-event
67                 - comment-added-contains-event:
68                     comment-contains-value: 'recheck'
69                 - comment-added-contains-event:
70                     comment-contains-value: 'reverify'
71             projects:
72               - project-compare-type: 'ANT'
73                 project-pattern: '{project}'
74                 branches:
75                   - branch-compare-type: 'ANT'
76                     branch-pattern: '**/{branch}'
77                 file-paths:
78                   - compare-type: 'ANT'
79                     pattern: 'utils/test/testapi/**'
80
81     builders:
82         - run-unit-tests
83
84     publishers:
85         - junit:
86             results: nosetests.xml
87         - cobertura:
88             report-file: "coverage.xml"
89             only-stable: "true"
90             health-auto-update: "false"
91             stability-auto-update: "false"
92             zoom-coverage-chart: "true"
93             targets:
94                 - files:
95                     healthy: 10
96                     unhealthy: 20
97                     failing: 30
98                 - method:
99                     healthy: 50
100                     unhealthy: 40
101                     failing: 30
102
103 - job-template:
104     name: 'testapi-automate-{stream}'
105
106     project-type: multijob
107
108     properties:
109         - throttle:
110             enabled: true
111             max-total: 1
112             max-per-node: 1
113             option: 'project'
114
115     parameters:
116         - project-parameter:
117             project: '{project}'
118             branch: '{branch}'
119         - string:
120             name: DOCKER_TAG
121             default: "latest"
122             description: "Tag name for testapi docker image"
123         - 'opnfv-build-defaults'
124
125     scm:
126         - git-scm
127
128     wrappers:
129         - ssh-agent-wrapper
130         - timeout:
131             timeout: 360
132             fail: true
133
134     triggers:
135         - gerrit:
136             server-name: 'gerrit.opnfv.org'
137             trigger-on:
138                 - change-merged-event
139                 - comment-added-contains-event:
140                     comment-contains-value: 'remerge'
141             projects:
142               - project-compare-type: 'ANT'
143                 project-pattern: '{project}'
144                 branches:
145                   - branch-compare-type: 'ANT'
146                     branch-pattern: '**/{branch}'
147                 file-paths:
148                   - compare-type: 'ANT'
149                     pattern: 'utils/test/testapi/**'
150
151     builders:
152         - description-setter:
153             description: "Built on $NODE_NAME"
154         - multijob:
155             name: docker-update
156             condition: SUCCESSFUL
157             projects:
158                 - name: 'testapi-automate-docker-update-{stream}'
159                   current-parameters: true
160                   kill-phase-on: FAILURE
161                   abort-all-job: true
162         - multijob:
163             name: docker-deploy
164             condition: SUCCESSFUL
165             projects:
166                 - name: 'testapi-automate-docker-deploy-{stream}'
167                   current-parameters: false
168                   predefined-parameters: |
169                     GIT_BASE=$GIT_BASE
170                   node-label-name: SLAVE_LABEL
171                   node-label: testresults
172                   kill-phase-on: FAILURE
173                   abort-all-job: true
174         - multijob:
175             name: generate-doc
176             condition: SUCCESSFUL
177             projects:
178                 - name: 'testapi-automate-generate-doc-{stream}'
179                   current-parameters: true
180                   kill-phase-on: FAILURE
181                   abort-all-job: true
182
183     publishers:
184         - 'email-publisher'
185
186 - job-template:
187     name: 'testapi-automate-{phase}-{stream}'
188
189     properties:
190         - throttle:
191             enabled: true
192             max-per-node: 1
193             option: 'project'
194
195     parameters:
196         - project-parameter:
197             project: '{project}'
198             branch: '{branch}'
199         - string:
200             name: DOCKER_TAG
201             default: "latest"
202             description: "Tag name for testapi docker image"
203
204     wrappers:
205         - ssh-agent-wrapper
206         - timeout:
207             timeout: 120
208             fail: true
209
210     scm:
211         - git-scm
212
213     builders:
214         - description-setter:
215             description: "Built on $NODE_NAME"
216         - 'testapi-automate-{phase}-macro'
217
218 ################################
219 # job builders
220 ################################
221 - builder:
222     name: mongodb-backup
223     builders:
224         - shell: |
225             bash ./jjb/releng/testapi-backup-mongodb.sh
226
227 - builder:
228     name: 'run-unit-tests'
229     builders:
230         - shell: |
231             bash ./utils/test/testapi/run_test.sh
232
233 - builder:
234     name: 'testapi-automate-docker-update-macro'
235     builders:
236         - shell: |
237             bash ./jjb/releng/testapi-docker-update.sh
238
239 - builder:
240     name: 'testapi-automate-generate-doc-macro'
241     builders:
242         - 'testapi-doc-build'
243         - 'upload-doc-artifact'
244
245 - builder:
246     name: 'testapi-doc-build'
247     builders:
248         - shell: |
249             bash ./utils/test/testapi/htmlize/doc-build.sh
250
251 - builder:
252     name: 'upload-doc-artifact'
253     builders:
254         - shell: |
255             bash ./utils/test/testapi/htmlize/push-doc-artifact.sh
256
257 - builder:
258     name: 'testapi-automate-docker-deploy-macro'
259     builders:
260         - shell: |
261             bash ./jjb/releng/testapi-docker-deploy.sh
262
263 ################################
264 # job publishers
265 ################################
266
267 - publisher:
268     name: 'email-publisher'
269     publishers:
270         - email:
271             recipients: rohitsakala@gmail.com feng.xiaowei@zte.com.cn
272             notify-every-unstable-build: false
273             send-to-individuals: true