fix(deploy): SSH 호스트를 내부 IP(192.168.1.20)로 고정
signal-batch 프로젝트 패턴과 동일하게 호스트 실제 내부 IP 사용. Docker gateway 감지 방식(ip route, /proc/net/route) 모두 불안정하여 제거. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
부모
5d01b0e6e5
커밋
20b5953dad
@ -85,15 +85,14 @@ jobs:
|
||||
- name: Restart backend via SSH
|
||||
env:
|
||||
DEPLOY_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
|
||||
DEPLOY_HOST: 192.168.1.20
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "$DEPLOY_KEY" > ~/.ssh/id_deploy
|
||||
chmod 600 ~/.ssh/id_deploy
|
||||
# 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-keyscan $DEPLOY_HOST >> ~/.ssh/known_hosts 2>/dev/null || true
|
||||
|
||||
SSH_CMD="ssh -i ~/.ssh/id_deploy -o StrictHostKeyChecking=no root@$DOCKER_HOST_IP"
|
||||
SSH_CMD="ssh -i ~/.ssh/id_deploy -o StrictHostKeyChecking=no root@$DEPLOY_HOST"
|
||||
|
||||
$SSH_CMD bash -s << 'RESTART'
|
||||
set -e
|
||||
|
||||
불러오는 중...
Reference in New Issue
Block a user