f8c0258a6f4daad4ab44370d6d187a1df2fcb546
[releng.git] / jjb / daisy4nfv / daisy4nfv-merge-jobs.yml
1 - project:
2     name: 'daisy4nfv-merge-jobs'
3
4     project: 'daisy'
5 #####################################
6 # branch definitions
7 #####################################
8     stream:
9         - master:
10             branch: '{stream}'
11             gs-pathname: ''
12             disabled: false
13 #####################################
14 # patch merge phases
15 #####################################
16     phase:
17         - 'basic':
18             slave-label: 'opnfv-build-centos'
19         - 'build':
20             slave-label: 'opnfv-build-centos'
21         - 'deploy-virtual':
22             slave-label: 'opnfv-build-centos'
23         - 'smoke-test':
24             slave-label: 'opnfv-build-centos'
25         - 'promote':
26             slave-label: 'opnfv-build-centos'
27 #####################################
28 # jobs
29 #####################################
30     jobs:
31         - 'daisy4nfv-merge-{stream}'
32         - 'daisy4nfv-merge-{phase}-{stream}'
33 #####################################
34 # job templates
35 #####################################
36 - job-template:
37     name: 'daisy4nfv-merge-{stream}'
38
39     project-type: multijob
40
41     disabled: false
42
43     concurrent: true
44
45     properties:
46         - throttle:
47             enabled: true
48             max-total: 4
49             option: 'project'
50
51     scm:
52         - gerrit-trigger-scm:
53             credentials-id: '{ssh-credentials}'
54             refspec: '$GERRIT_REFSPEC'
55             choosing-strategy: 'gerrit'
56
57     wrappers:
58         - ssh-agent-credentials:
59             users:
60                 - '{ssh-credentials}'
61         - timeout:
62             timeout: 360
63             fail: true
64
65     triggers:
66         - gerrit:
67             trigger-on:
68                 - change-merged-event
69                 - comment-added-contains-event:
70                     comment-contains-value: 'remerge'
71             projects:
72               - project-compare-type: 'ANT'
73                 project-pattern: '{project}'
74                 branches:
75                   - branch-compare-type: 'ANT'
76                     branch-pattern: '**/{branch}'
77                 forbidden-file-paths:
78                   - compare-type: ANT
79                     pattern: 'docs/**|.gitignore'
80             readable-message: true
81
82     parameters:
83         - project-parameter:
84             project: '{project}'
85         - gerrit-parameter:
86             branch: '{branch}'
87         - 'opnfv-build-defaults'
88         - 'daisy4nfv-merge-defaults':
89             gs-pathname: '{gs-pathname}'
90
91     builders:
92         - description-setter:
93             description: "Built on $NODE_NAME"
94         - multijob:
95             name: basic
96             condition: SUCCESSFUL
97             projects:
98                 - name: 'daisy4nfv-merge-basic-{stream}'
99                   current-parameters: false
100                   predefined-parameters: |
101                     GERRIT_BRANCH=$GERRIT_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: build
110             condition: SUCCESSFUL
111             projects:
112                 - name: 'daisy4nfv-merge-build-{stream}'
113                   current-parameters: false
114                   predefined-parameters: |
115                     GERRIT_BRANCH=$GERRIT_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         - multijob:
123             name: deploy-virtual
124             condition: SUCCESSFUL
125             projects:
126                 - name: 'daisy4nfv-merge-deploy-virtual-{stream}'
127                   current-parameters: false
128                   predefined-parameters: |
129                     GERRIT_BRANCH=$GERRIT_BRANCH
130                     GERRIT_REFSPEC=$GERRIT_REFSPEC
131                     GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
132                     GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
133                   node-parameters: false
134                   kill-phase-on: FAILURE
135                   abort-all-job: true
136         - multijob:
137             name: smoke-test
138             condition: SUCCESSFUL
139             projects:
140                 - name: 'daisy4nfv-merge-smoke-test-{stream}'
141                   current-parameters: false
142                   predefined-parameters: |
143                     GERRIT_BRANCH=$GERRIT_BRANCH
144                     GERRIT_REFSPEC=$GERRIT_REFSPEC
145                     GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
146                     GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
147                   node-parameters: false
148                   kill-phase-on: FAILURE
149                   abort-all-job: true
150         - multijob:
151             name: promote
152             condition: SUCCESSFUL
153             projects:
154                 - name: 'daisy4nfv-merge-promote-{stream}'
155                   current-parameters: false
156                   predefined-parameters: |
157                     GERRIT_BRANCH=$GERRIT_BRANCH
158                     GERRIT_REFSPEC=$GERRIT_REFSPEC
159                     GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
160                     GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
161                   node-parameters: false
162                   kill-phase-on: FAILURE
163                   abort-all-job: true
164
165 - job-template:
166     name: 'daisy4nfv-merge-{phase}-{stream}'
167
168     disabled: '{obj:disabled}'
169
170     concurrent: true
171
172     properties:
173         - throttle:
174             enabled: true
175             max-total: 6
176             option: 'project'
177         - build-blocker:
178             use-build-blocker: true
179             blocking-jobs:
180                 - 'daisy4nfv-merge-deploy-.*'
181                 - 'daisy4nfv-merge-test-.*'
182             block-level: 'NODE'
183
184     scm:
185         - gerrit-trigger-scm:
186             credentials-id: '{ssh-credentials}'
187             refspec: '$GERRIT_REFSPEC'
188             choosing-strategy: 'gerrit'
189
190     wrappers:
191         - ssh-agent-credentials:
192             users:
193                 - '{ssh-credentials}'
194         - timeout:
195             timeout: 360
196             fail: true
197
198     parameters:
199         - project-parameter:
200             project: '{project}'
201         - gerrit-parameter:
202             branch: '{branch}'
203         - '{slave-label}-defaults'
204         - 'daisy4nfv-merge-defaults':
205             gs-pathname: '{gs-pathname}'
206
207     builders:
208         - description-setter:
209             description: "Built on $NODE_NAME"
210         - '{project}-merge-{phase}-macro'
211 #####################################
212 # builder macros
213 #####################################
214 - builder:
215     name: 'daisy-merge-basic-macro'
216     builders:
217         - shell:
218             !include-raw: ./daisy4nfv-basic.sh
219
220 - builder:
221     name: 'daisy-merge-build-macro'
222     builders:
223         - shell:
224             !include-raw:
225                 - ./daisy4nfv-build.sh
226                 - ./daisy4nfv-upload-artifact.sh
227                 - ./daisy4nfv-workspace-cleanup.sh
228
229 - builder:
230     name: 'daisy-merge-deploy-virtual-macro'
231     builders:
232         - shell:
233             !include-raw:
234                 - ./daisy4nfv-download-artifact.sh
235                 - ./daisy4nfv-virtual-deploy.sh
236                 - ./daisy4nfv-workspace-cleanup.sh
237
238 - builder:
239     name: 'daisy-merge-smoke-test-macro'
240     builders:
241         - shell: |
242             #!/bin/bash
243
244             echo "Not activated!"
245
246 - builder:
247     name: 'daisy-merge-promote-macro'
248     builders:
249         - shell: |
250             #!/bin/bash
251
252             echo "Not activated!"
253 #####################################
254 # parameter macros
255 #####################################
256 - parameter:
257     name: 'daisy4nfv-merge-defaults'
258     parameters:
259         - string:
260             name: BUILD_DIRECTORY
261             default: $WORKSPACE/build_output
262             description: "Directory where the build artifact will be located upon the completion of the build."
263         - string:
264             name: CACHE_DIRECTORY
265             default: $HOME/opnfv/cache/$INSTALLER_TYPE
266             description: "Directory where the cache to be used during the build is located."
267         - string:
268             name: GS_URL
269             default: artifacts.opnfv.org/$PROJECT{gs-pathname}
270             description: "URL to Google Storage."