fix(deploy): gateway 감지 ip → /proc/net/route (#46)
Some checks failed
Deploy KCG / deploy (push) Failing after 1m15s

Co-authored-by: htlee <htlee@gcsc.co.kr>
Co-committed-by: htlee <htlee@gcsc.co.kr>
This commit is contained in:
htlee 2026-03-18 08:35:17 +09:00 committed by claude-bot
부모 db8334b08e
커밋 5d01b0e6e5

파일 보기

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