summaryrefslogtreecommitdiffstats
path: root/tools/git-post-receive-hook
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2009-11-07 09:40:22 (GMT)
committerHolger Weiss <holger@zedat.fu-berlin.de>2009-11-07 09:40:22 (GMT)
commit2b442ff177751c5ea17e792c10e6d50d7b922b08 (patch)
treebda2e1ef8977c0681e503f66ef9ae56566706a91 /tools/git-post-receive-hook
parentc3e2186b15901579cec17aca22646b9dddf2363f (diff)
downloadmonitoring-plugins-2b442ff177751c5ea17e792c10e6d50d7b922b08.tar.gz
Git commit notifications via post-receive hook
Now that we moved our Git repositories to SourceForge, we don't need to maintain local clones for generating commit notifications anymore, as SourceForge provides shell access to the repositories. Instead, we now run git-notify as a post-receive hook on the SourceForge server. Actually, we use a wrapper which executes git-notify with the desired options and which makes it easy to add other post-receive hooks in the future.
Diffstat (limited to 'tools/git-post-receive-hook')
-rwxr-xr-xtools/git-post-receive-hook23
1 files changed, 23 insertions, 0 deletions
diff --git a/tools/git-post-receive-hook b/tools/git-post-receive-hook
new file mode 100755
index 0000000..70d259e
--- /dev/null
+++ b/tools/git-post-receive-hook
@@ -0,0 +1,23 @@
1#!/bin/sh
2
3prefix="${0%/*}/notifications" # $GIT_DIR/hooks/notifications
4recipient='Nagios Plugin Commits <nagiosplug-checkins@lists.sourceforge.net>'
5maxcommits=100
6maxdiffsize=$((300 * 1024))
7gitweburl='http://nagiosplug.git.sf.net/git/gitweb.cgi?p=nagiosplug'
8gitnotify="$prefix/git-notify.pl"
9statefile="$prefix/git-notify.dat"
10
11exec "$gitnotify" \
12 -m "$recipient" \
13 -n "$maxcommits" \
14 -s "$maxdiffsize" \
15 -t "$statefile" \
16 -u "$gitweburl" \
17 -A \
18 -C \
19 -H \
20 -S \
21 -T \
22 -X \
23 -z