Merge pull request 'fix(deploy): SSH 연결 재시도 로직' (#58) from develop into main
Some checks failed
Deploy KCG / deploy (push) Failing after 1m9s

This commit is contained in:
htlee 2026-03-18 10:00:19 +09:00
커밋 5ce172eb82

파일 보기

@ -92,7 +92,21 @@ jobs:
chmod 600 ~/.ssh/id_deploy
ssh-keyscan -T 5 $DEPLOY_HOST >> ~/.ssh/known_hosts 2>/dev/null || true
SSH_CMD="ssh -i ~/.ssh/id_deploy -o StrictHostKeyChecking=no -o ConnectTimeout=10 root@$DEPLOY_HOST"
SSH_CMD="ssh -i ~/.ssh/id_deploy -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ServerAliveInterval=15 root@$DEPLOY_HOST"
# SSH 연결 테스트 (최대 3회, kex_exchange 거부 대응)
for attempt in 1 2 3; do
echo "SSH connectivity test $attempt/3..."
if $SSH_CMD echo "SSH OK"; then
break
fi
if [ "$attempt" -eq 3 ]; then
echo "ERROR: SSH connection failed after 3 attempts"
exit 1
fi
echo "SSH failed, retrying in 10s..."
sleep 10
done
$SSH_CMD bash -s << 'RESTART'
DEPLOY_DIR=/devdata/services/kcg/backend