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