OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """CBuildbot is wrapper around the build process used by the pre-flight queue""" | 7 """CBuildbot is wrapper around the build process used by the pre-flight queue""" |
8 | 8 |
9 import errno | 9 import errno |
10 import re | 10 import re |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 RunCommand(['sudo', 'rm', '-rf', buildroot]) | 209 RunCommand(['sudo', 'rm', '-rf', buildroot]) |
210 MakeDir(buildroot, parents=True) | 210 MakeDir(buildroot, parents=True) |
211 RunCommand(['repo', 'init', '-u', 'http://src.chromium.org/git/manifest'], | 211 RunCommand(['repo', 'init', '-u', 'http://src.chromium.org/git/manifest'], |
212 cwd=buildroot, input='\n\ny\n') | 212 cwd=buildroot, input='\n\ny\n') |
213 RepoSync(buildroot, rw_checkout, retries) | 213 RepoSync(buildroot, rw_checkout, retries) |
214 | 214 |
215 | 215 |
216 def _IncrementalCheckout(buildroot, rw_checkout=True, | 216 def _IncrementalCheckout(buildroot, rw_checkout=True, |
217 retries=_DEFAULT_RETRIES): | 217 retries=_DEFAULT_RETRIES): |
218 """Performs a checkout without clobbering previous checkout.""" | 218 """Performs a checkout without clobbering previous checkout.""" |
| 219 _UprevCleanup(buildroot, error_ok=True) |
219 RepoSync(buildroot, rw_checkout, retries) | 220 RepoSync(buildroot, rw_checkout, retries) |
220 | 221 |
221 | 222 |
222 def _MakeChroot(buildroot): | 223 def _MakeChroot(buildroot): |
223 """Wrapper around make_chroot.""" | 224 """Wrapper around make_chroot.""" |
224 cwd = os.path.join(buildroot, 'src', 'scripts') | 225 cwd = os.path.join(buildroot, 'src', 'scripts') |
225 RunCommand(['./make_chroot', '--fast'], cwd=cwd) | 226 RunCommand(['./make_chroot', '--fast'], cwd=cwd) |
226 | 227 |
227 | 228 |
228 def _SetupBoard(buildroot, board='x86-generic'): | 229 def _SetupBoard(buildroot, board='x86-generic'): |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 #if revisions != 'None': | 275 #if revisions != 'None': |
275 # print >> sys.stderr, 'CBUILDBOT Revision list found %s' % revisions | 276 # print >> sys.stderr, 'CBUILDBOT Revision list found %s' % revisions |
276 # revision_list = _ParseRevisionString(revisions, | 277 # revision_list = _ParseRevisionString(revisions, |
277 # _CreateRepoDictionary(buildroot, board)) | 278 # _CreateRepoDictionary(buildroot, board)) |
278 # _UprevFromRevisionList(buildroot, revision_list) | 279 # _UprevFromRevisionList(buildroot, revision_list) |
279 #else: | 280 #else: |
280 Info('CBUILDBOT Revving all') | 281 Info('CBUILDBOT Revving all') |
281 _UprevAllPackages(buildroot) | 282 _UprevAllPackages(buildroot) |
282 | 283 |
283 | 284 |
284 def _UprevCleanup(buildroot): | 285 def _UprevCleanup(buildroot, error_ok=False): |
285 """Clean up after a previous uprev attempt.""" | 286 """Clean up after a previous uprev attempt.""" |
286 cwd = os.path.join(buildroot, 'src', 'scripts') | 287 cwd = os.path.join(buildroot, 'src', 'scripts') |
287 RunCommand(['./cros_mark_as_stable', '--srcroot=..', | 288 RunCommand(['./cros_mark_as_stable', '--srcroot=..', |
288 '--tracking_branch="cros/master"', 'clean'], | 289 '--tracking_branch="cros/master"', 'clean'], |
289 cwd=cwd) | 290 cwd=cwd, error_ok=error_ok) |
290 | 291 |
291 | 292 |
292 def _UprevPush(buildroot): | 293 def _UprevPush(buildroot): |
293 """Pushes uprev changes to the main line.""" | 294 """Pushes uprev changes to the main line.""" |
294 cwd = os.path.join(buildroot, 'src', 'scripts') | 295 cwd = os.path.join(buildroot, 'src', 'scripts') |
295 RunCommand(['./cros_mark_as_stable', '--srcroot=..', | 296 RunCommand(['./cros_mark_as_stable', '--srcroot=..', |
296 '--tracking_branch="cros/master"', | 297 '--tracking_branch="cros/master"', |
297 '--push_options', '--bypass-hooks -f', 'push'], | 298 '--push_options', '--bypass-hooks -f', 'push'], |
298 cwd=cwd) | 299 cwd=cwd) |
299 | 300 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 except: | 391 except: |
391 # Send failure to master bot. | 392 # Send failure to master bot. |
392 if not buildconfig['master'] and buildconfig['important']: | 393 if not buildconfig['master'] and buildconfig['important']: |
393 cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_FAILED) | 394 cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_FAILED) |
394 | 395 |
395 raise | 396 raise |
396 | 397 |
397 | 398 |
398 if __name__ == '__main__': | 399 if __name__ == '__main__': |
399 main() | 400 main() |
OLD | NEW |