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