diff options
Diffstat (limited to 'libexec/post-receive.d')
-rwxr-xr-x | libexec/post-receive.d/01-git-export | 20 | ||||
-rwxr-xr-x | libexec/post-receive.d/01-mail-notify | 39 | ||||
-rwxr-xr-x | libexec/post-receive.d/02-build-snapshots | 35 | ||||
-rwxr-xr-x | libexec/post-receive.d/03-build-docs | 30 | ||||
-rwxr-xr-x | libexec/post-receive.d/04-build-web-site | 33 |
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 | |||
15 | set -e | ||
16 | set -u | ||
17 | |||
18 | prefix='/home/plugins' | ||
19 | |||
20 | exec "$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 | |||
15 | set -e | ||
16 | set -u | ||
17 | |||
18 | test "${PWD##*/}" = 'site.git' && exit 0 # Don't report site.git updates. | ||
19 | |||
20 | prefix=$PWD # $GIT_DIR | ||
21 | recipient='nagiosplug-checkins@lists.sourceforge.net' | ||
22 | maxcommits=25 | ||
23 | maxdiffsize=$((300 * 1024)) | ||
24 | gitweburl="FIXME" | ||
25 | gitnotify='/home/plugins/libexec/git-notify' | ||
26 | statedir="$prefix/info" | ||
27 | statefile="$statedir/git-notify.dat" | ||
28 | |||
29 | test -n "$recipient" || exit 0 | ||
30 | |||
31 | exec "$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 | |||
15 | set -e | ||
16 | set -u | ||
17 | |||
18 | prefix='/home/plugins' | ||
19 | repository=${PWD##*/} | ||
20 | snapshot_repository='nagios-plugins.git' | ||
21 | snapshot_branches='maint master pu' | ||
22 | |||
23 | if [ "$repository" = "$snapshot_repository" ] | ||
24 | then | ||
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 | ||
35 | fi | ||
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 | |||
15 | set -e | ||
16 | set -u | ||
17 | |||
18 | prefix='/home/plugins' | ||
19 | repository=${PWD##*/} | ||
20 | doc_repository='nagios-plugins.git' | ||
21 | doc_branch='master' | ||
22 | |||
23 | if [ "$repository" = "$doc_repository" ] | ||
24 | then | ||
25 | while read old new ref | ||
26 | do | ||
27 | test "${ref#refs/heads/}" = "$doc_branch" \ | ||
28 | && exec "$prefix/bin/build-docs" | ||
29 | done | ||
30 | fi | ||
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 | |||
15 | set -e | ||
16 | set -u | ||
17 | |||
18 | prefix='/home/plugins' | ||
19 | repository=${PWD##*/} | ||
20 | web_repositories='nagios-plugins.git site.git' | ||
21 | web_branch='master' | ||
22 | |||
23 | for web_repository in $web_repositories | ||
24 | do | ||
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 | ||
33 | done | ||