Add jjb script for nfvbench to build the nfvbench VM
[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             cd ./utils/test/{module}/
86             tox
87             if [ -e *.xml ];then
88                 cp *.xml $WORKSPACE
89             fi
90
91     publishers:
92         - publish-coverage
93
94 - job-template:
95     name: '{module}-automate-{stream}'
96
97     project-type: multijob
98
99     properties:
100         - throttle:
101             enabled: true
102             max-total: 1
103             max-per-node: 1
104             option: 'project'
105
106     parameters:
107         - project-parameter:
108             project: '{project}'
109             branch: '{branch}'
110         - string:
111             name: DOCKER_TAG
112             default: 'latest'
113             description: 'Tag name for {module} docker image'
114         - string:
115             name: MODULE_NAME
116             default: '{module}'
117             description: "Name of the module"
118         - 'opnfv-build-defaults'
119
120     scm:
121         - git-scm
122
123     wrappers:
124         - ssh-agent-wrapper
125         - timeout:
126             timeout: 360
127             fail: true
128
129     triggers:
130         - gerrit:
131             server-name: 'gerrit.opnfv.org'
132             trigger-on:
133                 - change-merged-event
134                 - comment-added-contains-event:
135                     comment-contains-value: 'remerge'
136             projects:
137               - project-compare-type: 'ANT'
138                 project-pattern: '{project}'
139                 branches:
140                   - branch-compare-type: 'ANT'
141                     branch-pattern: '**/{branch}'
142                 file-paths:
143                   - compare-type: 'ANT'
144                     pattern: 'utils/test/{module}/**'
145
146     builders:
147         - description-setter:
148             description: "Built on $NODE_NAME"
149         - docker-update
150         - multijob:
151             name: docker-deploy
152             condition: SUCCESSFUL
153             projects:
154                 - name: '{module}-automate-docker-deploy-{stream}'
155                   current-parameters: false
156                   predefined-parameters: |
157                     GIT_BASE=$GIT_BASE
158                   node-label-name: SLAVE_LABEL
159                   node-label: testresults
160                   kill-phase-on: FAILURE
161                   abort-all-job: true
162         - multijob:
163             name: generate-doc
164             condition: SUCCESSFUL
165             projects:
166                 - name: '{module}-automate-generate-doc-{stream}'
167                   current-parameters: true
168                   kill-phase-on: FAILURE
169                   abort-all-job: true
170
171     publishers:
172         - 'email-publisher'
173
174 - job-template:
175     name: '{module}-automate-{phase}-{stream}'
176
177     properties:
178         - throttle:
179             enabled: true
180             max-per-node: 1
181             option: 'project'
182
183     parameters:
184         - project-parameter:
185             project: '{project}'
186             branch: '{branch}'
187
188     wrappers:
189         - ssh-agent-wrapper
190         - timeout:
191             timeout: 120
192             fail: true
193
194     scm:
195         - git-scm
196
197     builders:
198         - description-setter:
199             description: "Built on $NODE_NAME"
200         - '{module}-automate-{phase}-macro'
201
202 ################################
203 # job builders
204 ################################
205 - builder:
206     name: 'docker-update'
207     builders:
208         - shell:
209             !include-raw: ./docker-update.sh
210
211 - builder:
212     name: 'testapi-automate-generate-doc-macro'
213     builders:
214         - 'testapi-doc-build'
215         - 'upload-doc-artifact'
216
217 - builder:
218     name: 'testapi-doc-build'
219     builders:
220         - shell: |
221             bash ./utils/test/testapi/htmlize/doc-build.sh
222
223 - builder:
224     name: 'upload-doc-artifact'
225     builders:
226         - shell: |
227             bash ./utils/test/testapi/htmlize/push-doc-artifact.sh
228
229 - builder:
230     name: 'reporting-automate-generate-doc-macro'
231     builders:
232         - shell: echo "To Be Done"
233
234 - builder:
235     name: 'testapi-automate-docker-deploy-macro'
236     builders:
237         - shell: |
238             bash ./jjb/releng/docker-deploy.sh "sudo docker run -dti -p 8082:8000
239             -e mongodb_url=mongodb://172.17.0.1:27017
240             -e base_url=http://testresults.opnfv.org/test opnfv/testapi" \
241             "http://testresults.opnfv.org/test/swagger/APIs" "testapi"
242
243 - builder:
244     name: 'reporting-automate-docker-deploy-macro'
245     builders:
246         - shell: |
247             bash ./jjb/releng/docker-deploy.sh "sudo docker run -itd -p 8084:8000 opnfv/reporting" \
248             "http://testresults.opnfv.org/reporting2/reporting/index.html" "reporting"
249
250 - builder:
251     name: mongodb-backup
252     builders:
253         - shell: |
254             bash ./jjb/releng/testapi-backup-mongodb.sh
255
256 ################################
257 # job publishers
258 ################################
259
260 - publisher:
261     name: 'email-publisher'
262     publishers:
263         - email:
264             recipients: rohitsakala@gmail.com feng.xiaowei@zte.com.cn morgan.richomme@orange.com
265             notify-every-unstable-build: false
266             send-to-individuals: true