merge GIT_BRANCH and GERRIT_BRANCH into BRANCH
[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         - logrotate-default
47         - throttle:
48             enabled: true
49             max-total: 4
50             option: 'project'
51
52     scm:
53         - git-scm
54
55     wrappers:
56         - ssh-agent-wrapper
57         - timeout:
58             timeout: 360
59             fail: true
60
61     triggers:
62         - gerrit:
63             server-name: 'gerrit.opnfv.org'
64             trigger-on:
65                 - change-merged-event
66                 - comment-added-contains-event:
67                     comment-contains-value: 'remerge'
68             projects:
69               - project-compare-type: 'ANT'
70                 project-pattern: '{project}'
71                 branches:
72                   - branch-compare-type: 'ANT'
73                     branch-pattern: '**/{branch}'
74                 forbidden-file-paths:
75                   - compare-type: ANT
76                     pattern: 'docs/**|.gitignore'
77             readable-message: true
78
79     parameters:
80         - project-parameter:
81             project: '{project}'
82             branch: '{branch}'
83         - 'opnfv-build-defaults'
84         - 'daisy4nfv-merge-defaults':
85             gs-pathname: '{gs-pathname}'
86
87     builders:
88         - description-setter:
89             description: "Built on $NODE_NAME"
90         - multijob:
91             name: basic
92             condition: SUCCESSFUL
93             projects:
94                 - name: 'daisy4nfv-merge-basic-{stream}'
95                   current-parameters: false
96                   predefined-parameters: |
97                     BRANCH=$BRANCH
98                     GERRIT_REFSPEC=$GERRIT_REFSPEC
99                     GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
100                     GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
101                   node-parameters: false
102                   kill-phase-on: FAILURE
103                   abort-all-job: true
104         - multijob:
105             name: build
106             condition: SUCCESSFUL
107             projects:
108                 - name: 'daisy4nfv-merge-build-{stream}'
109                   current-parameters: false
110                   predefined-parameters: |
111                     BRANCH=$BRANCH
112                     GERRIT_REFSPEC=$GERRIT_REFSPEC
113                     GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
114                     GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
115                   node-parameters: false
116                   kill-phase-on: FAILURE
117                   abort-all-job: true
118         - multijob:
119             name: deploy-virtual
120             condition: SUCCESSFUL
121             projects:
122                 - name: 'daisy4nfv-merge-deploy-virtual-{stream}'
123                   current-parameters: false
124                   predefined-parameters: |
125                     BRANCH=$BRANCH
126                     GERRIT_REFSPEC=$GERRIT_REFSPEC
127                     GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
128                     GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
129                   node-parameters: false
130                   kill-phase-on: FAILURE
131                   abort-all-job: true
132         - multijob:
133             name: smoke-test
134             condition: SUCCESSFUL
135             projects:
136                 - name: 'daisy4nfv-merge-smoke-test-{stream}'
137                   current-parameters: false
138                   predefined-parameters: |
139                     BRANCH=$BRANCH
140                     GERRIT_REFSPEC=$GERRIT_REFSPEC
141                     GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
142                     GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
143                   node-parameters: false
144                   kill-phase-on: FAILURE
145                   abort-all-job: true
146         - multijob:
147             name: promote
148             condition: SUCCESSFUL
149             projects:
150                 - name: 'daisy4nfv-merge-promote-{stream}'
151                   current-parameters: false
152                   predefined-parameters: |
153                     BRANCH=$BRANCH
154                     GERRIT_REFSPEC=$GERRIT_REFSPEC
155                     GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
156                     GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
157                   node-parameters: false
158                   kill-phase-on: FAILURE
159                   abort-all-job: true
160
161 - job-template:
162     name: 'daisy4nfv-merge-{phase}-{stream}'
163
164     disabled: '{obj:disabled}'
165
166     concurrent: true
167
168     properties:
169         - logrotate-default
170         - throttle:
171             enabled: true
172             max-total: 6
173             option: 'project'
174         - build-blocker:
175             use-build-blocker: true
176             blocking-jobs:
177                 - 'daisy4nfv-merge-deploy-.*'
178                 - 'daisy4nfv-merge-test-.*'
179             block-level: 'NODE'
180
181     scm:
182         - git-scm
183
184     wrappers:
185         - ssh-agent-wrapper
186         - timeout:
187             timeout: 360
188             fail: true
189
190     parameters:
191         - project-parameter:
192             project: '{project}'
193             branch: '{branch}'
194         - '{slave-label}-defaults'
195         - 'daisy4nfv-merge-defaults':
196             gs-pathname: '{gs-pathname}'
197
198     builders:
199         - description-setter:
200             description: "Built on $NODE_NAME"
201         - '{project}-merge-{phase}-macro'
202 #####################################
203 # builder macros
204 #####################################
205 - builder:
206     name: 'daisy-merge-basic-macro'
207     builders:
208         - shell:
209             !include-raw: ./daisy4nfv-basic.sh
210
211 - builder:
212     name: 'daisy-merge-build-macro'
213     builders:
214         - shell:
215             !include-raw:
216                 - ./daisy4nfv-build.sh
217                 - ./daisy4nfv-upload-artifact.sh
218                 - ./daisy4nfv-workspace-cleanup.sh
219
220 - builder:
221     name: 'daisy-merge-deploy-virtual-macro'
222     builders:
223         - shell:
224             !include-raw:
225                 - ./daisy4nfv-download-artifact.sh
226                 - ./daisy4nfv-virtual-deploy.sh
227                 - ./daisy4nfv-workspace-cleanup.sh
228
229 - builder:
230     name: 'daisy-merge-smoke-test-macro'
231     builders:
232         - shell: |
233             #!/bin/bash
234
235             echo "Not activated!"
236
237 - builder:
238     name: 'daisy-merge-promote-macro'
239     builders:
240         - shell: |
241             #!/bin/bash
242
243             echo "Not activated!"
244 #####################################
245 # parameter macros
246 #####################################
247 - parameter:
248     name: 'daisy4nfv-merge-defaults'
249     parameters:
250         - string:
251             name: BUILD_DIRECTORY
252             default: $WORKSPACE/build_output
253             description: "Directory where the build artifact will be located upon the completion of the build."
254         - string:
255             name: CACHE_DIRECTORY
256             default: $HOME/opnfv/cache/$INSTALLER_TYPE
257             description: "Directory where the cache to be used during the build is located."
258         - string:
259             name: GS_URL
260             default: artifacts.opnfv.org/$PROJECT{gs-pathname}
261             description: "URL to Google Storage."