From 9440cbe275586919e2c10bbf904609938e34f537 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Thu, 22 Mar 2012 10:47:11 +0000 Subject: split svn_repository in a separate file --- modules/git/manifests/init.pp | 39 +-------------------------------- modules/git/manifests/svn_repository.pp | 35 +++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 38 deletions(-) create mode 100644 modules/git/manifests/svn_repository.pp (limited to 'modules/git') diff --git a/modules/git/manifests/init.pp b/modules/git/manifests/init.pp index 46760af3..dece14f0 100644 --- a/modules/git/manifests/init.pp +++ b/modules/git/manifests/init.pp @@ -1,38 +1 @@ -class git { - define 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"] - } - } - -} +class git { } 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"] + } +} -- cgit v1.2.1