aboutsummaryrefslogtreecommitdiffstats
path: root/modules/subversion
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2012-12-28 13:55:45 +0000
committerNicolas Vigier <boklm@mageia.org>2012-12-28 13:55:45 +0000
commit715b90b7bba20049ba6ff61eaed1cb6c1b638eb3 (patch)
tree5cdaab241edba25d86e1e2ae87374a8b53d1aca4 /modules/subversion
parent18854eb0a9eaa8bafaffe3bcb190de4e2b771e8d (diff)
downloadpuppet-715b90b7bba20049ba6ff61eaed1cb6c1b638eb3.tar
puppet-715b90b7bba20049ba6ff61eaed1cb6c1b638eb3.tar.gz
puppet-715b90b7bba20049ba6ff61eaed1cb6c1b638eb3.tar.bz2
puppet-715b90b7bba20049ba6ff61eaed1cb6c1b638eb3.tar.xz
puppet-715b90b7bba20049ba6ff61eaed1cb6c1b638eb3.zip
subversion: add irker hook
Diffstat (limited to 'modules/subversion')
-rw-r--r--modules/subversion/manifests/repository.pp19
-rw-r--r--modules/subversion/templates/hook_irker4
-rw-r--r--modules/subversion/templates/irker.conf7
3 files changed, 30 insertions, 0 deletions
diff --git a/modules/subversion/manifests/repository.pp b/modules/subversion/manifests/repository.pp
index 7d9d6265..60846339 100644
--- a/modules/subversion/manifests/repository.pp
+++ b/modules/subversion/manifests/repository.pp
@@ -2,6 +2,9 @@
# group : group that have commit access on the svn
# public : boolean if the svn is readable by anybody or not
# commit_mail : array of people who will receive mail after each commit
+# irker_conf : hash containing irker config values. See man irkerhook
+# for possible values in irker.conf.
+# irkerhook_path : path to irkerhook.py script
# no_binary : do not accept files with common binary extensions
# on this repository
# restricted_to_user : restrict commits to select user
@@ -13,6 +16,8 @@
define subversion::repository($group = 'svn',
$public = true,
$commit_mail = '',
+ $irker_conf = undef,
+ $irkerhook_path = '/usr/lib/irker/irkerhook.py',
$i18n_mail = '',
$no_binary = false,
$restricted_to_user = false,
@@ -81,6 +86,20 @@ define subversion::repository($group = 'svn',
}
+ if $irker_conf {
+ subversion::hook::post_commit { "$name|irker":
+ content => template('subversion/hook_irker'),
+ }
+ file { "$name/irker.conf":
+ content => template('subversion/irker.conf'),
+ }
+ } else {
+ file { "$name/hooks/post-commit.d/irker":
+ ensure => absent,
+ }
+ }
+
+
if $no_binary {
pre_commit_link { "$name/hooks/pre-commit.d/no_binary": }
} else {
diff --git a/modules/subversion/templates/hook_irker b/modules/subversion/templates/hook_irker
new file mode 100644
index 00000000..8fd7a874
--- /dev/null
+++ b/modules/subversion/templates/hook_irker
@@ -0,0 +1,4 @@
+#!/bin/sh
+REPO=$1
+REV=$2
+<%= irkerhook_path %> --repository=$REPO $REV
diff --git a/modules/subversion/templates/irker.conf b/modules/subversion/templates/irker.conf
new file mode 100644
index 00000000..d037a120
--- /dev/null
+++ b/modules/subversion/templates/irker.conf
@@ -0,0 +1,7 @@
+<%-
+ content = ''
+ @irker_conf.keys.sort.each {|key|
+ content += key + ' = ' + @irker_conf[key] + "\n"
+ }
+-%>
+<%= content %>