From 84c4a5d24cbef536b8248a3d8ff72bb2b4248c29 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Sat, 5 Oct 2013 00:56:26 +0200 Subject: Add test instance of the web site Serve https://www.nagios-plugins.org:444/ from the "test" branch of this repository. --- libexec/post-receive.d/01-git-export | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'libexec/post-receive.d/01-git-export') 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' prefix='/home/plugins' +# +# Check whether the "test" branch of the "site.git" repository has been updated. +# +if [ "${PWD##*/}" = 'site.git' ] +then + forty_zeros=$(printf '%.40d' '0') + + while read old new ref + do + if [ "$ref" = 'refs/heads/test' ] + then + if [ "$new" != "$forty_zeros" ] + then + "$prefix/bin/git-export" -b 'test' "$PWD" + else + rm -rf "$prefix/exported/site-test" + fi + break + fi + done +fi + exec "$prefix/bin/git-export" "$PWD" -- cgit v1.2.3-74-g34f1