Repack git repos weekly.

Early Sunday mornings, repack all the git repos in gerrit.  This
currently takes 41 seconds for all 32 repositories, so running
it weekly doesn't seem too intensive.

Fixes bug 943623.

Change-Id: Iff0e999c27b428cd1170706e3dc7ede3a1a178a8
This commit is contained in:
James E. Blair 2012-03-08 16:00:43 -08:00
parent 28205b2f3a
commit 5cd947a18c

View File

@ -61,6 +61,15 @@ $commentlinks = [ { name => 'changeid',
command => 'cd /home/gerrit2/openstack-ci && python gerrit/expire_old_reviews.py'
}
cron { "gerrit_repack":
user => gerrit2,
weekday => 0,
hour => 4,
minute => 7,
command => 'find /home/gerrit2/review_site/git/ -type d -name "*.git" -print -exec git --git-dir="{}" repack -afd \;',
environment => "PATH=/usr/bin:/bin:/usr/sbin:/sbin",
}
file { "/var/log/gerrit":
ensure => "directory",
owner => 'gerrit2'