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