aboutsummaryrefslogtreecommitdiffstats
path: root/deployment/mgagit
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2013-08-22 10:19:59 +0000
committerColin Guthrie <colin@mageia.org>2013-08-22 10:19:59 +0000
commit5fb8bd6d643c7bd7e4889ccba6e312238f7d520a (patch)
treed8c4913d12ac618c795495274e8ce5ec24651dac /deployment/mgagit
parentdd5f4738d6c105ce70e4908858ef3f1efcbead82 (diff)
downloadpuppet-5fb8bd6d643c7bd7e4889ccba6e312238f7d520a.tar
puppet-5fb8bd6d643c7bd7e4889ccba6e312238f7d520a.tar.gz
puppet-5fb8bd6d643c7bd7e4889ccba6e312238f7d520a.tar.bz2
puppet-5fb8bd6d643c7bd7e4889ccba6e312238f7d520a.tar.xz
puppet-5fb8bd6d643c7bd7e4889ccba6e312238f7d520a.zip
mgagit: Gitolite doesn't like the complex hook value, so abstract it to a script.
Diffstat (limited to 'deployment/mgagit')
-rw-r--r--deployment/mgagit/manifests/init.pp4
-rw-r--r--deployment/mgagit/templates/format-commit-email.sh19
-rw-r--r--deployment/mgagit/templates/group_owned_repo.gl2
-rw-r--r--deployment/mgagit/templates/repodef_repo.gl2
4 files changed, 25 insertions, 2 deletions
diff --git a/deployment/mgagit/manifests/init.pp b/deployment/mgagit/manifests/init.pp
index 7f25478b..94024446 100644
--- a/deployment/mgagit/manifests/init.pp
+++ b/deployment/mgagit/manifests/init.pp
@@ -41,6 +41,10 @@ class mgagit(
require => Package['mgagit'],
}
+ mga_common::local_script { 'mgagit-format-commit-email':
+ content => template('mgagit/format-commit-email.sh'),
+ }
+
file { $gitolite_tmpldir:
ensure => directory,
owner => root,
diff --git a/deployment/mgagit/templates/format-commit-email.sh b/deployment/mgagit/templates/format-commit-email.sh
new file mode 100644
index 00000000..f41c3fce
--- /dev/null
+++ b/deployment/mgagit/templates/format-commit-email.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+REV=$1
+if [ -z "$1" ]; then
+ echo "Unknown Commit"
+ exit
+fi
+if [ -z "$GL_REPO" ]; then
+ echo "Cannot find Gitolite Repository"
+ exit
+fi
+
+echo '-----------------------------------------------------------------------'
+echo
+echo "http://gitweb.mageia.org/$GL_REPO/commit/?id=$REV"
+echo
+echo
+git show -C $REV
+echo
diff --git a/deployment/mgagit/templates/group_owned_repo.gl b/deployment/mgagit/templates/group_owned_repo.gl
index b785b55c..bbaaa491 100644
--- a/deployment/mgagit/templates/group_owned_repo.gl
+++ b/deployment/mgagit/templates/group_owned_repo.gl
@@ -23,7 +23,7 @@ repo [% repo %]
[% END -%]
config hooks.emailprefix = "[[% repo %]] "
config hooks.envelopesender = "root@mageia.org"
- config hooks.showrev = "t=%s; echo '-----------------------------------------------------------------------';echo; printf 'http://gitweb.mageia.org/'$GL_REPO'/commit/?id=%%s' $t; echo;echo; git show -C $t; echo"
+ config hooks.showrev = "/usr/local/bin/mgagit-format-commit-email %s"
config gitweb.description = "[% r.repos.$repo.description %]"
[% IF r.users.$maintainer -%]
config gitweb.owner = "[% r.users.$maintainer.cn.0 %] [[% maintainer %]]"
diff --git a/deployment/mgagit/templates/repodef_repo.gl b/deployment/mgagit/templates/repodef_repo.gl
index ceb523e0..883ded33 100644
--- a/deployment/mgagit/templates/repodef_repo.gl
+++ b/deployment/mgagit/templates/repodef_repo.gl
@@ -5,5 +5,5 @@ repo [% repo %]
config hooks.mailinglist = "sysadmin-commits@ml.mageia.org"
config hooks.emailprefix = "[[% repo %]] "
config hooks.envelopesender = "root@mageia.org"
- config hooks.showrev = "t=%s; echo '-----------------------------------------------------------------------';echo; printf 'http://gitweb.mageia.org/'$GL_REPO'/commit/?id=%%s' $t; echo;echo; git show -C $t; echo"
+ config hooks.showrev = "/usr/local/bin/mgagit-format-commit-email %s"
config gitweb.description = "[% r.repos.$repo.description %]"