From 7ad4c920c61315c9554c18230d9ce4dc3d1ed1e5 Mon Sep 17 00:00:00 2001 From: justin Date: Thu, 25 Jun 2026 16:07:47 -0500 Subject: [PATCH] fix(deploy): cd to script's own dir instead of hardcoded /opt/performancewest The dev deploy.sh is an identical copy of prod's, so its hardcoded `cd /opt/performancewest` meant running /opt/performancewest-dev/deploy.sh silently rebuilt and recreated PROD's containers instead of dev's. Resolve the script's real directory (readlink -f handles symlinks/relative paths) so the same tracked script is correct in every clone; docker compose then derives the project name + auto-loads docker-compose.override.yml from that directory, keeping dev (project performancewest-dev) and prod isolated. --- deploy.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/deploy.sh b/deploy.sh index c0a3555..0a05716 100755 --- a/deploy.sh +++ b/deploy.sh @@ -6,7 +6,14 @@ # ./deploy.sh erpnext (rebuild + migrate ERPNext, re-extract assets) # ./deploy.sh api workers (rebuild a custom set) set -euo pipefail -cd /opt/performancewest +# cd to this script's own directory so the deploy operates on the clone it lives +# in. Previously this was hardcoded `cd /opt/performancewest`, which meant +# running /opt/performancewest-dev/deploy.sh silently rebuilt PROD instead of +# dev (the dev script is an identical copy). Resolving the real path makes the +# same script correct in every clone; docker compose then derives the project +# name + auto-loads docker-compose.override.yml from this directory, so dev +# (project performancewest-dev, dev port remaps) and prod stay isolated. +cd "$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" && pwd)" SERVICES="${@:-site api workers proxy-relay listmonk-hc}"