From c4d60bc1c950128166eecebea32f68cc5b7d18ed Mon Sep 17 00:00:00 2001 From: Finley Ghosh Date: Sun, 7 Dec 2025 16:21:46 +1100 Subject: [PATCH] Fixing automated goose script --- scripts/deploy/scripts/run_migrations.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/deploy/scripts/run_migrations.sh b/scripts/deploy/scripts/run_migrations.sh index 9d4933de..d7da305b 100755 --- a/scripts/deploy/scripts/run_migrations.sh +++ b/scripts/deploy/scripts/run_migrations.sh @@ -39,16 +39,14 @@ else fi # Load goose.env and override the port -GOOSE_ENV_FILE="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../go" && pwd)/goose.env" -if [ -f "$GOOSE_ENV_FILE" ]; then +cd go +if [ -f "goose.env" ]; then echo "Loading configuration from goose.env..." - export $(grep -v '^#' "$GOOSE_ENV_FILE" | xargs) + export $(grep -v '^#' goose.env | xargs) # Override the port in GOOSE_DBSTRING export GOOSE_DBSTRING=$(echo "$GOOSE_DBSTRING" | sed "s/:3306/:$SSH_PORT/") - # Make migration dir absolute - export GOOSE_MIGRATION_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../go" && pwd)/$GOOSE_MIGRATION_DIR" else - echo "ERROR: goose.env file not found at $GOOSE_ENV_FILE" + echo "ERROR: goose.env file not found" pkill -f "ssh.*-L $SSH_PORT:localhost:$DB_PORT" || true exit 1 fi