Skip to content

Commit 15ef7f0

Browse files
tridgeclaude
andcommitted
scripts: stamp git-version.txt before rsync, restart webadmin gunicorn
Two related deploy fixes: - Capture the local 'git rev-parse --short HEAD' into git-version.txt before rsync so the deployed web UI can show the running commit in its footer (the .git directory itself is excluded from rsync). - pkill the webadmin gunicorn alongside udpproxy. start_proxy.sh skips relaunching gunicorn if one's already up, so without this step the new code is rsynced but the old worker keeps serving. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d19a178 commit 15ef7f0

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
*.o
33
set_key
44
udpproxy
5+
git-version.txt
56
libraries/
67
venv/
78
__pycache__/

scripts/update_server.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ fi
3434
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
3535
REPO_ROOT="$( cd "$SCRIPT_DIR/.." && pwd )"
3636

37+
# Stamp the local source tree with the current git short hash so the web
38+
# UI footer can show it on the server (.git/ is excluded from rsync).
39+
git -C "$REPO_ROOT" rev-parse --short HEAD > "$REPO_ROOT/git-version.txt"
40+
3741
# What rsync should NOT transfer. Build artifacts (rebuilt on the server)
3842
# and data files (server-side state we must not overwrite).
3943
RSYNC_EXCLUDES=(
@@ -84,6 +88,11 @@ make all
8488
# pkill -f matches the full argv. We anchor on the bin path so we don't
8589
# accidentally kill anything named "udpproxy" run from elsewhere.
8690
pkill -f "$HOME/UDPProxy/udpproxy" 2>/dev/null || true
91+
# Also kill any running webadmin gunicorn so start_proxy.sh respawns it
92+
# against the freshly-rsynced source. Without this, an existing gunicorn
93+
# keeps serving the old code (start_proxy.sh skips relaunching when one
94+
# is already up).
95+
pkill -f 'webadmin\.wsgi:application' 2>/dev/null || true
8796
sleep 1
8897
./start_proxy.sh
8998
sleep 1

0 commit comments

Comments
 (0)