Merge "Don't cache inactive repos"

This commit is contained in:
Jenkins 2016-03-07 01:12:25 +00:00 committed by Gerrit Code Review
commit 3a6dd094cc
2 changed files with 19 additions and 11 deletions

View File

@ -32,12 +32,16 @@ def main():
projects = [f['project'] for f in yaml.load(urllib2.urlopen(URL))] projects = [f['project'] for f in yaml.load(urllib2.urlopen(URL))]
with open(PROJECTS_REPOS, 'w') as projects_list: with open(PROJECTS_REPOS, 'w') as projects_list:
for project in projects: for project in projects:
args = dict( # Skip repos that are inactive
name=os.path.basename(project), dirname = os.path.dirname(project)
location=os.path.join('/opt/git', project), if not ('attic' in dirname or dirname == 'stackforge'):
url='%s/%s.git' % (GIT_BASE, project)) args = dict(
name=os.path.basename(project),
location=os.path.join('/opt/git', project),
url='%s/%s.git' % (GIT_BASE, project))
projects_list.write("%(name)s git %(location)s %(url)s\n" % args) projects_list.write("%(name)s git %(location)s "
"%(url)s\n" % args)
# Clone openstack-infra/system-config again so that we can use it to # Clone openstack-infra/system-config again so that we can use it to
# build the image without interferring with the slave repo cache. # build the image without interferring with the slave repo cache.
project = 'openstack-infra/system-config' project = 'openstack-infra/system-config'

View File

@ -74,14 +74,18 @@ def main():
# YAML module which is not in the stdlib. # YAML module which is not in the stdlib.
m = PROJECT_RE.match(line) m = PROJECT_RE.match(line)
if m: if m:
(status, out) = clone_repo(m.group(1)) project = m.group(1)
print out dirname = os.path.dirname(project)
if status != 0: # Skip repos that are inactive
print 'Retrying to clone %s' % m.group(1) if not ('attic' in dirname or dirname == 'stackforge'):
(status, out) = clone_repo(m.group(1)) (status, out) = clone_repo(project)
print out print out
if status != 0: if status != 0:
raise Exception('Failed to clone %s' % m.group(1)) print 'Retrying to clone %s' % m.group(1)
(status, out) = clone_repo(m.group(1))
print out
if status != 0:
raise Exception('Failed to clone %s' % m.group(1))
if __name__ == '__main__': if __name__ == '__main__':