Files
wind_power_cal/.agents/skills/cloud-deploy-verify/SKILL.md
T
2026-07-14 15:43:18 +08:00

63 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
name: cloud-deploy-verify
description: 云平台部署与验证流程。用于用户说“部署云平台”“用 deploy_cloud.sh 部署”“部署到云服务器”“云端部署并验证”“发布云平台前端/后端”等场景,默认使用 deploy_cloud.sh 部署到 ubuntu@119.45.4.75 并验证 cloud-server 与关键接口。
---
# 云平台部署与验证
## 何时使用
- 部署云平台
-`deploy_cloud.sh` 部署
- 部署到云服务器
- 云端部署并验证
- 发布云平台前端或后端
## 固定约定
- 部署脚本:`./deploy_cloud.sh`
- 默认目标:`ubuntu@119.45.4.75`
- 默认云平台地址:`http://119.45.4.75`
- systemd 服务:`cloud-server`
- 默认不要加 `--init`;只有用户明确要求初始化、清库、重置云端状态时才使用 `--init`
## 执行流程
1. 在仓库根目录执行部署:
```bash
./deploy_cloud.sh
```
2. 确认脚本完成并输出:
```text
[OK] cloud-server is running
```
3. 验证远端服务状态:
```bash
ssh ubuntu@119.45.4.75 'sudo systemctl is-active cloud-server'
```
4. 验证云平台登录与关键接口:
- 登录接口:`POST http://119.45.4.75/api/auth/login`
- OTA 包列表:`GET http://119.45.4.75/api/admin/edge-upgrades/packages`
- 如果本次改动涉及 OTA 包字段,确认响应包含预期字段,例如 `release_type``description``release_notes`
5. 如果本次改动影响边缘侧 OTA 查询,再验证边缘侧代理透传:
- 先登录边缘侧,例如 87`POST http://192.168.40.87/api/login`
- 再调用:`POST http://192.168.40.87/api/ota/cloud/packages`
- 确认云端字段能透传到边缘侧响应
## 注意
- `deploy_cloud.sh` 会构建云端前端和 `cloud_server`,同步 `runtime/cloud_server/`,迁移/校验 Mosquitto Dynamic Security,并重启 `cloud-server`
- 不要手写云端 rsync/scp/systemctl 流程,优先使用 `deploy_cloud.sh`
- 如果部署失败,先看脚本输出;服务启动失败再查:
```bash
ssh ubuntu@119.45.4.75 'sudo journalctl -u cloud-server --since "5 min ago" --no-pager'
```