diff --git a/ci/README.md b/ci/README.md index f02b9d9..b8d7bc1 100644 --- a/ci/README.md +++ b/ci/README.md @@ -2,23 +2,26 @@ `ci/check-sql.sh` runs storage checks against SQLite and temporary PostgreSQL and MySQL containers. Run it from the workspace root on an approved remote runner. It removes its test containers and network on exit. +## Automatic deployment + ```mermaid flowchart TD - subgraph cd["main 更新后自动部署"] - M["main 收到提交"] --> W["deploy.yml 在 ces-control 上启动"] - W --> B["build-release.sh 编译发布版"] - B -->|Bedrock 二进制和 Git SHA| R["release.sh 暂存待发布版本"] - R --> P["render-postgres.py 生成私有 bedrock.yaml"] - E["Gitea PostgreSQL Variables 和 Secret"] -->|部署参数| P - P -->|配置就绪| I["临时容器运行 Bedrock,由 Bedrock 初始化 PostgreSQL"] - I -->|成功| S["保存版本并原子切换 current"] - P -->|失败| F["清理暂存目录,保留现有 current"] - I -->|失败| F - end - - subgraph manual["手动 SQL 检查"] - H["在远程 runner 手动运行"] --> C["ci/check-sql.sh 创建临时网络和数据库容器"] - C --> T["测试 SQLite、PostgreSQL 和 MySQL"] - T -->|退出时| U["清理测试容器和临时网络"] - end + M["main 收到提交"] --> W["deploy.yml 在 ces-control 上启动"] + W --> B["build-release.sh 编译发布版"] + B -->|Bedrock 二进制和 Git SHA| R["release.sh 暂存待发布版本"] + R --> P["render-postgres.py 生成私有 bedrock.yaml"] + E["Gitea PostgreSQL Variables 和 Secret"] -->|部署参数| P + P -->|配置就绪| I["临时容器运行 Bedrock,由 Bedrock 初始化 PostgreSQL"] + I -->|成功| S["保存版本并原子切换 current"] + P -->|失败| F["清理暂存目录,保留现有 current"] + I -->|失败| F +``` + +## Manual SQL checks + +```mermaid +flowchart TD + H["在远程 runner 手动运行"] --> C["ci/check-sql.sh 创建临时网络和数据库容器"] + C --> T["测试 SQLite、PostgreSQL 和 MySQL"] + T -->|退出时| U["清理测试容器和临时网络"] ``` diff --git a/deploy/README.md b/deploy/README.md index 6e6e6e2..8da61dc 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -17,23 +17,26 @@ Pull requests currently run without an automatic storage check. The optional `ci Gitea builds a release on `ces-control` when a commit lands on `main`. The deploy step renders the private PostgreSQL configuration and runs the current one-shot Rust storage initializer on the existing `endoleap-dev_default` network. It publishes releases under `/opt/endoleap-infra/bedrock-rust/releases` and switches `/opt/endoleap-infra/bedrock-rust/current` after successful initialization. The Go service retains its own containers and routes. +### Automatic deployment + ```mermaid flowchart TD - subgraph cd["main 更新后自动部署"] - M["main 收到提交"] --> W["deploy.yml 在 ces-control 上启动"] - W --> B["build-release.sh 编译发布版"] - B -->|Bedrock 二进制和 Git SHA| R["release.sh 暂存待发布版本"] - R --> P["render-postgres.py 生成私有 bedrock.yaml"] - E["Gitea PostgreSQL Variables 和 Secret"] -->|部署参数| P - P -->|配置就绪| I["临时容器运行 Bedrock,由 Bedrock 初始化 PostgreSQL"] - I -->|成功| S["保存版本并原子切换 current"] - P -->|失败| F["清理暂存目录,保留现有 current"] - I -->|失败| F - end - - subgraph manual["手动 SQL 检查"] - H["在远程 runner 手动运行"] --> C["ci/check-sql.sh 创建临时网络和数据库容器"] - C --> T["测试 SQLite、PostgreSQL 和 MySQL"] - T -->|退出时| U["清理测试容器和临时网络"] - end + M["main 收到提交"] --> W["deploy.yml 在 ces-control 上启动"] + W --> B["build-release.sh 编译发布版"] + B -->|Bedrock 二进制和 Git SHA| R["release.sh 暂存待发布版本"] + R --> P["render-postgres.py 生成私有 bedrock.yaml"] + E["Gitea PostgreSQL Variables 和 Secret"] -->|部署参数| P + P -->|配置就绪| I["临时容器运行 Bedrock,由 Bedrock 初始化 PostgreSQL"] + I -->|成功| S["保存版本并原子切换 current"] + P -->|失败| F["清理暂存目录,保留现有 current"] + I -->|失败| F +``` + +### Manual SQL checks + +```mermaid +flowchart TD + H["在远程 runner 手动运行"] --> C["ci/check-sql.sh 创建临时网络和数据库容器"] + C --> T["测试 SQLite、PostgreSQL 和 MySQL"] + T -->|退出时| U["清理测试容器和临时网络"] ```