Update block rules on nodes
[releng.git] / jjb / daisy4nfv / daisy-project-jobs.yml
1 ---
2 ######################################################################
3 # Add daily jobs, for buidoing, deploying and testing
4 # TODO:
5 # - [ ] Add yardstick and functest for test stage
6 # - [x] Use daisy-baremetal-defauls for choosing baremetal deployment
7 ######################################################################
8
9 #############################
10 # Job configuration for daisy
11 #############################
12 - project:
13     name: daisy-project-jobs
14
15     project: 'daisy'
16
17     installer: 'daisy'
18
19     stream:
20       - master:
21           branch: '{stream}'
22           gs-pathname: ''
23           disabled: false
24       - euphrates:
25           branch: 'stable/{stream}'
26           gs-pathname: '/{stream}'
27           disabled: false
28
29     phase:
30       - 'build':
31           slave-label: 'opnfv-build-centos'
32       - 'deploy':
33           slave-label: 'daisy-baremetal'
34       - 'test':
35           slave-label: 'opnfv-build-centos'
36
37     jobs:
38       - '{installer}-daily-{stream}'
39       - '{installer}-{phase}-daily-{stream}'
40       - '{installer}-kolla-build-{stream}'
41
42 #############################
43 # docker build job templates
44 #############################
45 - job-template:
46     name: '{installer}-kolla-build-{stream}'
47     disabled: false
48     concurrent: true
49
50     properties:
51       - logrotate-default
52       - throttle:
53           enabled: true
54           max-total: 4
55           option: 'project'
56       - build-blocker:
57           use-build-blocker: true
58           # Note: Need to block all jobs which may create daisy VM.
59           blocking-jobs:
60             - '{installer}-kolla-build-.*'
61             - 'daisy-deploy-.*'
62             - 'daisy-daily-.*'
63           block-level: 'NODE'
64
65     scm:
66       - git-scm
67
68     triggers:
69       - 'daisy-kolla-build-{stream}-trigger'
70
71     parameters:
72       - project-parameter:
73           project: '{project}'
74           branch: '{branch}'
75       - 'daisy-virtual-defaults'
76       - '{installer}-defaults'
77       - '{installer}-project-parameter':
78           gs-pathname: '{gs-pathname}'
79
80     wrappers:
81       - ssh-agent-wrapper
82       - timeout:
83           timeout: 720
84           fail: true
85
86     builders:
87       - description-setter:
88           description: "Built on $NODE_NAME"
89       - shell:
90           !include-raw-escape: ./daisy4nfv-build-kolla-image.sh
91
92     publishers:
93       - '{installer}-recipients'
94       - email-jenkins-admins-on-failure
95
96 - trigger:
97     name: 'daisy-kolla-build-euphrates-trigger'
98     triggers:
99       - timed: '0 0 * * 0'
100
101 - trigger:
102     name: 'daisy-kolla-build-master-trigger'
103     triggers:
104       - timed: '0 12 * * 0'
105
106
107 ########################
108 # job templates
109 ########################
110 - job-template:
111     name: '{installer}-daily-{stream}'
112
113     project-type: multijob
114
115     disabled: false
116
117     concurrent: true
118
119     properties:
120       - logrotate-default
121       - throttle:
122           enabled: true
123           max-total: 4
124           option: 'project'
125       - build-blocker:
126           use-build-blocker: true
127           blocking-jobs:
128             - '{installer}-daily-.*'
129             - '{installer}-kolla-build-.*'
130             - 'daisy4nfv-merge-build-.*'
131             - 'daisy4nfv-verify-build-.*'
132           block-level: 'NODE'
133
134     scm:
135       - git-scm
136
137     triggers:
138       - timed: '0 8 * * *'
139
140     parameters:
141       - project-parameter:
142           project: '{project}'
143           branch: '{branch}'
144       - 'opnfv-build-centos-defaults'
145       - '{installer}-defaults'
146       - '{installer}-project-parameter':
147           gs-pathname: '{gs-pathname}'
148
149     wrappers:
150       - ssh-agent-wrapper
151       - timeout:
152           timeout: 360
153           fail: true
154
155     builders:
156       - description-setter:
157           description: "Built on $NODE_NAME"
158       - multijob:
159           name: build
160           condition: SUCCESSFUL
161           projects:
162             - name: '{installer}-build-daily-{stream}'
163               current-parameters: false
164               predefined-parameters: |
165                 BRANCH=$BRANCH
166                 GERRIT_REFSPEC=$GERRIT_REFSPEC
167                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
168                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
169               node-parameters: false
170               kill-phase-on: FAILURE
171               abort-all-job: true
172       - multijob:
173           name: deploy
174           condition: SUCCESSFUL
175           projects:
176             - name: '{installer}-deploy-daily-{stream}'
177               current-parameters: false
178               predefined-parameters: |
179                 BRANCH=$BRANCH
180                 GERRIT_REFSPEC=$GERRIT_REFSPEC
181                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
182                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
183               node-parameters: false
184               kill-phase-on: FAILURE
185               abort-all-job: true
186       - multijob:
187           name: test
188           condition: SUCCESSFUL
189           projects:
190             - name: '{installer}-test-daily-{stream}'
191               current-parameters: false
192               predefined-parameters: |
193                 BRANCH=$BRANCH
194                 GERRIT_REFSPEC=$GERRIT_REFSPEC
195                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
196                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
197               node-parameters: false
198               kill-phase-on: FAILURE
199               abort-all-job: true
200
201     publishers:
202       - '{installer}-recipients'
203       - email-jenkins-admins-on-failure
204
205 - job-template:
206     name: '{installer}-{phase}-daily-{stream}'
207
208     disabled: '{obj:disabled}'
209
210     concurrent: true
211
212     properties:
213       - logrotate-default
214       - throttle:
215           enabled: true
216           max-total: 6
217           option: 'project'
218       - build-blocker:
219           use-build-blocker: true
220           blocking-jobs:
221             - '{installer}-daily-(build|deploy|test)-(euphrates|master)'
222             - '{installer}-.*-(baremetal|virtual|zte-pod9)-daily-(euphrates|master)'
223             - '(functest|yardstick)-{installer}-(baremetal|virtual|zte-pod9)-daily-(euphrates|master)'
224           block-level: 'NODE'
225
226     scm:
227       - git-scm
228
229     wrappers:
230       - ssh-agent-wrapper
231       - timeout:
232           timeout: 360
233           fail: true
234
235     parameters:
236       - project-parameter:
237           project: '{project}'
238           branch: '{branch}'
239       - '{installer}-defaults'
240       - '{slave-label}-defaults'
241       - string:
242           name: GIT_BASE
243           default: https://gerrit.opnfv.org/gerrit/$PROJECT
244           description: 'Git URL to use on this Jenkins Slave'
245       - string:
246           name: DEPLOY_SCENARIO
247           default: 'os-nosdn-nofeature-ha'
248       - '{installer}-project-parameter':
249           gs-pathname: '{gs-pathname}'
250
251     builders:
252       - description-setter:
253           description: "Built on $NODE_NAME"
254       - '{installer}-{phase}-daily-macro'
255
256 #####################################
257 # builder macros
258 #####################################
259 - builder:
260     name: 'daisy-build-daily-macro'
261     builders:
262       - shell:
263           !include-raw: ./daisy4nfv-basic.sh
264       - shell:
265           !include-raw: ./daisy4nfv-build.sh
266       - shell:
267           !include-raw: ./daisy4nfv-upload-artifact.sh
268       - 'clean-workspace'
269
270 - builder:
271     name: 'daisy-deploy-daily-macro'
272     builders:
273       - shell:
274           !include-raw: ./daisy4nfv-download-artifact.sh
275       - shell:
276           !include-raw: ./daisy-deploy.sh
277
278 - builder:
279     name: 'daisy-test-daily-macro'
280     builders:
281       - shell: |
282           #!/bin/bash
283
284           echo "Not activated!"
285
286 #####################################
287 # parameter macros
288 #####################################
289 - publisher:
290     name: 'daisy-recipients'
291     publishers:
292       # yamllint disable rule:line-length
293       - email:
294           recipients: hu.zhijiang@zte.com.cn lu.yao135@zte.com.cn zhou.ya@zte.com.cn yangyang1@zte.com.cn julienjut@gmail.com
295       # yamllint enable rule:line-length
296       - email-jenkins-admins-on-failure
297
298 - parameter:
299     name: 'daisy-project-parameter'
300     parameters:
301       - string:
302           name: BUILD_DIRECTORY
303           default: $WORKSPACE/build_output
304           description: "Directory where the build artifact will be located upon the completion of the build."
305       - string:
306           name: CACHE_DIRECTORY
307           default: $HOME/opnfv/cache/$INSTALLER_TYPE
308           description: "Directory where the cache to be used during the build is located."
309       - string:
310           name: GS_URL
311           default: artifacts.opnfv.org/$PROJECT{gs-pathname}
312           description: "URL to Google Storage."