aboutsummaryrefslogtreecommitdiffstats
path: root/deployment/mgagit
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2013-10-07 09:33:07 +0000
committerColin Guthrie <colin@mageia.org>2013-10-07 09:33:07 +0000
commitd5e0dd8658e99769b771da81fa4aeb479dbfb363 (patch)
tree66b1fcedf91beae6330c570d966e371811884bcb /deployment/mgagit
parent10addd5ca6995220ea3a6a00fb5af3cff1f66449 (diff)
downloadpuppet-d5e0dd8658e99769b771da81fa4aeb479dbfb363.tar
puppet-d5e0dd8658e99769b771da81fa4aeb479dbfb363.tar.gz
puppet-d5e0dd8658e99769b771da81fa4aeb479dbfb363.tar.bz2
puppet-d5e0dd8658e99769b771da81fa4aeb479dbfb363.tar.xz
puppet-d5e0dd8658e99769b771da81fa4aeb479dbfb363.zip
mgagit: Import a manually added script on the server side to puppet
Diffstat (limited to 'deployment/mgagit')
-rw-r--r--deployment/mgagit/manifests/init.pp12
-rw-r--r--deployment/mgagit/templates/git-post-update-hook12
2 files changed, 24 insertions, 0 deletions
diff --git a/deployment/mgagit/manifests/init.pp b/deployment/mgagit/manifests/init.pp
index 3ca7225f..f440e7c9 100644
--- a/deployment/mgagit/manifests/init.pp
+++ b/deployment/mgagit/manifests/init.pp
@@ -11,6 +11,8 @@ class mgagit(
$gitolite_keydir = "${gitolite_dir}/keydir"
$gitolite_tmpldir = "/etc/mgagit/tmpl"
$gitolite_confdir = "${gitolite_dir}/conf"
+ $gitolite_hooksdir = "${gitolite_dir}/hooks"
+ $gitolite_commonhooksdir = "${gitolite_hooksdir}/common"
$gitolite_conf = "${gitolite_confdir}/gitolite.conf"
$gitoliterc = "$git_homedir/.gitolite.rc"
$bindpwfile = '/etc/mgagit.secret'
@@ -53,6 +55,15 @@ class mgagit(
content => template('mgagit/git-post-receive-hook'),
}
+ file { "$gitolite_commonhooksdir/post-update":
+ ensure => present,
+ owner => $git_login,
+ group => $git_login,
+ mode => '0755',
+ content => template('mgagit/git-post-update-hook'),
+ require => File[$gitolite_commonhooksdir],
+ }
+
file { $gitolite_tmpldir:
ensure => directory,
owner => root,
@@ -84,6 +95,7 @@ class mgagit(
}
file { [$gitolite_dir, $gitolite_keydir, $gitolite_confdir,
+ $gitolite_hooksdir, $gitolite_commonhooksdir,
$reposconf_dir, $vhostdir]:
ensure => directory,
owner => $git_login,
diff --git a/deployment/mgagit/templates/git-post-update-hook b/deployment/mgagit/templates/git-post-update-hook
new file mode 100644
index 00000000..49cd0a1c
--- /dev/null
+++ b/deployment/mgagit/templates/git-post-update-hook
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+if [ "$GL_REPO" == "infrastructure/repositories/software" -o "$GL_REPO" == "infrastructure/repositories/web" ]; then
+ OK=no
+ (unset GIT_DIR && mgagit glconf && mgagit glrun) >/dev/null 2>&1 && OK=yes
+ if [ "$OK" == "yes" ]; then
+ echo
+ echo " *** Repository definitions updated"
+ echo
+ fi
+fi
+exit 0 \ No newline at end of file