From eb3ab9ba305a4078753c35e851d62a5ef58a1221 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Sat, 10 Aug 2013 21:10:28 -0300 Subject: [PATCH] Create repo when we create the cgit config file Git repos need to be created locally. Ensure that we create the necessary repos when creating the config file for them. Change-Id: I0b0b8e183049dd9f825224f1657cb88a64edf37b --- jeepyb/cmd/create_cgitrepos.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/jeepyb/cmd/create_cgitrepos.py b/jeepyb/cmd/create_cgitrepos.py index 8bd12e6..8acbfd6 100644 --- a/jeepyb/cmd/create_cgitrepos.py +++ b/jeepyb/cmd/create_cgitrepos.py @@ -21,6 +21,7 @@ # organization (openstack, stackforge, etc) import os +import subprocess import yaml @@ -50,14 +51,17 @@ def main(): for org in sorted(gitorgs): cgit_file.write('\n') cgit_file.write('section=%s\n' % (org)) + org_dir = os.path.join(REPO_PATH, org) projects = gitorgs[org] projects.sort() for (name, description) in projects: + project_repo = "%s.git" % os.path.join(org_dir, name) cgit_file.write('\n') cgit_file.write('repo.url=%s/%s\n' % (org, name)) - cgit_file.write('repo.path=%s/%s/%s.git/\n' % (REPO_PATH, - org, name)) + cgit_file.write('repo.path=%s/\n' % (project_repo)) cgit_file.write('repo.desc=%s\n' % (description)) + if not os.path.exists(project_repo): + subprocess.call(['git', 'init', '--bare', project_repo]) if __name__ == "__main__":