mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-24 15:11:19 +02:00
Reconfigure to use ssh connection rather than use different manifest.
This also removes the rw_checkout var as it's not longer changes the affect of whether we use the ssh url or not. Note that this replaces the other CL from last night because the other CL didn't work. The other CL still pulled in the same manifest that has http: url's for each git repo. I reverted that change last night after I noticed this. Change-Id: I3d4ad2be6887ac2cf4ed2009bad9cae6dfdf5bbf BUG=chromium-os:9509 TEST=Ran with cbuildbot --clobber and incremental Review URL: http://codereview.chromium.org/5278010
This commit is contained in:
parent
bce3668d75
commit
564373521e
@ -45,27 +45,21 @@ def MakeDir(path, parents=False):
|
|||||||
raise
|
raise
|
||||||
|
|
||||||
|
|
||||||
def RepoSync(buildroot, rw_checkout=False, retries=_DEFAULT_RETRIES):
|
def RepoSync(buildroot, retries=_DEFAULT_RETRIES):
|
||||||
"""Uses repo to checkout the source code.
|
"""Uses repo to checkout the source code.
|
||||||
|
|
||||||
Keyword arguments:
|
Keyword arguments:
|
||||||
rw_checkout -- Reconfigure repo after sync'ing to read-write.
|
|
||||||
retries -- Number of retries to try before failing on the sync.
|
retries -- Number of retries to try before failing on the sync.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
while retries > 0:
|
while retries > 0:
|
||||||
try:
|
try:
|
||||||
# The --trace option ensures that repo shows the output from git. This
|
# The --trace option ensures that repo shows the output from git. This
|
||||||
# is needed so that the buildbot can kill us if git is not making
|
# is needed so that the buildbot can kill us if git is not making
|
||||||
# progress.
|
# progress.
|
||||||
RunCommand(['repo', '--trace', 'sync'], cwd=buildroot)
|
|
||||||
if rw_checkout:
|
|
||||||
# Always re-run in case of new git repos or repo sync
|
|
||||||
# failed in a previous run because of a forced Stop Build.
|
|
||||||
RunCommand(['repo', 'forall', '-c', 'git', 'config',
|
RunCommand(['repo', 'forall', '-c', 'git', 'config',
|
||||||
'url.ssh://git@gitrw.chromium.org:9222.pushinsteadof',
|
'url.ssh://git@gitrw.chromium.org:9222.insteadof',
|
||||||
'http://git.chromium.org/git'], cwd=buildroot)
|
'http://git.chromium.org/git'], cwd=buildroot)
|
||||||
|
RunCommand(['repo', '--trace', 'sync'], cwd=buildroot)
|
||||||
retries = 0
|
retries = 0
|
||||||
except:
|
except:
|
||||||
retries -= 1
|
retries -= 1
|
||||||
@ -287,7 +281,7 @@ def _PreFlightRinse(buildroot, board, tracking_branch, overlays):
|
|||||||
RunCommand(['sudo', 'killall', 'kvm'], error_ok=True)
|
RunCommand(['sudo', 'killall', 'kvm'], error_ok=True)
|
||||||
|
|
||||||
|
|
||||||
def _FullCheckout(buildroot, tracking_branch, rw_checkout=True,
|
def _FullCheckout(buildroot, tracking_branch,
|
||||||
retries=_DEFAULT_RETRIES,
|
retries=_DEFAULT_RETRIES,
|
||||||
url='http://git.chromium.org/git/manifest'):
|
url='http://git.chromium.org/git/manifest'):
|
||||||
"""Performs a full checkout and clobbers any previous checkouts."""
|
"""Performs a full checkout and clobbers any previous checkouts."""
|
||||||
@ -297,13 +291,12 @@ def _FullCheckout(buildroot, tracking_branch, rw_checkout=True,
|
|||||||
RunCommand(['repo', 'init', '-u',
|
RunCommand(['repo', 'init', '-u',
|
||||||
url, '-b',
|
url, '-b',
|
||||||
'%s' % branch[-1]], cwd=buildroot, input='\n\ny\n')
|
'%s' % branch[-1]], cwd=buildroot, input='\n\ny\n')
|
||||||
RepoSync(buildroot, rw_checkout, retries)
|
RepoSync(buildroot, retries)
|
||||||
|
|
||||||
|
|
||||||
def _IncrementalCheckout(buildroot, rw_checkout=True,
|
def _IncrementalCheckout(buildroot, retries=_DEFAULT_RETRIES):
|
||||||
retries=_DEFAULT_RETRIES):
|
|
||||||
"""Performs a checkout without clobbering previous checkout."""
|
"""Performs a checkout without clobbering previous checkout."""
|
||||||
RepoSync(buildroot, rw_checkout, retries)
|
RepoSync(buildroot, retries)
|
||||||
|
|
||||||
|
|
||||||
def _MakeChroot(buildroot):
|
def _MakeChroot(buildroot):
|
||||||
|
@ -26,9 +26,9 @@ def main():
|
|||||||
if options.buildroot:
|
if options.buildroot:
|
||||||
if options.clobber:
|
if options.clobber:
|
||||||
cbuildbot._FullCheckout(options.buildroot, options.tracking_branch,
|
cbuildbot._FullCheckout(options.buildroot, options.tracking_branch,
|
||||||
rw_checkout=False, retries=_NUMBER_OF_RETRIES)
|
retries=_NUMBER_OF_RETRIES)
|
||||||
else:
|
else:
|
||||||
cbuildbot._IncrementalCheckout(options.buildroot, rw_checkout=False,
|
cbuildbot._IncrementalCheckout(options.buildroot,
|
||||||
retries=_NUMBER_OF_RETRIES)
|
retries=_NUMBER_OF_RETRIES)
|
||||||
else:
|
else:
|
||||||
print >> sys.stderr, 'ERROR: Must set buildroot'
|
print >> sys.stderr, 'ERROR: Must set buildroot'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user