summaryrefslogtreecommitdiff
path: root/scripts/post-receive.sample
diff options
context:
space:
mode:
authorTyler Hoang <tyler@tylerhoang.xyz>2026-06-10 00:28:09 -0700
committerTyler Hoang <tyler@tylerhoang.xyz>2026-06-10 00:28:09 -0700
commita85dc0f4b9148d945fba6b8ef751ed2139e887ab (patch)
tree1f435f79286f86374e28c1a1c3353c62484f6595 /scripts/post-receive.sample
parentd5e321089b6b82f5425c2b3fae142db5223ce599 (diff)
Simplify deploy script and docs
Diffstat (limited to 'scripts/post-receive.sample')
-rwxr-xr-xscripts/post-receive.sample32
1 files changed, 0 insertions, 32 deletions
diff --git a/scripts/post-receive.sample b/scripts/post-receive.sample
deleted file mode 100755
index 3ee898d..0000000
--- a/scripts/post-receive.sample
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-#
-# Sample git post-receive hook for /srv/git/prism-v2.git on the VPS.
-#
-# Install:
-# sudo cp /var/www/prism-v2/scripts/post-receive.sample /srv/git/prism-v2.git/hooks/post-receive
-# sudo chmod +x /srv/git/prism-v2.git/hooks/post-receive
-#
-# Required sudoers entry so the git user can restart services without a password.
-# Adjust GIT_USER if your git is owned by a different account.
-# GIT_USER ALL=(root) NOPASSWD: /var/www/prism-v2/scripts/deploy.sh
-
-set -euo pipefail
-
-BRANCH="master"
-WEB_DIR="/var/www/prism-v2"
-GIT_DIR="/srv/git/prism-v2.git"
-LOG="/var/log/git-deploy.log"
-
-exec >> "$LOG" 2>&1
-
-while read -r oldrev newrev refname; do
- if [ "$refname" = "refs/heads/$BRANCH" ]; then
- echo "$(date -Is): Checking out $BRANCH to $WEB_DIR"
- sudo -u www-data git --work-tree="$WEB_DIR" --git-dir="$GIT_DIR" checkout -f "$BRANCH"
-
- echo "$(date -Is): Running deploy.sh"
- sudo "$WEB_DIR/scripts/deploy.sh"
-
- echo "$(date -Is): Done."
- fi
-done