aboutsummaryrefslogtreecommitdiffstats
path: root/modules/git/manifests/svn_repository.pp
diff options
context:
space:
mode:
authorMichael Scherer <misc@mageia.org>2012-03-22 10:47:11 +0000
committerMichael Scherer <misc@mageia.org>2012-03-22 10:47:11 +0000
commit9440cbe275586919e2c10bbf904609938e34f537 (patch)
tree307b860d407976cc6ec5b579517d03acf35c0e9c /modules/git/manifests/svn_repository.pp
parentd4f085e675b8eb72c06f842ecf85951a79ef9c75 (diff)
downloadpuppet-9440cbe275586919e2c10bbf904609938e34f537.tar
puppet-9440cbe275586919e2c10bbf904609938e34f537.tar.gz
puppet-9440cbe275586919e2c10bbf904609938e34f537.tar.bz2
puppet-9440cbe275586919e2c10bbf904609938e34f537.tar.xz
puppet-9440cbe275586919e2c10bbf904609938e34f537.zip
split svn_repository in a separate file
Diffstat (limited to 'modules/git/manifests/svn_repository.pp')
-rw-r--r--modules/git/manifests/svn_repository.pp35
1 files changed, 35 insertions, 0 deletions
diff --git a/modules/git/manifests/svn_repository.pp b/modules/git/manifests/svn_repository.pp
new file mode 100644
index 00000000..93ddb792
--- /dev/null
+++ b/modules/git/manifests/svn_repository.pp
@@ -0,0 +1,35 @@
+define git::svn_repository( $source,
+ $std_layout = true,
+ $refresh = '*/5') {
+ include git::svn
+ include git::server
+ # a cron job
+ # a exec
+ if $std_layout {
+ $options = '-s'
+ } else {
+ $options = ''
+ }
+
+ exec { "/usr/bin/git svn init $options $source $name":
+ alias => "git svn $name",
+ creates => $name,
+ }
+
+ file { '/usr/local/bin/update_git_svn.sh':
+ mode => '0755',
+ source => 'puppet:///modules/git/update_git_svn.sh',
+ }
+
+ cron { "update $name":
+ # done in 2 times, so fetch can fill the repo after init
+ command => "/usr/local/bin/update_git_svn.sh $name" ,
+ minute => $refresh
+ }
+
+ file { "$name/.git/hooks/pre-receive":
+ mode => '0755',
+ content => template('git/pre-receive'),
+ require => Exec["git svn $name"]
+ }
+}