Add mkdir of git directories to cgit script
Add a section of the script to take the "orgs" defined and create those as directories we need in /var/lib/git Change-Id: Id7c4110ab60fca61655bb46a18f161e6eb6ea142
This commit is contained in:
@@ -16,6 +16,9 @@
|
|||||||
# create_cgitrepos.py reads the project config file called projects.yaml
|
# create_cgitrepos.py reads the project config file called projects.yaml
|
||||||
# and generates a cgitrepos configuration file which is then copied to
|
# and generates a cgitrepos configuration file which is then copied to
|
||||||
# the cgit server.
|
# the cgit server.
|
||||||
|
#
|
||||||
|
# It also creates the necessary top-level directories for each project
|
||||||
|
# organization (openstack, stackforge, etc)
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import yaml
|
import yaml
|
||||||
@@ -39,6 +42,9 @@ def main():
|
|||||||
assert name not in names
|
assert name not in names
|
||||||
names.add(name)
|
names.add(name)
|
||||||
gitorgs.setdefault(org, []).append((name, description))
|
gitorgs.setdefault(org, []).append((name, description))
|
||||||
|
for org in gitorgs:
|
||||||
|
if not os.path.isdir('%s/%s' % (REPO_PATH, org)):
|
||||||
|
os.makedirs('%s/%s' % (REPO_PATH, org))
|
||||||
with open(CGIT_REPOS, 'w') as cgit_file:
|
with open(CGIT_REPOS, 'w') as cgit_file:
|
||||||
cgit_file.write('# Autogenerated by create_cgitrepos.py\n')
|
cgit_file.write('# Autogenerated by create_cgitrepos.py\n')
|
||||||
for org in sorted(gitorgs):
|
for org in sorted(gitorgs):
|
||||||
|
Reference in New Issue
Block a user