fix(ci): use direct IP for SSH deploy to bypass Cloudflare proxy
quant.taxbaik.com -> Cloudflare IP (172.67.x / 104.21.x) Cloudflare does not proxy port 22, causing 'Network is unreachable'. - DEPLOY_HOST: quant.taxbaik.com (app domain, health check URLs) - DEPLOY_SSH_HOST: 178.104.200.7 (direct IP for SSH/SCP)
This commit is contained in:
@@ -11,7 +11,8 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
env:
|
env:
|
||||||
DEPLOY_HOST: quant.taxbaik.com
|
DEPLOY_HOST: quant.taxbaik.com # 앱 도메인 (헬스체크, URL 검증용)
|
||||||
|
DEPLOY_SSH_HOST: 178.104.200.7 # SSH 직접 접속 IP (Cloudflare 우회)
|
||||||
DEPLOY_USER: kjh2064
|
DEPLOY_USER: kjh2064
|
||||||
SERVICE_NAME: quantengine
|
SERVICE_NAME: quantengine
|
||||||
DOTNET_VERSION: '10.0.x'
|
DOTNET_VERSION: '10.0.x'
|
||||||
@@ -113,9 +114,9 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 호스트 키 스캔 (재시도)
|
# 호스트 키 스캔 (재시도) - SSH 직접 IP 사용 (Cloudflare 우회)
|
||||||
for i in 1 2 3; do
|
for i in 1 2 3; do
|
||||||
if ssh-keyscan -t ed25519,rsa -H ${{ env.DEPLOY_HOST }} >> ~/.ssh/known_hosts 2>/dev/null; then
|
if ssh-keyscan -t ed25519,rsa -H ${{ env.DEPLOY_SSH_HOST }} >> ~/.ssh/known_hosts 2>/dev/null; then
|
||||||
echo "✓ Host key added"
|
echo "✓ Host key added"
|
||||||
break
|
break
|
||||||
elif [ $i -lt 3 ]; then
|
elif [ $i -lt 3 ]; then
|
||||||
@@ -126,10 +127,10 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# SSH 연결 테스트
|
# SSH 연결 테스트 - SSH 직접 IP 사용
|
||||||
echo "Testing SSH connection..."
|
echo "Testing SSH connection to ${{ env.DEPLOY_SSH_HOST }}..."
|
||||||
if ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no -i ~/.ssh/id_ed25519 \
|
if ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no -i ~/.ssh/id_ed25519 \
|
||||||
"${{ env.DEPLOY_USER }}@${{ env.DEPLOY_HOST }}" "echo ✓ SSH OK"; then
|
"${{ env.DEPLOY_USER }}@${{ env.DEPLOY_SSH_HOST }}" "echo ✓ SSH OK"; then
|
||||||
echo "✓ SSH connection verified"
|
echo "✓ SSH connection verified"
|
||||||
else
|
else
|
||||||
echo "❌ SSH connection test failed"
|
echo "❌ SSH connection test failed"
|
||||||
@@ -198,6 +199,7 @@ jobs:
|
|||||||
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
|
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
|
||||||
COMMIT=$(git rev-parse --short HEAD)
|
COMMIT=$(git rev-parse --short HEAD)
|
||||||
DEPLOY_HOST="${{ env.DEPLOY_HOST }}"
|
DEPLOY_HOST="${{ env.DEPLOY_HOST }}"
|
||||||
|
DEPLOY_SSH_HOST="${{ env.DEPLOY_SSH_HOST }}"
|
||||||
DEPLOY_USER="${{ env.DEPLOY_USER }}"
|
DEPLOY_USER="${{ env.DEPLOY_USER }}"
|
||||||
|
|
||||||
TELEGRAM_BOT_TOKEN="${{ secrets.TELEGRAM_BOT_TOKEN }}"
|
TELEGRAM_BOT_TOKEN="${{ secrets.TELEGRAM_BOT_TOKEN }}"
|
||||||
@@ -229,10 +231,10 @@ jobs:
|
|||||||
|
|
||||||
echo "=== Deploying QuantEngine $COMMIT ($TIMESTAMP) ==="
|
echo "=== Deploying QuantEngine $COMMIT ($TIMESTAMP) ==="
|
||||||
|
|
||||||
# 원격 디렉토리 생성
|
# 원격 디렉토리 생성 - SSH 직접 IP 사용
|
||||||
echo "📁 Creating remote directories..."
|
echo "📁 Creating remote directories..."
|
||||||
if ! ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no -i ~/.ssh/id_ed25519 \
|
if ! ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no -i ~/.ssh/id_ed25519 \
|
||||||
"$DEPLOY_USER@$DEPLOY_HOST" "mkdir -p /home/kjh2064/tmp"; then
|
"$DEPLOY_USER@$DEPLOY_SSH_HOST" "mkdir -p /home/kjh2064/tmp"; then
|
||||||
echo "❌ Failed to create remote directories"
|
echo "❌ Failed to create remote directories"
|
||||||
notify_failure "Remote directory creation"
|
notify_failure "Remote directory creation"
|
||||||
fi
|
fi
|
||||||
@@ -244,7 +246,7 @@ jobs:
|
|||||||
|
|
||||||
for attempt in 1 2 3; do
|
for attempt in 1 2 3; do
|
||||||
if scp -o ConnectTimeout=10 -o StrictHostKeyChecking=no -i ~/.ssh/id_ed25519 \
|
if scp -o ConnectTimeout=10 -o StrictHostKeyChecking=no -i ~/.ssh/id_ed25519 \
|
||||||
"$SRC" "$DEPLOY_USER@$DEPLOY_HOST:/home/kjh2064/tmp/$DST" 2>&1; then
|
"$SRC" "$DEPLOY_USER@$DEPLOY_SSH_HOST:/home/kjh2064/tmp/$DST" 2>&1; then
|
||||||
echo "✓ Transferred $SRC"
|
echo "✓ Transferred $SRC"
|
||||||
break
|
break
|
||||||
elif [ $attempt -lt 3 ]; then
|
elif [ $attempt -lt 3 ]; then
|
||||||
@@ -257,11 +259,11 @@ jobs:
|
|||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
# 배포 스크립트 실행 (재시도)
|
# 배포 스크립트 실행 (재시도) - SSH 직접 IP 사용
|
||||||
echo "🚀 Running deployment script..."
|
echo "🚀 Running deployment script..."
|
||||||
for attempt in 1 2; do
|
for attempt in 1 2; do
|
||||||
if ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no -i ~/.ssh/id_ed25519 \
|
if ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no -i ~/.ssh/id_ed25519 \
|
||||||
"$DEPLOY_USER@$DEPLOY_HOST" "chmod +x /home/kjh2064/tmp/deploy.sh && CI_DEPLOY=1 /home/kjh2064/tmp/deploy.sh"; then
|
"$DEPLOY_USER@$DEPLOY_SSH_HOST" "chmod +x /home/kjh2064/tmp/deploy.sh && CI_DEPLOY=1 /home/kjh2064/tmp/deploy.sh"; then
|
||||||
echo "✓ Deployment script executed successfully"
|
echo "✓ Deployment script executed successfully"
|
||||||
break
|
break
|
||||||
elif [ $attempt -lt 2 ]; then
|
elif [ $attempt -lt 2 ]; then
|
||||||
@@ -273,10 +275,10 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# 환경 파일 설치
|
# 환경 파일 설치 - SSH 직접 IP 사용
|
||||||
echo "⚙️ Installing environment configuration..."
|
echo "⚙️ Installing environment configuration..."
|
||||||
if ! ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no -i ~/.ssh/id_ed25519 \
|
if ! ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no -i ~/.ssh/id_ed25519 \
|
||||||
"$DEPLOY_USER@$DEPLOY_HOST" "mkdir -p /home/kjh2064/.config && install -m 600 /home/kjh2064/tmp/quantengine.env /home/kjh2064/.config/quantengine.env && rm -f /home/kjh2064/tmp/quantengine.env"; then
|
"$DEPLOY_USER@$DEPLOY_SSH_HOST" "mkdir -p /home/kjh2064/.config && install -m 600 /home/kjh2064/tmp/quantengine.env /home/kjh2064/.config/quantengine.env && rm -f /home/kjh2064/tmp/quantengine.env"; then
|
||||||
echo "❌ Failed to install configuration"
|
echo "❌ Failed to install configuration"
|
||||||
notify_failure "Configuration installation"
|
notify_failure "Configuration installation"
|
||||||
fi
|
fi
|
||||||
@@ -289,7 +291,7 @@ jobs:
|
|||||||
loopback_headers=""
|
loopback_headers=""
|
||||||
for i in 1 2 3; do
|
for i in 1 2 3; do
|
||||||
echo " Health check attempt $i..."
|
echo " Health check attempt $i..."
|
||||||
loopback_headers=$(ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no -i ~/.ssh/id_ed25519 "$DEPLOY_USER@$DEPLOY_HOST" "curl -s -D - -o /dev/null -m 5 http://127.0.0.1:5000/" 2>&1)
|
loopback_headers=$(ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no -i ~/.ssh/id_ed25519 "$DEPLOY_USER@$DEPLOY_SSH_HOST" "curl -s -D - -o /dev/null -m 5 http://127.0.0.1:5000/" 2>&1)
|
||||||
|
|
||||||
if printf '%s' "$loopback_headers" | grep -qE '^HTTP/1\.[01] (200|30[12]) '; then
|
if printf '%s' "$loopback_headers" | grep -qE '^HTTP/1\.[01] (200|30[12]) '; then
|
||||||
echo "✓ Loopback health check passed"
|
echo "✓ Loopback health check passed"
|
||||||
|
|||||||
Reference in New Issue
Block a user