Fix Yamllint violations for jjb/daisy4nfv
[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
41 ########################
42 # job templates
43 ########################
44 - job-template:
45     name: '{installer}-daily-{stream}'
46
47     project-type: multijob
48
49     disabled: false
50
51     concurrent: true
52
53     properties:
54       - logrotate-default
55       - throttle:
56           enabled: true
57           max-total: 4
58           option: 'project'
59       - build-blocker:
60           use-build-blocker: true
61           blocking-jobs:
62             - '{installer}-daily-.*'
63             - 'daisy4nfv-merge-build-.*'
64             - 'daisy4nfv-verify-build-.*'
65           block-level: 'NODE'
66
67     scm:
68       - git-scm
69
70     triggers:
71       - timed: '0 8 * * *'
72
73     parameters:
74       - project-parameter:
75           project: '{project}'
76           branch: '{branch}'
77       - 'opnfv-build-centos-defaults'
78       - '{installer}-defaults'
79       - '{installer}-project-parameter':
80           gs-pathname: '{gs-pathname}'
81
82     wrappers:
83       - ssh-agent-wrapper
84       - timeout:
85           timeout: 360
86           fail: true
87
88     builders:
89       - description-setter:
90           description: "Built on $NODE_NAME"
91       - multijob:
92           name: build
93           condition: SUCCESSFUL
94           projects:
95             - name: '{installer}-build-daily-{stream}'
96               current-parameters: false
97               predefined-parameters: |
98                 BRANCH=$BRANCH
99                 GERRIT_REFSPEC=$GERRIT_REFSPEC
100                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
101                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
102               node-parameters: false
103               kill-phase-on: FAILURE
104               abort-all-job: true
105       - multijob:
106           name: deploy
107           condition: SUCCESSFUL
108           projects:
109             - name: '{installer}-deploy-daily-{stream}'
110               current-parameters: false
111               predefined-parameters: |
112                 BRANCH=$BRANCH
113                 GERRIT_REFSPEC=$GERRIT_REFSPEC
114                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
115                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
116               node-parameters: false
117               kill-phase-on: FAILURE
118               abort-all-job: true
119       - multijob:
120           name: test
121           condition: SUCCESSFUL
122           projects:
123             - name: '{installer}-test-daily-{stream}'
124               current-parameters: false
125               predefined-parameters: |
126                 BRANCH=$BRANCH
127                 GERRIT_REFSPEC=$GERRIT_REFSPEC
128                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
129                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
130               node-parameters: false
131               kill-phase-on: FAILURE
132               abort-all-job: true
133
134     publishers:
135       - '{installer}-recipients'
136       - email-jenkins-admins-on-failure
137
138 - job-template:
139     name: '{installer}-{phase}-daily-{stream}'
140
141     disabled: '{obj:disabled}'
142
143     concurrent: true
144
145     properties:
146       - logrotate-default
147       - throttle:
148           enabled: true
149           max-total: 6
150           option: 'project'
151
152     scm:
153       - git-scm
154
155     wrappers:
156       - ssh-agent-wrapper
157       - timeout:
158           timeout: 360
159           fail: true
160
161     parameters:
162       - project-parameter:
163           project: '{project}'
164           branch: '{branch}'
165       - '{installer}-defaults'
166       - '{slave-label}-defaults'
167       - string:
168           name: GIT_BASE
169           default: https://gerrit.opnfv.org/gerrit/$PROJECT
170           description: 'Git URL to use on this Jenkins Slave'
171       - string:
172           name: DEPLOY_SCENARIO
173           default: 'os-nosdn-nofeature-ha'
174       - '{installer}-project-parameter':
175           gs-pathname: '{gs-pathname}'
176
177     builders:
178       - description-setter:
179           description: "Built on $NODE_NAME"
180       - '{installer}-{phase}-daily-macro'
181
182 #####################################
183 # builder macros
184 #####################################
185 - builder:
186     name: 'daisy-build-daily-macro'
187     builders:
188       - shell:
189           !include-raw: ./daisy4nfv-basic.sh
190       - shell:
191           !include-raw: ./daisy4nfv-build.sh
192       - shell:
193           !include-raw: ./daisy4nfv-upload-artifact.sh
194       - 'clean-workspace'
195
196 - builder:
197     name: 'daisy-deploy-daily-macro'
198     builders:
199       - shell:
200           !include-raw: ./daisy4nfv-download-artifact.sh
201       - shell:
202           !include-raw: ./daisy-deploy.sh
203
204 - builder:
205     name: 'daisy-test-daily-macro'
206     builders:
207       - shell: |
208           #!/bin/bash
209
210           echo "Not activated!"
211
212 #####################################
213 # parameter macros
214 #####################################
215 - publisher:
216     name: 'daisy-recipients'
217     publishers:
218       # yamllint disable rule:line-length
219       - email:
220           recipients: hu.zhijiang@zte.com.cn lu.yao135@zte.com.cn zhou.ya@zte.com.cn yangyang1@zte.com.cn julienjut@gmail.com
221       # yamllint enable rule:line-length
222       - email-jenkins-admins-on-failure
223
224 - parameter:
225     name: 'daisy-project-parameter'
226     parameters:
227       - string:
228           name: BUILD_DIRECTORY
229           default: $WORKSPACE/build_output
230           description: "Directory where the build artifact will be located upon the completion of the build."
231       - string:
232           name: CACHE_DIRECTORY
233           default: $HOME/opnfv/cache/$INSTALLER_TYPE
234           description: "Directory where the cache to be used during the build is located."
235       - string:
236           name: GS_URL
237           default: artifacts.opnfv.org/$PROJECT{gs-pathname}
238           description: "URL to Google Storage."