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