fix(deploy): gateway 감지 ip → /proc/net/route #46

병합
claude-bot hotfix/deploy-gateway 에서 main 로 1 commits 를 머지했습니다 2026-03-18 08:35:17 +09:00

파일 보기

@ -89,8 +89,8 @@ jobs:
mkdir -p ~/.ssh
echo "$DEPLOY_KEY" > ~/.ssh/id_deploy
chmod 600 ~/.ssh/id_deploy
# Docker 컨테이너 → 호스트: services_devnet gateway 경유
DOCKER_HOST_IP=$(ip route | awk '/default/ {print $3}')
# Docker 컨테이너 → 호스트: default gateway (최소 의존)
DOCKER_HOST_IP=$(cat /proc/net/route | awk '$2 == "00000000" {printf "%d.%d.%d.%d", "0x"substr($3,7,2), "0x"substr($3,5,2), "0x"substr($3,3,2), "0x"substr($3,1,2); exit}')
ssh-keyscan $DOCKER_HOST_IP >> ~/.ssh/known_hosts 2>/dev/null || true
SSH_CMD="ssh -i ~/.ssh/id_deploy -o StrictHostKeyChecking=no root@$DOCKER_HOST_IP"