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