From bd6413d1bb7b7a57e484355bf9f3801cea88a6a0 Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Sat, 15 Oct 2016 09:48:10 -0400 Subject: [PATCH] Preform housekeeping on git repos cloned by DIB Over time out git repos get large and require some upkeep. Ideally this should be done in the source-repositories element. We can revert this code once we have landed that upstream. Change-Id: I6b9ecd4448d97b5ab2bf3808ff36ff4e74be72e4 Signed-off-by: Paul Belanger --- manifests/site.pp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/manifests/site.pp b/manifests/site.pp index 09d8e80057..d0cb88edd6 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -769,6 +769,8 @@ node 'status.openstack.org' { # Node-OS: trusty node 'nodepool.openstack.org' { + # TODO(pabelanger): Move all of this back into nodepool manifest, it has + # grown too big. $bluebox_username = hiera('nodepool_bluebox_username', 'username') $bluebox_password = hiera('nodepool_bluebox_password') $bluebox_project = hiera('nodepool_bluebox_project', 'project') @@ -851,6 +853,15 @@ node 'nodepool.openstack.org' { content => hiera('infracloud_chocolate_ssl_cert_file_contents'), require => Class['::openstackci::nodepool'], } + + cron { 'mirror_gitgc': + user => 'nodepool', + hour => '20', + minute => '0', + command => 'find /opt/dib_cache/source-repositories/ -type d -name "*.git" -exec git --git-dir="{}" gc \; >/dev/null', + environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin', + require => Class['::openstackci::nodepool'], + } } # Node-OS: trusty