Switch remote deploy to vendored source builds
Move remote deployment to a vendored source bundle built on the target host via Docker so redeploys no longer require local cross-compilation or host Go installation. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -325,11 +325,17 @@ lingma-proxy --backend ipc --transport auto --port 8095
|
||||
|
||||
### 使用 CLI
|
||||
|
||||
macOS:
|
||||
直接从源码运行:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/Lutiancheng1/lingma-proxy.git
|
||||
cd lingma-proxy
|
||||
go run ./cmd/lingma-ipc-proxy --host 127.0.0.1 --port 8095 --session-mode auto
|
||||
```
|
||||
|
||||
只有在你明确需要二进制文件时再构建:
|
||||
|
||||
```bash
|
||||
go build -o ./dist/lingma-proxy ./cmd/lingma-ipc-proxy
|
||||
./dist/lingma-proxy --host 127.0.0.1 --port 8095 --session-mode auto
|
||||
```
|
||||
@@ -343,6 +349,20 @@ cd lingma-proxy
|
||||
.\dist\lingma-proxy.exe --host 127.0.0.1 --port 8095 --session-mode auto
|
||||
```
|
||||
|
||||
### 无 CI 的服务器源码部署
|
||||
|
||||
如果你不想在本地交叉编译 Linux 二进制,可以把 `vendor/` 一起提交,然后让目标服务器直接从源码构建:
|
||||
|
||||
```bash
|
||||
go mod vendor
|
||||
REMOTE_HOST=150.158.105.6 \
|
||||
REMOTE_USER=root \
|
||||
REMOTE_PASSWORD='your-password' \
|
||||
./scripts/deploy-remote.sh
|
||||
```
|
||||
|
||||
脚本会上传 `cmd/`、`internal/`、`vendor/`、`go.mod` 和 `go.sum`,在服务器上准备 Docker 构建上下文,然后用多阶段 Docker build 重建运行时镜像。远端主机需要预装 `docker`、`tar`、`curl`;不需要额外安装宿主机 Go,但如果相关基础镜像未缓存,仍需要能拉取 Docker 基础镜像。
|
||||
|
||||
## 客户端配置
|
||||
|
||||
### Claude Code
|
||||
|
||||
Reference in New Issue
Block a user