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