This commit is contained in:
@@ -7,6 +7,37 @@ TIMESTAMP=$(date +%Y%m%d_%H%M%S)
|
||||
|
||||
echo "===== 🚀 TaxBaik Green/Blue Deployment Script ====="
|
||||
|
||||
if [ "${TAXBAIK_DEPLOY_FROM_CI:-}" != "1" ]; then
|
||||
echo "❌ This deployment script may only be run from CI." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -s "$DEPLOY_HOME/taxbaik_active/appsettings.Production.json" ]; then
|
||||
echo "❌ Missing production settings: $DEPLOY_HOME/taxbaik_active/appsettings.Production.json" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -s "$DEPLOY_HOME/taxbaik_active/proxy/TaxBaik.Proxy.dll" ]; then
|
||||
echo "❌ Missing proxy artifact: $DEPLOY_HOME/taxbaik_active/proxy/TaxBaik.Proxy.dll" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 0. Ensure the local TCP proxy exists and is running.
|
||||
# Nginx and external traffic always enter through 127.0.0.1:5001.
|
||||
if ! ss -tln | grep -q ':5001 '; then
|
||||
if [ -f "$DEPLOY_HOME/taxbaik_active/proxy/TaxBaik.Proxy.dll" ]; then
|
||||
echo "=== Starting proxy on 127.0.0.1:5001 ==="
|
||||
cd "$DEPLOY_HOME/taxbaik_active/proxy"
|
||||
nohup /usr/bin/dotnet TaxBaik.Proxy.dll > "$DEPLOY_HOME/taxbaik_proxy.log" 2>&1 &
|
||||
sleep 2
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! ss -tln | grep -q ':5001 '; then
|
||||
echo "❌ Proxy on 127.0.0.1:5001 is not running. Abort deploy." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 1. Determine active port
|
||||
ACTIVE_PORT=5003
|
||||
if [ -f "$PORT_FILE" ]; then
|
||||
|
||||
Reference in New Issue
Block a user