From 41684519aa964d08810b55337514f43ed2b4c537 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Wed, 2 Feb 2011 19:38:56 +0000 Subject: - use a script, with a lock , so we can have more than one update running without trouble. Remove older comments in manifests --- modules/git/manifests/init.pp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'modules/git/manifests/init.pp') diff --git a/modules/git/manifests/init.pp b/modules/git/manifests/init.pp index e32a9642..c4847c3b 100644 --- a/modules/git/manifests/init.pp +++ b/modules/git/manifests/init.pp @@ -84,14 +84,21 @@ class git { alias => "git svn $name", creates => $name, } - # TODO what if there is 2 concurents jobs ? - # should we add a lock ( ie, a script + lock file for first sync ) + + file { "/usr/local/bin/update_git_svn.sh": + ensure => present, + owner => root, + group => root, + mode => 755, + source => 'puppet:///modules/git/update_git_svn.sh', + } + cron { "update $name": # done in 2 times, so fetch can fill the repo after init - command => "cd $name && /usr/bin/git svn fetch && /usr/bin/git svn rebase" , + command => "/usr/local/bin/update_git_svn.sh $name" , minute => $refresh } - # TODO find a way to prevent commit + file { "$name/.git/hooks/pre-receive": ensure => present, owner => root, -- cgit v1.2.1