From 5fb8bd6d643c7bd7e4889ccba6e312238f7d520a Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Thu, 22 Aug 2013 10:19:59 +0000 Subject: mgagit: Gitolite doesn't like the complex hook value, so abstract it to a script. --- deployment/mgagit/manifests/init.pp | 4 ++++ deployment/mgagit/templates/format-commit-email.sh | 19 +++++++++++++++++++ deployment/mgagit/templates/group_owned_repo.gl | 2 +- deployment/mgagit/templates/repodef_repo.gl | 2 +- 4 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 deployment/mgagit/templates/format-commit-email.sh (limited to 'deployment/mgagit') 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 %]" -- cgit v1.2.1