From d4779b549e51a2999a640747525c39f37f41b012 Mon Sep 17 00:00:00 2001 From: lemurianmage Date: Thu, 2 Jul 2026 16:09:38 +0200 Subject: post-receive hook test --- post-receive | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 post-receive (limited to 'post-receive') diff --git a/post-receive b/post-receive new file mode 100644 index 0000000..18dedf6 --- /dev/null +++ b/post-receive @@ -0,0 +1,22 @@ +#!/bin/sh + +# post-receive hook for the webserver + +TARGET="/var/www/htdocs/slimegirl.nexus" +GIT_DIR="/var/www/pub/git/slimegirl.nexus" + +tmpdir=$(mktemp -d) || exit 1 + +cleanup() { rm -rf "$tmpdir"; } + +while read oldrev newrev ref; do + if [ "$ref" = "refs/head/master" ]; then + echo "!!deploying!!" + cd $tmpdir + git --work-tree=. --git-dir="$GIT_DIR" checkout -f + gmake clean && gmake compress + rsync -rcvP --delete out/ "$TARGET" + fi +done + +trap cleanup EXIT -- cgit v1.2.3