fix(ci): staging deploy SSH host to internal IP for Docker runner #1891

Merged
auto-approve-bot merged 2 commits from fix/staging-deploy-ssh-internal-ip into develop 2026-09-14 15:18:31 +08:00
Owner

问题

CI deploy-staging job 跑在 ci-l2 标签的 Docker 容器 runner 上,容器内 127.0.0.1 指向容器自身,无法通过 SSH 连到宿主机 116。之前两次 develop 合并后 CI 都在 deploy-staging 步骤失败。

修复

  • 默认 SSH host 从 127.0.0.1 改为 172.30.18.199(116 宿主机内网 IP,Docker 容器通过 bridge 网络可达)
  • secret STAGING_SSH_HOST 仍可覆盖默认值

验证

  • 已在 116 上启动 ci-base 容器,测试 python socket 连接 172.30.18.199:22 成功
  • port 保持默认 22(宿主机 SSH 默认端口)
## 问题 CI deploy-staging job 跑在 ci-l2 标签的 Docker 容器 runner 上,容器内 127.0.0.1 指向容器自身,无法通过 SSH 连到宿主机 116。之前两次 develop 合并后 CI 都在 deploy-staging 步骤失败。 ## 修复 - 默认 SSH host 从 `127.0.0.1` 改为 `172.30.18.199`(116 宿主机内网 IP,Docker 容器通过 bridge 网络可达) - secret `STAGING_SSH_HOST` 仍可覆盖默认值 ## 验证 - 已在 116 上启动 ci-base 容器,测试 python socket 连接 172.30.18.199:22 成功 - port 保持默认 22(宿主机 SSH 默认端口)
xiaoxia added 1 commit 2026-09-14 14:54:06 +08:00
fix(ci): staging deploy SSH host to internal IP for Docker runner
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 2s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 2s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 28s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 30s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m4s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 2m43s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 3m27s
CI/CD Pipeline / Validate - Style (pull_request) Successful in 4m7s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Successful in 4m36s
AI Code Review / AI Code Review (pull_request) Successful in 6m19s
CI/CD Pipeline / Unit Tests (pull_request) Successful in 8m57s
CI/CD Pipeline / Validate - Security (pull_request) Has been cancelled
CI/CD Pipeline / Build Production API Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Production (pull_request) Has been cancelled
CI/CD Pipeline / Production Browser E2E (pull_request) Has been cancelled
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
CI/CD Pipeline / CI Gate (pull_request) Has been cancelled
PR Automation / Auto Merge on CI Green + Approved (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 48h29m31s
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Failing after 48h29m37s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 48h29m38s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 48h29m40s
CI/CD Pipeline / PR Build Web Image (pull_request) Failing after 48h29m10s
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Failing after 48h29m9s
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Failing after 48h29m9s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 48h29m13s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 48h29m13s
CI/CD Pipeline / Check push changed paths (pull_request) Failing after 48h29m14s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 48h28m59s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 48h28m59s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 48h28m58s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 48h29m10s
0bb94ec74c
ci-l2 runner runs in Docker containers, 127.0.0.1 inside container refers to
the container itself, not the host. Use 172.30.18.199 (host internal IP) which
is reachable from Docker containers via the Docker bridge network.

🚀 预览环境已部署

项目 详情
PR号 #1891
预览链接 https://pr-1891.preview.xiaoxiajianji.com
API环境 staging

💡 预览环境使用 staging API 数据,请勿在预览环境中操作重要数据。

🔄 每次提交新代码后预览环境会自动更新。

🗑️ PR 关闭或合并后,预览环境会自动清理。

🚀 **预览环境已部署** | 项目 | 详情 | |------|------| | PR号 | #1891 | | 预览链接 | [https://pr-1891.preview.xiaoxiajianji.com](https://pr-1891.preview.xiaoxiajianji.com) | | API环境 | staging | > 💡 预览环境使用 staging API 数据,请勿在预览环境中操作重要数据。 > > 🔄 每次提交新代码后预览环境会自动更新。 > > 🗑️ PR 关闭或合并后,预览环境会自动清理。
xiaoxia added 1 commit 2026-09-14 15:05:47 +08:00
chore(ci): keep default 127.0.0.1 for staging SSH (secrets now configured)
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 1s
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 2s
AI Code Review / AI Code Review (pull_request) Successful in 36s
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 42s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 44s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 44s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 52s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m20s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Successful in 1m27s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 3m28s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 3m23s
CI/CD Pipeline / Validate - Style (pull_request) Successful in 4m4s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Successful in 4m52s
CI/CD Pipeline / Unit Tests (pull_request) Successful in 9m4s
CI/CD Pipeline / Validate - Security (pull_request) Successful in 11m56s
CI/CD Pipeline / CI Gate (pull_request) Successful in 1s
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 9m15s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Successful in 6s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 33s
CI/CD Pipeline / Build Production Web Image (pull_request) Failing after 48h5m57s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 48h17m34s
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Failing after 48h17m46s
CI/CD Pipeline / Build Production Worker Image (pull_request) Failing after 48h5m29s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 48h17m12s
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Failing after 48h17m18s
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Failing after 48h17m18s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 48h17m24s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 48h17m24s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 48h17m25s
CI/CD Pipeline / Check push changed paths (pull_request) Failing after 48h17m33s
CI/CD Pipeline / Deploy Production (pull_request) Failing after 48h5m28s
CI/CD Pipeline / Canary Release to Production (pull_request) Failing after 48h5m28s
CI/CD Pipeline / Build Production API Image (pull_request) Failing after 48h5m30s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 48h17m7s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 48h17m6s
aa515ae3a5
The STAGING_SSH_HOST/PORT/USER/KEY secrets are now configured in Gitea
to point to 116 internal IP (172.30.18.199:22), so the default value
doesn't matter as much. Keep 127.0.0.1 for cases where runner runs on
the same host as staging.
auto-approve-bot merged commit 880a7106d4 into develop 2026-09-14 15:18:31 +08:00
auto-approve-bot deleted branch fix/staging-deploy-ssh-internal-ip 2026-09-14 15:18:31 +08:00

🗑️ 预览环境已清理

PR #1891 已关闭或合并,对应的预览环境已被清理。

如有需要,可以重新打开 PR 来重新生成预览环境。

🗑️ **预览环境已清理** PR #1891 已关闭或合并,对应的预览环境已被清理。 > 如有需要,可以重新打开 PR 来重新生成预览环境。
Sign in to join this conversation.