diff options
Diffstat (limited to 'post-receive')
| -rw-r--r-- | post-receive | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/post-receive b/post-receive index 18dedf6..0e92d44 100644 --- a/post-receive +++ b/post-receive @@ -5,18 +5,17 @@ TARGET="/var/www/htdocs/slimegirl.nexus" GIT_DIR="/var/www/pub/git/slimegirl.nexus" -tmpdir=$(mktemp -d) || exit 1 - cleanup() { rm -rf "$tmpdir"; } +trap cleanup EXIT + while read oldrev newrev ref; do - if [ "$ref" = "refs/head/master" ]; then - echo "!!deploying!!" + if [ "$ref" == "refs/heads/master" ]; then + tmpdir=$(mktemp -d) cd $tmpdir git --work-tree=. --git-dir="$GIT_DIR" checkout -f - gmake clean && gmake compress + gmake compress rsync -rcvP --delete out/ "$TARGET" fi done -trap cleanup EXIT |
