summaryrefslogtreecommitdiffstats
path: root/libexec/post-receive.d/01-git-export
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2013-10-04 22:56:26 (GMT)
committerHolger Weiss <holger@zedat.fu-berlin.de>2013-10-04 22:56:26 (GMT)
commit84c4a5d24cbef536b8248a3d8ff72bb2b4248c29 (patch)
treeaa5eaf24f84315ea5fa143bf287c9fcf7857391f /libexec/post-receive.d/01-git-export
parent45d3e695be499cf9f9956c223883073fc20d48b4 (diff)
downloadsite-84c4a5d24cbef536b8248a3d8ff72bb2b4248c29.tar.gz
Add test instance of the web site
Serve https://www.nagios-plugins.org:444/ from the "test" branch of this repository.
Diffstat (limited to 'libexec/post-receive.d/01-git-export')
-rwxr-xr-xlibexec/post-receive.d/01-git-export22
1 files changed, 22 insertions, 0 deletions
diff --git a/libexec/post-receive.d/01-git-export b/libexec/post-receive.d/01-git-export
index 37994e2..171f05f 100755
--- a/libexec/post-receive.d/01-git-export
+++ b/libexec/post-receive.d/01-git-export
@@ -19,4 +19,26 @@ export PATH='/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin'
19 19
20prefix='/home/plugins' 20prefix='/home/plugins'
21 21
22#
23# Check whether the "test" branch of the "site.git" repository has been updated.
24#
25if [ "${PWD##*/}" = 'site.git' ]
26then
27 forty_zeros=$(printf '%.40d' '0')
28
29 while read old new ref
30 do
31 if [ "$ref" = 'refs/heads/test' ]
32 then
33 if [ "$new" != "$forty_zeros" ]
34 then
35 "$prefix/bin/git-export" -b 'test' "$PWD"
36 else
37 rm -rf "$prefix/exported/site-test"
38 fi
39 break
40 fi
41 done
42fi
43
22exec "$prefix/bin/git-export" "$PWD" 44exec "$prefix/bin/git-export" "$PWD"