summaryrefslogtreecommitdiffstats
path: root/libexec/post-receive.d/02-build-snapshots
diff options
context:
space:
mode:
Diffstat (limited to 'libexec/post-receive.d/02-build-snapshots')
-rwxr-xr-xlibexec/post-receive.d/02-build-snapshots35
1 files changed, 35 insertions, 0 deletions
diff --git a/libexec/post-receive.d/02-build-snapshots b/libexec/post-receive.d/02-build-snapshots
new file mode 100755
index 0000000..ed8ef77
--- /dev/null
+++ b/libexec/post-receive.d/02-build-snapshots
@@ -0,0 +1,35 @@
1#!/bin/sh
2#
3# Copyright (c) 2013 Nagios Plugins Development Team
4#
5# Originally written by Holger Weiss <holger@zedat.fu-berlin.de>.
6#
7# This file is free software; the Nagios Plugins Development Team gives
8# unlimited permission to copy and/or distribute it, with or without
9# modifications, as long as this notice is preserved.
10#
11# This program is distributed in the hope that it will be useful, but WITHOUT
12# ANY WARRANTY, to the extent permitted by law; without even the implied
13# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
15set -e
16set -u
17
18prefix='/home/plugins'
19repository=${PWD##*/}
20snapshot_repository='nagios-plugins.git'
21snapshot_branches='maint master pu'
22
23if [ "$repository" = "$snapshot_repository" ]
24then
25 while read old new ref
26 do
27 ref=${ref#refs/heads/}
28
29 for head in $snapshot_branches
30 do
31 test "$ref" = "$head" \
32 && exec "$prefix/bin/build-snapshot" "$ref"
33 done
34 done
35fi