Merge "Make local git dir creation optional"

This commit is contained in:
Zuul 2020-11-17 21:15:24 +00:00 committed by Gerrit Code Review
commit 255a6e6f2a
1 changed files with 7 additions and 4 deletions

View File

@ -428,7 +428,7 @@ def main():
default_has_github = registry.get_defaults('has-github', True)
LOCAL_GIT_DIR = registry.get_defaults('local-git-dir', '/var/lib/git')
LOCAL_GIT_DIR = registry.get_defaults('local-git-dir', None)
JEEPYB_CACHE_DIR = registry.get_defaults('jeepyb-cache-dir',
'/var/lib/jeepyb')
ACL_DIR = registry.get_defaults('acl-dir')
@ -547,9 +547,12 @@ def main():
gerrit.replicate(project)
# Create the repo for the local git mirror
create_local_mirror(
LOCAL_GIT_DIR, project_git,
GERRIT_OS_SYSTEM_USER, GERRIT_OS_SYSTEM_GROUP)
if LOCAL_GIT_DIR:
# This is conditional because new gerrit url pathing
# has made local git mirrors less straightfoward.
create_local_mirror(
LOCAL_GIT_DIR, project_git,
GERRIT_OS_SYSTEM_USER, GERRIT_OS_SYSTEM_GROUP)
if acl_config:
acl_sha = acl_cache.get(acl_config)