docs(update-workflow): 以 B 路线检测替代 admin:stack:mode

This commit is contained in:
augushong
2026-07-22 01:05:23 +08:00
parent bb602dccda
commit 560e0f6a5e
3 changed files with 14 additions and 12 deletions

View File

@@ -25,12 +25,12 @@ description: "指导 AI agent 协助开发者使用 php think admin:update 同
### 3.1 确认执行模式
```bash
php think admin:stack:mode current
```
通过仓库结构判断执行模式B-route 检测方式):
- 如果返回 Docker 模式(具体哪些模式属于 Docker 模式见 `php think admin:stack:mode list``source/stack/stack.json`),后续所有 `php think` 命令前缀改为 `docker compose exec ulthon_admin`
- Docker 模式直接执行 `php think`,不做转换
- **default 模式(宿主机直接执行)**:仓库根目录**没有** `docker-compose.yaml``source/stack/` 目录不存在或为空。所有 `php think` 命令直接在宿主机执行,不做转换。
- **Docker 模式(需容器前缀)**:仓库根目录**存在** `docker-compose.yaml`,或 `source/stack/<mode>/` 目录下存在 Docker 编排文件。所有 `php think` 命令前缀改为 `docker compose exec ulthon_admin`
> 可用 `Get-ChildItem source\stack -Directory`PowerShell或 `ls source/stack/`Linux列出 `source/stack/` 下的所有 mode 子目录;纯文档性质的 `source/stack/stack.json` 仅作历史参考,不再作为权威依据。
### 3.2 确认代码已提交
@@ -253,6 +253,6 @@ php think admin:version
- **更新前务必确保代码已提交**:未提交的改动可能在更新过程中丢失
- **不自动执行 composer 或数据库操作**:这些操作影响面大,需开发者确认
- **大版本跳跃风险更高**:跨越多个 tag 时变更量大,建议格外谨慎,仔细审查 dry-run 输出
- **Docker 模式注意**Docker 模式下所有 `php think` 命令前缀改为 `docker compose exec ulthon_admin`具体哪些模式属于 Docker 模式见 `php think admin:stack:mode list``source/stack/stack.json`
- **Docker 模式注意**Docker 模式下所有 `php think` 命令前缀改为 `docker compose exec ulthon_admin`判断方式见 3.1 节:仓库根目录有 `docker-compose.yaml``source/stack/<mode>/` 下有编排文件即为 Docker 模式
- **更新会临时占用磁盘**:命令会在 `runtime/update/` 下克隆上游仓库进行对比,完成后自动清理
- **版本更新说明**:更新完成后,命令会输出跨版本的更新说明(来自 `adminUpdateData/tips.php`),提醒开发者关注

8
.dockerignore Normal file
View File

@@ -0,0 +1,8 @@
.git
.gitignore
runtime
node_modules
*.sock
.docker-dev-sync
.docker-dev.env
source/stack/

View File

@@ -1,6 +0,0 @@
.git
.sisyphus
node_modules
runtime
docker-dev
*.sock