From eea4853a0f0c3ab5c0bf87282474f128f6f5d64d Mon Sep 17 00:00:00 2001 From: Finley Ghosh Date: Mon, 11 Aug 2025 15:15:53 +1000 Subject: [PATCH] Fixing go .env file being incorrect --- deploy/deploy-stg.sh | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/deploy/deploy-stg.sh b/deploy/deploy-stg.sh index e3cef47d..404d5ddf 100755 --- a/deploy/deploy-stg.sh +++ b/deploy/deploy-stg.sh @@ -43,22 +43,25 @@ ssh $SERVER \ # Create .env file for go-app if it doesn't exist ENV_PATH="/home/cmc/$STAGING_DIR/go-app/.env" - if [ ! -f "$ENV_PATH" ]; then - echo "Creating .env file for go-app..." - cat > "$ENV_PATH" <<'ENVEOF' + echo "(Re)creating .env file for go-app..." + cat > "$ENV_PATH" <<'ENVEOF' +# Database configuration +DB_HOST=db +DB_PORT=3306 +DB_USER=cmc +DB_PASSWORD=xVRQI&cA?7AU=hqJ!%au +DB_NAME=cmc + +# Root database password (for dbshell-root) +DB_ROOT_PASSWORD=secureRootPassword + # Environment variables for Go app mail configuration SMTP_HOST="host.docker.internal" SMTP_PORT=1025 SMTP_USER="" SMTP_PASS="" SMTP_FROM="CMC Sales " -DB_HOST="172.17.0.1" -DB_PORT="3306" -DB_USER="cmc" -DB_PASSWORD="xVRQI&cA?7AU=hqJ!%au" -DB_NAME="cmc" ENVEOF - fi if [[ "$USE_CACHE" == "false" ]]; then echo "Building and starting docker compose for staging (no cache)..."