summaryrefslogtreecommitdiffstats
path: root/libexec/post-receive.d
diff options
context:
space:
mode:
Diffstat (limited to 'libexec/post-receive.d')
-rwxr-xr-xlibexec/post-receive.d/01-git-export20
-rwxr-xr-xlibexec/post-receive.d/01-mail-notify39
-rwxr-xr-xlibexec/post-receive.d/02-build-snapshots35
-rwxr-xr-xlibexec/post-receive.d/03-build-docs30
-rwxr-xr-xlibexec/post-receive.d/04-build-web-site33
5 files changed, 157 insertions, 0 deletions
diff --git a/libexec/post-receive.d/01-git-export b/libexec/post-receive.d/01-git-export
new file mode 100755
index 0000000..e16574c
--- /dev/null
+++ b/libexec/post-receive.d/01-git-export
@@ -0,0 +1,20 @@
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'
19
20exec "$prefix/bin/git-export" "$PWD"
diff --git a/libexec/post-receive.d/01-mail-notify b/libexec/post-receive.d/01-mail-notify
new file mode 100755
index 0000000..d5e8b84
--- /dev/null
+++ b/libexec/post-receive.d/01-mail-notify
@@ -0,0 +1,39 @@
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
18test "${PWD##*/}" = 'site.git' && exit 0 # Don't report site.git updates.
19
20prefix=$PWD # $GIT_DIR
21recipient='nagiosplug-checkins@lists.sourceforge.net'
22maxcommits=25
23maxdiffsize=$((300 * 1024))
24gitweburl="FIXME"
25gitnotify='/home/plugins/libexec/git-notify'
26statedir="$prefix/info"
27statefile="$statedir/git-notify.dat"
28
29test -n "$recipient" || exit 0
30
31exec "$gitnotify" \
32 -m "$recipient" \
33 -n "$maxcommits" \
34 -s "$maxdiffsize" \
35 -t "$statefile" \
36 -A \
37 -C \
38 -T \
39 -z
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
diff --git a/libexec/post-receive.d/03-build-docs b/libexec/post-receive.d/03-build-docs
new file mode 100755
index 0000000..1fd7819
--- /dev/null
+++ b/libexec/post-receive.d/03-build-docs
@@ -0,0 +1,30 @@
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##*/}
20doc_repository='nagios-plugins.git'
21doc_branch='master'
22
23if [ "$repository" = "$doc_repository" ]
24then
25 while read old new ref
26 do
27 test "${ref#refs/heads/}" = "$doc_branch" \
28 && exec "$prefix/bin/build-docs"
29 done
30fi
diff --git a/libexec/post-receive.d/04-build-web-site b/libexec/post-receive.d/04-build-web-site
new file mode 100755
index 0000000..68a439c
--- /dev/null
+++ b/libexec/post-receive.d/04-build-web-site
@@ -0,0 +1,33 @@
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##*/}
20web_repositories='nagios-plugins.git site.git'
21web_branch='master'
22
23for web_repository in $web_repositories
24do
25 if [ "$repository" = "$web_repository" ]
26 then
27 while read old new ref
28 do
29 test "${ref#refs/heads/}" = "$web_branch" \
30 && exec "$prefix/bin/build-web-site" >'/dev/null'
31 done
32 fi
33done