fix(Discovery): Add comprehensive debug logging for router initialization
- Add initializer count logging in DiscoveryServiceBootstrapper - Add route structure analysis in RouterSetup - Add request parameter logging in HttpRouter - Update PHP production config for better OPcache handling - Fix various config and error handling improvements
This commit is contained in:
74
deployment/infrastructure/scripts/update-env.sh
Executable file
74
deployment/infrastructure/scripts/update-env.sh
Executable file
@@ -0,0 +1,74 @@
|
||||
#!/bin/bash
|
||||
# Update Production .env.production File
|
||||
# Usage: ./update-env.sh
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(dirname "$(dirname "$SCRIPT_DIR")")"
|
||||
INFRA_DIR="$PROJECT_ROOT/deployment/infrastructure"
|
||||
|
||||
SOURCE_ENV="$PROJECT_ROOT/deployment/applications/environments/.env.production"
|
||||
REMOTE_PATH="/home/deploy/michaelschiemer/shared/.env.production"
|
||||
|
||||
cd "$PROJECT_ROOT"
|
||||
|
||||
echo "🔍 Validating .env.production..."
|
||||
|
||||
if [[ ! -f "$SOURCE_ENV" ]]; then
|
||||
echo "❌ Source .env.production not found at: $SOURCE_ENV"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Validate required variables
|
||||
REQUIRED_VARS=("DB_DRIVER" "DB_HOST" "DB_PORT" "DB_DATABASE" "DB_USERNAME" "DB_PASSWORD")
|
||||
VALIDATION_FAILED=0
|
||||
|
||||
for var in "${REQUIRED_VARS[@]}"; do
|
||||
if ! grep -q "^${var}=" "$SOURCE_ENV"; then
|
||||
echo "❌ Missing required variable: $var"
|
||||
VALIDATION_FAILED=1
|
||||
fi
|
||||
done
|
||||
|
||||
# Check PostgreSQL port
|
||||
if ! grep -q "^DB_PORT=5432" "$SOURCE_ENV"; then
|
||||
echo "⚠️ Warning: DB_PORT should be 5432 for PostgreSQL"
|
||||
read -p "Continue anyway? (y/N): " -n 1 -r
|
||||
echo
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $VALIDATION_FAILED -eq 1 ]]; then
|
||||
echo "❌ Validation failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ Validation passed"
|
||||
echo ""
|
||||
|
||||
echo "📤 Uploading .env.production to production server..."
|
||||
|
||||
ansible web_servers \
|
||||
-i "$INFRA_DIR/inventories/production/hosts.yml" \
|
||||
-m copy \
|
||||
-a "src=$SOURCE_ENV dest=$REMOTE_PATH mode=0644" \
|
||||
--vault-password-file "$INFRA_DIR/.vault_pass"
|
||||
|
||||
echo ""
|
||||
echo "🔄 Restarting containers..."
|
||||
|
||||
ansible web_servers \
|
||||
-i "$INFRA_DIR/inventories/production/hosts.yml" \
|
||||
-m shell \
|
||||
-a "cd /home/deploy/michaelschiemer/current && docker compose restart php web queue-worker" \
|
||||
--vault-password-file "$INFRA_DIR/.vault_pass"
|
||||
|
||||
echo ""
|
||||
echo "✅ .env.production updated and containers restarted!"
|
||||
echo ""
|
||||
echo "🔍 Verify:"
|
||||
echo " curl -I https://michaelschiemer.de"
|
||||
echo " (Should return HTTP/2 200 OK)"
|
||||
Reference in New Issue
Block a user