fix(deploy): correct env vars, docker compose project names, and workflow outputs

- Standardize environment variable from IS_PROD to PROD across all scripts
- Add missing -p flag to docker compose commands for consistent project naming
- Fix GitHub Actions workflow to use environment vars instead of job outputs
- Consolidate metadata setup and fix artifact naming in build/deploy jobs
- Correct service paths in docker-compose_core.yml
This commit is contained in:
badblocks 2025-06-06 17:26:50 -07:00
parent f20c4f9474
commit 291231c886
No known key found for this signature in database
9 changed files with 104 additions and 70 deletions

View file

@ -2,16 +2,16 @@
set -euo pipefail
# Prepare deployment by stopping containers
# Usage: ./prepare-deployment.sh REPO_PROJECT_PATH IS_PROD CURRENT_LINK_PATH
# Usage: ./prepare-deployment.sh REPO_PROJECT_PATH PROD CURRENT_LINK_PATH
if [ $# -ne 3 ]; then
echo "Error: Invalid number of arguments"
echo "Usage: $0 REPO_PROJECT_PATH IS_PROD CURRENT_LINK_PATH"
echo "Usage: $0 REPO_PROJECT_PATH PROD CURRENT_LINK_PATH"
exit 1
fi
REPO_PROJECT_PATH="$1"
IS_PROD="$2"
PROD="$2"
CURRENT_LINK_PATH="$3"
# Ensure base directory exists
@ -27,15 +27,15 @@ if [ -L "$CURRENT_LINK_PATH" ] && [ -d "$CURRENT_LINK_PATH" ]; then
# Stop containers
if [ -f "docker-compose_web.yml" ]; then
docker compose -f docker-compose_web.yml down || true
docker compose -f docker-compose_web.yml -p pkmntrade-club down || true
fi
if [ "$IS_PROD" = "false" ] && [ -f "docker-compose_staging.yml" ]; then
docker compose -f docker-compose_staging.yml down || true
if [ "$PROD" = "false" ] && [ -f "docker-compose_staging.yml" ]; then
docker compose -f docker-compose_staging.yml -p pkmntrade-club down || true
fi
if [ -f "docker-compose_core.yml" ]; then
docker compose -f docker-compose_core.yml down || true
docker compose -f docker-compose_core.yml -p pkmntrade-club down || true
fi
echo "✅ Containers stopped"