Fixing automated goose script
This commit is contained in:
parent
6668e1af4f
commit
c4d60bc1c9
|
|
@ -39,16 +39,14 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Load goose.env and override the port
|
# Load goose.env and override the port
|
||||||
GOOSE_ENV_FILE="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../go" && pwd)/goose.env"
|
cd go
|
||||||
if [ -f "$GOOSE_ENV_FILE" ]; then
|
if [ -f "goose.env" ]; then
|
||||||
echo "Loading configuration from goose.env..."
|
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
|
# Override the port in GOOSE_DBSTRING
|
||||||
export GOOSE_DBSTRING=$(echo "$GOOSE_DBSTRING" | sed "s/:3306/:$SSH_PORT/")
|
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
|
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
|
pkill -f "ssh.*-L $SSH_PORT:localhost:$DB_PORT" || true
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue