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