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