57e44e3145fd8b1a7c12f0d1da93aa5a9607911a
[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
129 - job-template:
130     name: '{installer}-{phase}-daily-{stream}'
131
132     disabled: '{obj:disabled}'
133
134     concurrent: true
135
136     properties:
137         - logrotate-default
138         - throttle:
139             enabled: true
140             max-total: 6
141             option: 'project'
142
143     scm:
144         - git-scm
145
146     wrappers:
147         - ssh-agent-wrapper
148         - timeout:
149             timeout: 360
150             fail: true
151
152     parameters:
153         - project-parameter:
154             project: '{project}'
155             branch: '{branch}'
156         - '{installer}-defaults'
157         - '{slave-label}-defaults'
158         - string:
159             name: GIT_BASE
160             default: https://gerrit.opnfv.org/gerrit/$PROJECT
161             description: 'Git URL to use on this Jenkins Slave'
162         - string:
163             name: DEPLOY_SCENARIO
164             default: 'os-nosdn-nofeature-noha'
165         - '{installer}-project-parameter':
166             gs-pathname: '{gs-pathname}'
167
168     builders:
169         - description-setter:
170               description: "Built on $NODE_NAME"
171         - '{installer}-{phase}-daily-macro'
172
173 #####################################
174 # builder macros
175 #####################################
176 - builder:
177     name: 'daisy-build-daily-macro'
178     builders:
179         - shell:
180             !include-raw: ./daisy4nfv-basic.sh
181         - shell:
182             !include-raw: ./daisy4nfv-build.sh
183         - shell:
184             !include-raw: ./daisy4nfv-upload-artifact.sh
185         - shell:
186             !include-raw: ./daisy4nfv-workspace-cleanup.sh
187
188 - builder:
189     name: 'daisy-deploy-daily-macro'
190     builders:
191         - shell:
192             !include-raw: ./daisy4nfv-download-artifact.sh
193         - shell:
194             !include-raw: ./daisy-deploy.sh
195
196 - builder:
197     name: 'daisy-test-daily-macro'
198     builders:
199         - shell: |
200             #!/bin/bash
201
202             echo "Not activated!"
203
204 #####################################
205 # parameter macros
206 #####################################
207 - publisher:
208     name: 'daisy-recipients'
209     publishers:
210         - email:
211             recipients: hu.zhijiang@zte.com.cn lu.yao135@zte.com.cn zhou.ya@zte.com.cn yangyang1@zte.com.cn julienjut@gmail.com
212
213 - parameter:
214     name: 'daisy-project-parameter'
215     parameters:
216         - string:
217             name: BUILD_DIRECTORY
218             default: $WORKSPACE/build_output
219             description: "Directory where the build artifact will be located upon the completion of the build."
220         - string:
221             name: CACHE_DIRECTORY
222             default: $HOME/opnfv/cache/$INSTALLER_TYPE
223             description: "Directory where the cache to be used during the build is located."
224         - string:
225             name: GS_URL
226             default: artifacts.opnfv.org/$PROJECT{gs-pathname}
227             description: "URL to Google Storage."