Merge "run git gc instead of repack for git repos"

This commit is contained in:
Jenkins 2016-06-22 16:41:20 +00:00 committed by Gerrit Code Review
commit 266690f348
2 changed files with 11 additions and 4 deletions

View File

@ -415,11 +415,14 @@ class openstack_project::gerrit (
require => Class['::gerrit'], require => Class['::gerrit'],
} }
cron { 'mirror_repack': cron { 'mirror_repack':
ensure => absent,
}
cron { 'mirror_gitgc':
user => 'gerrit2', user => 'gerrit2',
weekday => '0', weekday => '0',
hour => '4', hour => '4',
minute => '7', minute => '7',
command => "find ${local_git_dir} -type d -name \"*.git\" -print -exec git --git-dir=\"{}\" repack -afd \\;", command => "find ${local_git_dir} -type d -name \"*.git\" -print -exec git --git-dir=\"{}\" gc \\;",
environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin', environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin',
} }
} }

View File

@ -118,10 +118,14 @@ class openstack_project::git_backend (
} }
cron { 'mirror_repack': cron { 'mirror_repack':
ensure => absent,
}
cron { 'mirror_gitgc':
user => 'cgit', user => 'cgit',
hour => '4', hour => '4',
minute => '7', minute => '7',
command => 'find /var/lib/git/ -not -path /var/lib/git/zuul -type d -name "*.git" -print -exec git --git-dir="{}" repack -afd \; -exec git --git-dir="{}" pack-refs --all \;', command => 'find /var/lib/git/ -not -path /var/lib/git/zuul -type d -name "*.git" -print -exec git --git-dir="{}" gc \;',
environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin', environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin',
require => User['cgit'], require => User['cgit'],
} }
@ -202,12 +206,12 @@ class openstack_project::git_backend (
ensure => absent, ensure => absent,
} }
cron { 'mirror_repack_zuul': cron { 'mirror_gitgc_zuul':
user => 'zuul', user => 'zuul',
weekday => '0', weekday => '0',
hour => '4', hour => '4',
minute => '7', minute => '7',
command => 'find /var/lib/git/zuul -type d -name "*.git" -print -exec git --git-dir="{}" repack -afd \; -exec git --git-dir="{}" pack-refs --all \;', command => 'find /var/lib/git/zuul -type d -name "*.git" -print -exec git --git-dir="{}" git gc \;',
environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin', environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin',
require => User['zuul'], require => User['zuul'],
} }