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