From 35bb51eec4c196252c6b12c9e9be34e89a7b1768 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Wed, 2 Feb 2011 19:38:55 +0000 Subject: place the pre-receive hook in a file, easier to edit --- modules/git/manifests/init.pp | 5 +++-- modules/git/templates/pre-receive | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 modules/git/templates/pre-receive (limited to 'modules/git') diff --git a/modules/git/manifests/init.pp b/modules/git/manifests/init.pp index 1ff21ed3..e32a9642 100644 --- a/modules/git/manifests/init.pp +++ b/modules/git/manifests/init.pp @@ -84,7 +84,8 @@ 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 ) 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" , @@ -96,7 +97,7 @@ class git { owner => root, group => root, mode => 755, - content => "#!/bin/bash\nfalse", + content => template('git/pre-receive'), require => Exec["git svn $name"] } } diff --git a/modules/git/templates/pre-receive b/modules/git/templates/pre-receive new file mode 100644 index 00000000..7eec7505 --- /dev/null +++ b/modules/git/templates/pre-receive @@ -0,0 +1,5 @@ +#!/bin/bash +echo +echo "This repository is readonly" +echo +false -- cgit v1.2.1