From e0bfe6ed3a854c0cfbd3cbca65268929e12c9226 Mon Sep 17 00:00:00 2001 From: fengruixiang <> Date: Wed, 21 Oct 2026 16:12:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20deploy=20=E4=B8=8D=E5=86=8D=E6=B8=85?= =?UTF-8?q?=E6=8E=89=20iXserver=20=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit robocopy /MIR 把运行时生成的 run\ixserver\Log、Logs 当成多余文件删掉,每次完整部署都丢日志(观察台也就断了内部步骤)。排除这两个目录。 Co-Authored-By: Claude Opus 5.5 --- README.md | 1 + loop.ps1 | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6f89c62..0f5127c 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,7 @@ ssh -N -L 5056:127.0.0.1:5056 -L 5070:127.0.0.1:5070 -L 5080:127.0.0.1:5080 -L 5 `Get-Content` 默认按 GBK 读无 BOM 的 UTF-8(拷配置用 `Copy-Item`,脚本文件一律带 BOM)。 - **iXserver 的主日志在 `run\ixserver\Log\{Debug,Information,Warning,Error}\<日期>\`**(注入的 ILogger,内部步骤很全,观察台就读它)。 `run\data\API_Log` 是静态 `Logger` 写的另一份,几乎是空的,别看它下结论。排查先看 `Log\Error`。 + `deploy` 的 robocopy 排除了 `Log` / `Logs`,重新部署不会清掉日志。 - `deployed.json` 记录每次部署时两个源码仓库的 commit 与未提交文件。闭环结果离开「当时部署的是哪个版本」没法解读, 跑场景的记录里引用它。注意 winbox 上 iXserver 仓库的 HEAD 不随 `sync.sh` 前进(只推文件), `commit` 字段可能停在很久以前,以 `uncommitted` 清单和 Mac 上的提交为准。 diff --git a/loop.ps1 b/loop.ps1 index ee2bb6b..c97f5eb 100644 --- a/loop.ps1 +++ b/loop.ps1 @@ -311,7 +311,8 @@ function Deploy-Ixserver { if ($LASTEXITCODE -ne 0) { throw "iXserver 编译失败,见 $buildLog" } } Write-Step '拷贝 API → run\ixserver' - & robocopy.exe (Join-Path $repo 'API') $Dirs.Ixserver /MIR /XD obj .vs /NFL /NDL /NJH /NJS /NP | Out-Null + # Log / Logs 是运行时生成的(源码里没有),不排除的话 /MIR 每次部署都会把日志当多余文件删掉 + & robocopy.exe (Join-Path $repo 'API') $Dirs.Ixserver /MIR /XD obj .vs Log Logs /NFL /NDL /NJH /NJS /NP | Out-Null if ($LASTEXITCODE -ge 8) { throw "robocopy 失败(退出码 $LASTEXITCODE)" } $global:LASTEXITCODE = 0 foreach ($dll in 'iCON.iXserver.Module.ThirdPartyChatbot.BLL.dll', 'iCON.iXserver.Module.ThirdPartyChatbot.API.dll', 'iCON.iXserver.Module.AI.dll', 'InstagramChatChannel.dll') {