aboutsummaryrefslogtreecommitdiffstats
path: root/modules/subversion/manifests/hook.pp
blob: 8c94f5ad77e87fbc51ead66f197f9d81c23dc522 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
class subversion {
    class hook {
        define post_commit($content) {
            commit_hook { $name:
                content => $content,
                type => "post-commit",
            }
        }
        define pre_commit($content) {
            commit_hook { $name:
                content => $content,
                type => "pre-commit",
            }
        }
  
        define commit_hook($content, $type) {
            $array = split($name,'\|')
            $repos = $array[0]
            $script = $array[1]
            file { "$repo/hook/$type.d/$script":
                content => $content,
                mode => 755,
            }
        }
    }
}