From 55d66d5d9ba7965a4c501310cdfa87f7325813ac Mon Sep 17 00:00:00 2001 From: Codex Bot Date: Mon, 30 Nov 2026 01:17:13 +0800 Subject: [PATCH] Embed the deployment flow in deployment and CI docs --- ci/README.md | 5 ++ deploy/README.md | 2 + deploy/bedrock-deployment.svg | 105 ++++++++++++++++++++++++++++++++++ 3 files changed, 112 insertions(+) create mode 100644 ci/README.md create mode 100644 deploy/bedrock-deployment.svg diff --git a/ci/README.md b/ci/README.md new file mode 100644 index 0000000..ddef802 --- /dev/null +++ b/ci/README.md @@ -0,0 +1,5 @@ +# Manual SQL verification + +`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. + +![Bedrock deployment and manual SQL verification flow](../deploy/bedrock-deployment.svg) diff --git a/deploy/README.md b/deploy/README.md index fb57ebb..b7f1139 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -13,3 +13,5 @@ Pull requests currently run without an automatic storage check. The optional `ci ## Release on the existing deployment host 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. + +![Bedrock deployment and manual SQL verification flow](./bedrock-deployment.svg) diff --git a/deploy/bedrock-deployment.svg b/deploy/bedrock-deployment.svg new file mode 100644 index 0000000..59c165d --- /dev/null +++ b/deploy/bedrock-deployment.svg @@ -0,0 +1,105 @@ + +Bedrock 的部署与手动验证流程 +main 提交触发 Gitea CD。release.sh 调用配置渲染器并启动临时容器。容器内 Rust Bedrock 初始化已有 PostgreSQL 数据库中的 Bedrock 表。另有独立手动检查路径。 + + + + + + + + + + + + + +BEDROCK / DEPLOYMENT +Bedrock 的部署与手动验证流程 +CD · 原部署机 +手动验证 + + + + + + + + + + + + + + + + +main 收到提交 + +deploy.yml +Gitea 在 ces-control 上检出代码并编排部署。 + +build-release.sh +在 Rust 容器内编译 release,输出 Bedrock 二进制。 +二进制路径与 Git SHA 交给发布脚本 + +release.sh +建立暂存目录,放入二进制。 + +Gitea 部署配置 +PostgreSQL Variables +和密码 Secret + +render-postgres.py +由 release.sh 调用,生成权限为 0600 的 bedrock.json。 + +release.sh 启动临时容器 +挂载二进制和配置,运行 Rust bedrock。 + + +Rust Bedrock 读取配置 +通过 db_connection 选择 postgres。 +配置由 BEDROCK_DB_CONFIG 指定。 + +在已有 PostgreSQL 数据库内初始化 +postgres 提供 SQL,persistence 在事务里执行。 +创建 Bedrock 表并登记 production 部署。 +进入 Store::initialize() +成功 +失败 + + +保存版本并切换 current + +清理暂存目录,保留上一版 current + +手动运行 + +ci/check-sql.sh +脚本独立于部署工作流。 + +准备隔离环境 +启动临时 PostgreSQL 和 MySQL。 +SQLite 使用临时本地文件。 + +运行三库检查 +执行格式检查、测试、构建, +验证 SQLite 默认启动。 + +退出时清理 +删除测试容器和临时网络。 + \ No newline at end of file