fix(deploy): gateway 감지 ip → /proc/net/route #46
@ -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"
|
||||
|
||||
불러오는 중...
Reference in New Issue
Block a user