From 211c52e9623afafbe787c9327a026d767e22a6b5 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Wed, 2 Feb 2011 19:38:47 +0000 Subject: draft of a git svn define --- modules/git/manifests/init.pp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'modules/git/manifests/init.pp') diff --git a/modules/git/manifests/init.pp b/modules/git/manifests/init.pp index 1853ab94..dee9fb86 100644 --- a/modules/git/manifests/init.pp +++ b/modules/git/manifests/init.pp @@ -67,6 +67,37 @@ class git { } } + define svn_repository($source, + $std_layout = true, + $refresh = '*/5') { + include git::client + include git::server + # a cron job + # a exec + if $std_layout { + $options = "-s" + } else { + $options = " " + } + + exec { "/usr/bin/git svn clone $options $source $name": + creates => $name, + } + + cron { "update $name": + command => "cd $name && /usr/bin/git svn rebase" , + minute => $refresh + } + # TODO find a way to prevent commit + file { "$name/.git/hooks/pre-receive": + ensure => present, + owner => root, + group => root, + mode => 755, + content => "#!bin/bash\nfalse" + } + } + class client inherits common { -- cgit v1.2.1