67 |
} |
} |
68 |
} |
} |
69 |
|
|
70 |
|
define svn_repository($source, |
71 |
|
$std_layout = true, |
72 |
|
$refresh = '*/5') { |
73 |
|
include git::client |
74 |
|
include git::server |
75 |
|
# a cron job |
76 |
|
# a exec |
77 |
|
if $std_layout { |
78 |
|
$options = "-s" |
79 |
|
} else { |
80 |
|
$options = " " |
81 |
|
} |
82 |
|
|
83 |
|
exec { "/usr/bin/git svn clone $options $source $name": |
84 |
|
creates => $name, |
85 |
|
} |
86 |
|
|
87 |
|
cron { "update $name": |
88 |
|
command => "cd $name && /usr/bin/git svn rebase" , |
89 |
|
minute => $refresh |
90 |
|
} |
91 |
|
# TODO find a way to prevent commit |
92 |
|
file { "$name/.git/hooks/pre-receive": |
93 |
|
ensure => present, |
94 |
|
owner => root, |
95 |
|
group => root, |
96 |
|
mode => 755, |
97 |
|
content => "#!bin/bash\nfalse" |
98 |
|
} |
99 |
|
} |
100 |
|
|
101 |
class client inherits common { |
class client inherits common { |
102 |
|
|
103 |
|
|