From 25ad808e7ef9b0d1d1709d7976a247fc92a3138d Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Sun, 15 Jan 2012 16:24:50 +0000 Subject: add a subversion::hook class, to let us specify custom hook --- modules/subversion/manifests/hook.pp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 modules/subversion/manifests/hook.pp (limited to 'modules/subversion/manifests/hook.pp') diff --git a/modules/subversion/manifests/hook.pp b/modules/subversion/manifests/hook.pp new file mode 100644 index 00000000..c17b4a4c --- /dev/null +++ b/modules/subversion/manifests/hook.pp @@ -0,0 +1,26 @@ +class subversion { + class hook { + define post_commit($content) { + commit_hook { $name: + content => $content, + type => "postcommit", + } + } + define post_commit($content) { + commit_hook { $name: + content => $content, + type => "postcommit", + } + } + + define commit_hook($content, $type) { + $array = split($name,'\|') + $repos = shift($array) + $script = shift($array) + file { "$repo/hook/$type.d/$script": + content => $content, + mode => 755, + } + } + } +} -- cgit v1.2.1