chore: init company-deploy-skills with dokploy-gitea-deploy
This commit is contained in:
104
dokploy-gitea-deploy/references/sequence.md
Normal file
104
dokploy-gitea-deploy/references/sequence.md
Normal file
@@ -0,0 +1,104 @@
|
||||
# 时序
|
||||
|
||||
## 默认:MCP 全链路(业务部署)
|
||||
|
||||
```text
|
||||
用户 Agent company-deploy-mcp Gitea Dokploy
|
||||
│ │ │ │ │
|
||||
│ 部署/上线 │ │ │ │
|
||||
│─────────────────►│ │ │ │
|
||||
│ │ whoami / get_my_quota │ │ │
|
||||
│ │────────────────────────►│ │ │
|
||||
│ │ Dockerfile + 本地校验 │ │ │
|
||||
│ │ ensure_repository │ │ │
|
||||
│ │────────────────────────►│──建库(可选)─────►│ │
|
||||
│ │◄────────────────────────│◄─────────────────│ │
|
||||
│ │ git push(企业凭据) │ │ │
|
||||
│ │───────────────────────────────────────────►│ │
|
||||
│ │ create_deployment_plan │ │ │
|
||||
│ │────────────────────────►│ │ │
|
||||
│ │ apply_deployment_plan │ │ │
|
||||
│ │────────────────────────►│ │ │
|
||||
│ │ │ ensure app │ │
|
||||
│ │ │ mounts (/data+) │ │
|
||||
│ │ │ postgres/mysql? │ │
|
||||
│ │ │ domain buxi+5+LE │ │
|
||||
│ │ │ deploy ──────────┼──────────────►│
|
||||
│ │ │ │ clone/build │
|
||||
│ │ get_deployment_status │ │ run │
|
||||
│ │────────────────────────►│──status──────────┼──────────────►│
|
||||
│ │ 探活 https://buxi…. │ │ │
|
||||
│ 交付 HTTPS 链接 │ │ │ │
|
||||
│◄─────────────────│ │ │ │
|
||||
```
|
||||
|
||||
要点:
|
||||
|
||||
- **建库 / 挂卷 / PG·MySQL / 域名 / deploy** 全在 MCP `apply` 内
|
||||
- **push** 只在 Agent 本机
|
||||
- 业务用户不接触 Gitea / Dokploy / Token
|
||||
|
||||
参数与示例:`mcp-deploy.md`。域名与证书:`domain.md`。
|
||||
|
||||
---
|
||||
|
||||
## 日常二次发布(MCP)
|
||||
|
||||
```text
|
||||
用户 → Agent → git push → create_deployment_plan(新 SHA)
|
||||
→ apply_deployment_plan
|
||||
→ 复用 mapping(域名、卷、库、配额名额)
|
||||
→ 轮询 + 探活
|
||||
```
|
||||
|
||||
- 同一 `repo` + `environment`:**不新建** Dokploy 应用名额
|
||||
- 域名 host **不变**
|
||||
- 数据卷 **不变**(应用须写在挂载路径)
|
||||
- plan 一次性;每次发布新建 plan
|
||||
|
||||
---
|
||||
|
||||
## Legacy:直连 Dokploy(运维例外)
|
||||
|
||||
```text
|
||||
用户 Agent Gitea Dokploy
|
||||
│ │ │ │
|
||||
│ 明确要求直连 │ │ │
|
||||
│───────────────────►│ source .env.deploy │ │
|
||||
│ │ Dockerfile │ │
|
||||
│ │ 建仓+git push │ │
|
||||
│ │────────────────────►│ │
|
||||
│ │ application.* │ │
|
||||
│ │ mounts / domain │ │
|
||||
│ │ application.deploy │ │
|
||||
│ │──────────────────────────────────────────►│
|
||||
│ │ 轮询 + 探活 │ │
|
||||
│◄───────────────────│ │ │
|
||||
```
|
||||
|
||||
仅当 MCP 不可用且有 `.env.deploy` + `DEPLOY_AUTHORIZED=true`。
|
||||
默认对话 **不要** 走这条。
|
||||
|
||||
---
|
||||
|
||||
## 责任边界
|
||||
|
||||
| 角色 | MCP 路径 | Legacy 路径 |
|
||||
|------|----------|-------------|
|
||||
| 用户 | 飞书登录拿 `buxi_`;说「部署」 | 提供/保管 `.env.deploy`(运维) |
|
||||
| Agent | 工程 + push + 调 MCP 工具 + 交付 URL | 工程 + push + 直调 Dokploy API |
|
||||
| company-deploy-mcp | 身份/配额/审计/Gitea 建库/Dokploy 编排 | — |
|
||||
| Gitea | 源码 | 源码 |
|
||||
| Dokploy | 构建运行/卷/库/Traefik+LE | 同左(Agent 直调) |
|
||||
|
||||
---
|
||||
|
||||
## 异步语义
|
||||
|
||||
| 动作 | 含义 |
|
||||
|------|------|
|
||||
| `apply_deployment_plan` 返回 200 | 已受理编排与 deploy 请求 |
|
||||
| `deploymentRequested: true` | 不等于用户已可稳定访问 |
|
||||
| 上线完成 | Dokploy 部署终态成功 +(Web)HTTPS 探活通过 |
|
||||
|
||||
构建失败:`get_deployment_status` / `get_sanitized_logs`,修代码或 Dockerfile 后新 SHA 再 plan+apply。
|
||||
Reference in New Issue
Block a user