Use computes + control for NUM_OS_SYSTEM
[releng.git] / jjb / daisy4nfv / daisy4nfv-merge-jobs.yaml
1 ---
2 - project:
3     name: 'daisy4nfv-merge-jobs'
4
5     project: 'daisy'
6
7     installer: 'daisy'
8
9     ###########################################################
10     # use alias to keep the jobs'name existed already unchanged
11     ###########################################################
12     alias: 'daisy4nfv'
13
14     #####################################
15     # branch definitions
16     #####################################
17     stream:
18       - master:
19           branch: '{stream}'
20           gs-pathname: ''
21           disabled: true
22       - fraser:
23           branch: 'stable/{stream}'
24           gs-pathname: '/{stream}'
25           disabled: true
26     #####################################
27     # patch merge phases
28     #####################################
29     phase:
30       - 'build':
31           slave-label: 'opnfv-build-centos'
32       - 'deploy-virtual':
33           slave-label: 'daisy-virtual'
34
35     #####################################
36     # jobs
37     #####################################
38     jobs:
39       - '{alias}-merge-{stream}'
40       - '{alias}-merge-{phase}-{stream}'
41
42 #####################################
43 # job templates
44 #####################################
45 - job-template:
46     name: '{alias}-merge-{stream}'
47
48     project-type: multijob
49
50     disabled: false
51
52     concurrent: true
53
54     properties:
55       - logrotate-default
56       - throttle:
57           enabled: true
58           max-total: 4
59           option: 'project'
60       - build-blocker:
61           use-build-blocker: true
62           blocking-jobs:
63             - '{alias}-merge-(master|fraser)'
64           block-level: 'NODE'
65
66     scm:
67       - git-scm
68
69     wrappers:
70       - ssh-agent-wrapper
71       - timeout:
72           timeout: 360
73           fail: true
74
75     triggers:
76       - gerrit:
77           server-name: 'gerrit.opnfv.org'
78           trigger-on:
79             - change-merged-event
80             - comment-added-contains-event:
81                 comment-contains-value: 'remerge'
82           projects:
83             - project-compare-type: 'ANT'
84               project-pattern: '{project}'
85               branches:
86                 - branch-compare-type: 'ANT'
87                   branch-pattern: '**/{branch}'
88               file-paths:
89                 - compare-type: ANT
90                   pattern: 'ci/**'
91                 - compare-type: ANT
92                   pattern: 'code/**'
93                 - compare-type: ANT
94                   pattern: 'deploy/**'
95               disable-strict-forbidden-file-verification: 'true'
96               forbidden-file-paths:
97                 - compare-type: ANT
98                   pattern: 'docs/**'
99                 - compare-type: ANT
100                   pattern: '.gitignore'
101           readable-message: true
102
103     parameters:
104       - project-parameter:
105           project: '{project}'
106           branch: '{branch}'
107       - 'opnfv-build-centos-defaults'
108       - '{alias}-merge-defaults':
109           gs-pathname: '{gs-pathname}'
110
111     builders:
112       - description-setter:
113           description: "Built on $NODE_NAME"
114       - multijob:
115           name: build
116           condition: SUCCESSFUL
117           projects:
118             - name: '{alias}-merge-build-{stream}'
119               current-parameters: false
120               predefined-parameters: |
121                 BRANCH=$BRANCH
122                 GERRIT_REFSPEC=$GERRIT_REFSPEC
123                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
124                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
125               node-parameters: false
126               kill-phase-on: FAILURE
127               abort-all-job: true
128       - multijob:
129           name: deploy-virtual
130           condition: SUCCESSFUL
131           projects:
132             - name: '{alias}-merge-deploy-virtual-{stream}'
133               current-parameters: false
134               predefined-parameters: |
135                 BRANCH=$BRANCH
136                 GERRIT_REFSPEC=$GERRIT_REFSPEC
137                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
138                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
139               node-parameters: false
140               kill-phase-on: FAILURE
141               abort-all-job: true
142
143 - job-template:
144     name: '{alias}-merge-{phase}-{stream}'
145
146     disabled: '{obj:disabled}'
147
148     concurrent: true
149
150     properties:
151       - logrotate-default
152       - throttle:
153           enabled: true
154           max-total: 4
155           option: 'project'
156       - build-blocker:
157           use-build-blocker: true
158           blocking-jobs:
159             - '{alias}-merge-{phase}-.*'
160             - '{installer}-daily-.*'
161           block-level: 'NODE'
162
163     scm:
164       - git-scm
165
166     wrappers:
167       - ssh-agent-wrapper
168       - timeout:
169           timeout: 360
170           fail: true
171
172     parameters:
173       - project-parameter:
174           project: '{project}'
175           branch: '{branch}'
176       - '{installer}-defaults'
177       - '{slave-label}-defaults'
178       - '{alias}-merge-defaults':
179           gs-pathname: '{gs-pathname}'
180
181     builders:
182       - description-setter:
183           description: "Built on $NODE_NAME"
184       - '{project}-merge-{phase}-macro'
185
186 #####################################
187 # builder macros
188 #####################################
189 - builder:
190     name: 'daisy-merge-build-macro'
191     builders:
192       - shell:
193           !include-raw: ./daisy4nfv-basic.sh
194       - shell:
195           !include-raw: ./daisy4nfv-build.sh
196       - shell:
197           !include-raw: ./daisy4nfv-upload-artifact.sh
198       - 'clean-workspace'
199
200 - builder:
201     name: 'daisy-merge-deploy-virtual-macro'
202     builders:
203       - shell:
204           !include-raw: ./daisy4nfv-download-artifact.sh
205       - shell:
206           !include-raw: ./daisy-deploy.sh
207       - 'clean-workspace'
208
209 #####################################
210 # parameter macros
211 #####################################
212 - parameter:
213     name: 'daisy4nfv-merge-defaults'
214     parameters:
215       - string:
216           name: BUILD_DIRECTORY
217           default: $WORKSPACE/build_output
218           description: "Directory where the build artifact will be located upon the completion of the build."
219       - string:
220           name: CACHE_DIRECTORY
221           default: $HOME/opnfv/cache/$INSTALLER_TYPE
222           description: "Directory where the cache to be used during the build is located."
223       - string:
224           name: GS_URL
225           default: artifacts.opnfv.org/$PROJECT{gs-pathname}
226           description: "URL to Google Storage."