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