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 heapq | 10 import heapq |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 rw_checkout -- Reconfigure repo after sync'ing to read-write. | 52 rw_checkout -- Reconfigure repo after sync'ing to read-write. |
53 retries -- Number of retries to try before failing on the sync. | 53 retries -- Number of retries to try before failing on the sync. |
54 | 54 |
55 """ | 55 """ |
56 while retries > 0: | 56 while retries > 0: |
57 try: | 57 try: |
58 # The --trace option ensures that repo shows the output from git. This | 58 # The --trace option ensures that repo shows the output from git. This |
59 # is needed so that the buildbot can kill us if git is not making | 59 # is needed so that the buildbot can kill us if git is not making |
60 # progress. | 60 # progress. |
61 RunCommand(['repo', '--trace', 'sync'], cwd=buildroot) | 61 RunCommand(['repo', '--trace', 'sync'], cwd=buildroot) |
62 if rw_checkout: | |
63 # Always re-run in case of new git repos or repo sync | |
64 # failed in a previous run because of a forced Stop Build. | |
65 RunCommand(['repo', 'forall', '-c', 'git', 'config', | |
66 'url.ssh://git@gitrw.chromium.org:9222.pushinsteadof', | |
67 'http://git.chromium.org/git'], cwd=buildroot) | |
68 | |
69 retries = 0 | 62 retries = 0 |
70 except: | 63 except: |
71 retries -= 1 | 64 retries -= 1 |
72 if retries > 0: | 65 if retries > 0: |
73 Warning('CBUILDBOT -- Repo Sync Failed, retrying') | 66 Warning('CBUILDBOT -- Repo Sync Failed, retrying') |
74 else: | 67 else: |
75 Warning('CBUILDBOT -- Retries exhausted') | 68 Warning('CBUILDBOT -- Retries exhausted') |
76 raise | 69 raise |
77 | 70 |
78 # Output manifest | 71 # Output manifest |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 help='file where new revisions are stored') | 501 help='file where new revisions are stored') |
509 parser.add_option('--clobber', action='store_true', dest='clobber', | 502 parser.add_option('--clobber', action='store_true', dest='clobber', |
510 default=False, | 503 default=False, |
511 help='Clobbers an old checkout before syncing') | 504 help='Clobbers an old checkout before syncing') |
512 parser.add_option('--debug', action='store_true', dest='debug', | 505 parser.add_option('--debug', action='store_true', dest='debug', |
513 default=False, | 506 default=False, |
514 help='Override some options to run as a developer.') | 507 help='Override some options to run as a developer.') |
515 parser.add_option('-t', '--tracking-branch', dest='tracking_branch', | 508 parser.add_option('-t', '--tracking-branch', dest='tracking_branch', |
516 default='cros/master', help='Run the buildbot on a branch') | 509 default='cros/master', help='Run the buildbot on a branch') |
517 parser.add_option('-u', '--url', dest='url', | 510 parser.add_option('-u', '--url', dest='url', |
518 default='http://git.chromium.org/git/manifest', | 511 default='ssh://git@gitrw.chromium.org:9222/manifest', |
519 help='Run the buildbot on internal manifest') | 512 help='Run the buildbot on internal manifest') |
520 | 513 |
521 (options, args) = parser.parse_args() | 514 (options, args) = parser.parse_args() |
522 | 515 |
523 buildroot = os.path.abspath(options.buildroot) | 516 buildroot = os.path.abspath(options.buildroot) |
524 revisionfile = options.revisionfile | 517 revisionfile = options.revisionfile |
525 tracking_branch = options.tracking_branch | 518 tracking_branch = options.tracking_branch |
526 | 519 |
527 if len(args) >= 1: | 520 if len(args) >= 1: |
528 buildconfig = _GetConfig(args[-1]) | 521 buildconfig = _GetConfig(args[-1]) |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 except: | 588 except: |
596 # Send failure to master bot. | 589 # Send failure to master bot. |
597 if not buildconfig['master'] and buildconfig['important']: | 590 if not buildconfig['master'] and buildconfig['important']: |
598 cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_FAILED) | 591 cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_FAILED) |
599 | 592 |
600 raise | 593 raise |
601 | 594 |
602 | 595 |
603 if __name__ == '__main__': | 596 if __name__ == '__main__': |
604 main() | 597 main() |
OLD | NEW |