1 |
class subversion { |
define subversion::hook($content, $type) { |
2 |
class hook { |
$array = split($name,'\|') |
3 |
define post_commit($content) { |
$repo = $array[0] |
4 |
commit_hook { $name: |
$script = $array[1] |
5 |
content => $content, |
file { "$repo/hooks/$type.d/$script": |
6 |
type => "post-commit", |
content => $content, |
7 |
} |
mode => '0755', |
|
} |
|
|
define pre_commit($content) { |
|
|
commit_hook { $name: |
|
|
content => $content, |
|
|
type => "pre-commit", |
|
|
} |
|
|
} |
|
|
|
|
|
define commit_hook($content, $type) { |
|
|
$array = split($name,'\|') |
|
|
$repo = $array[0] |
|
|
$script = $array[1] |
|
|
file { "$repo/hooks/$type.d/$script": |
|
|
content => $content, |
|
|
mode => 755, |
|
|
} |
|
|
} |
|
8 |
} |
} |
9 |
} |
} |