add zte-virtul3 and zte-virtul4 to Doctor CI pods
[releng.git] / jjb / releng / automate.yml
1 - project:
2     name: utils-automate
3     stream:
4         - master:
5             branch: '{stream}'
6
7     module:
8         - 'testapi'
9         - 'reporting'
10
11     phase:
12         - 'docker-deploy':
13             slave-label: 'testresults'
14         - 'generate-doc'
15
16     jobs:
17         - '{module}-automate-{stream}'
18         - '{module}-automate-{phase}-{stream}'
19         - '{module}-verify-{stream}'
20
21     project: 'releng'
22
23 - job:
24     name: 'testapi-mongodb-backup'
25
26     parameters:
27         - label:
28             name: SLAVE_LABEL
29             default: 'testresults'
30             description: 'Slave label on Jenkins'
31         - project-parameter:
32             project: 'releng'
33             branch: 'master'
34         - string:
35             name: GIT_BASE
36             default: https://gerrit.opnfv.org/gerrit/releng
37             description: 'Git URL to use on this Jenkins Slave'
38
39     scm:
40         - git-scm
41
42     triggers:
43         - timed: '@weekly'
44
45     builders:
46         - mongodb-backup
47
48 - job-template:
49     name: '{module}-verify-{stream}'
50
51     parameters:
52         - project-parameter:
53             project: '{project}'
54             branch: '{branch}'
55         - 'opnfv-build-ubuntu-defaults'
56
57     scm:
58         - git-scm-gerrit
59
60     triggers:
61         - gerrit:
62             server-name: 'gerrit.opnfv.org'
63             trigger-on:
64                 - patchset-created-event:
65                     exclude-drafts: 'false'
66                     exclude-trivial-rebase: 'false'
67                     exclude-no-code-change: 'false'
68                 - draft-published-event
69                 - comment-added-contains-event:
70                     comment-contains-value: 'recheck'
71                 - comment-added-contains-event:
72                     comment-contains-value: 'reverify'
73             projects:
74               - project-compare-type: 'ANT'
75                 project-pattern: '{project}'
76                 branches:
77                   - branch-compare-type: 'ANT'
78                     branch-pattern: '**/{branch}'
79                 file-paths:
80                   - compare-type: 'ANT'
81                     pattern: 'utils/test/{module}/**'
82
83     builders:
84         - shell: |
85             bash ./utils/test/{module}/run_test.sh
86
87     publishers:
88         - junit:
89             results: nosetests.xml
90         - cobertura:
91             report-file: "coverage.xml"
92             only-stable: "true"
93             health-auto-update: "false"
94             stability-auto-update: "false"
95             zoom-coverage-chart: "true"
96             targets:
97                 - files:
98                     healthy: 10
99                     unhealthy: 20
100                     failing: 30
101                 - method:
102                     healthy: 50
103                     unhealthy: 40
104                     failing: 30
105
106 - job-template:
107     name: '{module}-automate-{stream}'
108
109     project-type: multijob
110
111     properties:
112         - throttle:
113             enabled: true
114             max-total: 1
115             max-per-node: 1
116             option: 'project'
117
118     parameters:
119         - project-parameter:
120             project: '{project}'
121             branch: '{branch}'
122         - string:
123             name: DOCKER_TAG
124             default: 'latest'
125             description: 'Tag name for {module} docker image'
126         - string:
127             name: MODULE_NAME
128             default: '{module}'
129             description: "Name of the module"
130         - 'opnfv-build-defaults'
131
132     scm:
133         - git-scm
134
135     wrappers:
136         - ssh-agent-wrapper
137         - timeout:
138             timeout: 360
139             fail: true
140
141     triggers:
142         - gerrit:
143             server-name: 'gerrit.opnfv.org'
144             trigger-on:
145                 - change-merged-event
146                 - comment-added-contains-event:
147                     comment-contains-value: 'remerge'
148             projects:
149               - project-compare-type: 'ANT'
150                 project-pattern: '{project}'
151                 branches:
152                   - branch-compare-type: 'ANT'
153                     branch-pattern: '**/{branch}'
154                 file-paths:
155                   - compare-type: 'ANT'
156                     pattern: 'utils/test/{module}/**'
157
158     builders:
159         - description-setter:
160             description: "Built on $NODE_NAME"
161         - docker-update
162         - multijob:
163             name: docker-deploy
164             condition: SUCCESSFUL
165             projects:
166                 - name: '{module}-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: '{module}-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: '{module}-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
200     wrappers:
201         - ssh-agent-wrapper
202         - timeout:
203             timeout: 120
204             fail: true
205
206     scm:
207         - git-scm
208
209     builders:
210         - description-setter:
211             description: "Built on $NODE_NAME"
212         - '{module}-automate-{phase}-macro'
213
214 ################################
215 # job builders
216 ################################
217 - builder:
218     name: 'docker-update'
219     builders:
220         - shell:
221             !include-raw: ./docker-update.sh
222
223 - builder:
224     name: 'testapi-automate-generate-doc-macro'
225     builders:
226         - 'testapi-doc-build'
227         - 'upload-doc-artifact'
228
229 - builder:
230     name: 'testapi-doc-build'
231     builders:
232         - shell: |
233             bash ./utils/test/testapi/htmlize/doc-build.sh
234
235 - builder:
236     name: 'upload-doc-artifact'
237     builders:
238         - shell: |
239             bash ./utils/test/testapi/htmlize/push-doc-artifact.sh
240
241 - builder:
242     name: 'reporting-automate-generate-doc-macro'
243     builders:
244         - shell: echo "To Be Done"
245
246 - builder:
247     name: 'testapi-automate-docker-deploy-macro'
248     builders:
249         - shell: |
250             bash ./jjb/releng/docker-deploy.sh 'sudo docker run -dti -p 8082:8000 -e mongodb_url=mongodb://172.17.0.1:27017 -e swagger_url=http://testresults.opnfv.org/test opnfv/testapi' "http://testresults.opnfv.org/test/swagger/APIs"
251 - builder:
252     name: 'reporting-automate-docker-deploy-macro'
253     builders:
254         - shell: |
255             bash ./jjb/releng/docker-deploy.sh 'sudo docker run -itd -p 8084:8000 -e SERVER_URL=http://testresults.opnfv.org/reporting2:8084 opnfv/reporting' "http://testresults.opnfv.org/reporting2/reporting/index.html"
256
257 - builder:
258     name: mongodb-backup
259     builders:
260         - shell: |
261             bash ./jjb/releng/testapi-backup-mongodb.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 morgan.richomme@orange.com
272             notify-every-unstable-build: false
273             send-to-individuals: true