fix(deploy): gateway 감지 ip → /proc/net/route (명령어 의존 제거)

최소 Docker 이미지에 ip 명령이 없음. /proc/net/route 파싱으로 대체.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
htlee 2026-03-18 08:35:02 +09:00
부모 db8334b08e
커밋 93cf6d6a25

파일 보기

@ -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"