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.
This commit is contained in:
parent
618fafe1d5
commit
7ad4c920c6
1 changed files with 8 additions and 1 deletions
|
|
@ -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}"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue