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