Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2483)

Unified Diff: bin/cbuildbot.py

Issue 3166019: Add repo sync all helper for non-pfq buildbots. (Closed) Base URL: http://src.chromium.org/git/crosutils.git
Patch Set: Fix ws Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | bin/cros_repo_sync_all » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bin/cbuildbot.py
diff --git a/bin/cbuildbot.py b/bin/cbuildbot.py
index 5bcb04788006c4fa7d907b151666c4a66ceb11fd..bc44f943892fbb155e6832b14409b7571499e994 100755
--- a/bin/cbuildbot.py
+++ b/bin/cbuildbot.py
@@ -13,6 +13,8 @@ import sys
from cbuildbot_config import config
+_DEFAULT_RETRIES=3
+
# Utility functions
def RunCommand(cmd, error_ok=False, error_message=None, exit_code=False,
@@ -51,19 +53,34 @@ def MakeDir(path, parents=False):
else:
raise
+def RepoSync(buildroot, retries=_DEFAULT_RETRIES):
+ while retries > 0:
+ try:
+ RunCommand(['repo', 'sync'], cwd=buildroot)
+ retries = 0
+ except:
+ retries -= 1
+ if retries > 0:
+ print >>sys.stderr, 'CBUILDBOT -- Repo Sync Failed, retrying'
+ else:
+ print >>sys.stderr, 'CBUILDBOT -- Retries exhausted'
+ raise
+
# Main functions
-def _FullCheckout(buildroot):
+def _FullCheckout(buildroot, rw_checkout=True, retries=_DEFAULT_RETRIES):
+ RunCommand(['sudo', 'rm', '-rf', buildroot])
MakeDir(buildroot, parents=True)
RunCommand(['repo', 'init', '-u', 'http://src.chromium.org/git/manifest'],
cwd=buildroot, input='\n\ny\n')
- RunCommand(['repo', 'sync'], cwd=buildroot)
- RunCommand(['repo', 'forall', '-c', 'git', 'config',
- 'url.ssh://git@gitrw.chromium.org:9222.pushinsteadof',
- 'http://src.chromium.org/git'], cwd=buildroot)
-
-def _IncrementalCheckout(buildroot):
- RunCommand(['repo', 'sync'], cwd=buildroot)
+ RepoSync(buildroot, retries)
+ if rw_checkout:
+ RunCommand(['repo', 'forall', '-c', 'git', 'config',
+ 'url.ssh://git@gitrw.chromium.org:9222.pushinsteadof',
+ 'http://src.chromium.org/git'], cwd=buildroot)
+
+def _IncrementalCheckout(buildroot, retries=_DEFAULT_RETRIES):
+ RepoSync(buildroot, retries)
def _MakeChroot(buildroot):
cwd = os.path.join(buildroot, 'src', 'scripts')
« no previous file with comments | « no previous file | bin/cros_repo_sync_all » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698