52769ca88eaf15fdf696f5cf13b5a8c26be78ed7
[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
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}-daily-.*'
145                 - 'daisy4nfv-(merge|verify)-.*'
146             block-level: 'NODE'
147
148     scm:
149         - git-scm
150
151     wrappers:
152         - ssh-agent-wrapper
153         - timeout:
154             timeout: 360
155             fail: true
156
157     parameters:
158         - project-parameter:
159             project: '{project}'
160             branch: '{branch}'
161         - 'daisy-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         - 'daisy-defaults'
170         - '{slave-label}-defaults'
171         - '{installer}-project-parameter':
172             gs-pathname: '{gs-pathname}'
173
174     builders:
175         - description-setter:
176               description: "Built on $NODE_NAME"
177         - '{installer}-{phase}-daily-macro'
178
179 #####################################
180 # builder macros
181 #####################################
182 - builder:
183     name: 'daisy-build-daily-macro'
184     builders:
185         - shell:
186             !include-raw: ./daisy4nfv-basic.sh
187         - shell:
188             !include-raw: ./daisy4nfv-build.sh
189         - shell:
190             !include-raw: ./daisy4nfv-upload-artifact.sh
191         - shell:
192             !include-raw: ./daisy4nfv-workspace-cleanup.sh
193
194 - builder:
195     name: 'daisy-deploy-daily-macro'
196     builders:
197         - shell:
198             !include-raw: ./daisy4nfv-download-artifact.sh
199         - shell:
200             !include-raw: ./daisy-deploy.sh
201
202 - builder:
203     name: 'daisy-test-daily-macro'
204     builders:
205         - shell: |
206             #!/bin/bash
207
208             echo "Not activated!"
209
210 #####################################
211 # parameter macros
212 #####################################
213 - publisher:
214     name: 'daisy-recipients'
215     publishers:
216         - email:
217             recipients: hu.zhijiang@zte.com.cn lu.yao135@zte.com.cn zhou.ya@zte.com.cn yangyang1@zte.com.cn julienjut@gmail.com
218
219 - parameter:
220     name: 'daisy-project-parameter'
221     parameters:
222         - string:
223             name: BUILD_DIRECTORY
224             default: $WORKSPACE/build_output
225             description: "Directory where the build artifact will be located upon the completion of the build."
226         - string:
227             name: CACHE_DIRECTORY
228             default: $HOME/opnfv/cache/$INSTALLER_TYPE
229             description: "Directory where the cache to be used during the build is located."
230         - string:
231             name: GS_URL
232             default: artifacts.opnfv.org/$PROJECT{gs-pathname}
233             description: "URL to Google Storage."