Files
qipai/docs/git-deployment.md

61 lines
2.4 KiB
Markdown
Raw Permalink 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.
# Git 与部署流
## 固定仓库
- Windows/WSL SSH`ssh://git@git.txyundm.cn:2222/panda/qipai.git`
- 生产同机只读 SSH`ssh://git@127.0.0.1:2222/panda/qipai.git`
- 默认分支:`main`
## 本地推送
1.`D:\qipai` 完成一个模块子阶段。
2. 运行 Windows 检查脚本。
3. 提交本模块相关文件。
4. 执行 `git push origin main`
5. 执行 `git fetch origin main` 并校验 `HEAD == origin/main`
推荐使用:
```powershell
powershell -ExecutionPolicy Bypass -File scripts/dev/windows/push-module.ps1 `
-Message "chore(M00-C): 完善模块推送脚本" `
-Paths @("scripts/dev/windows/push-module.ps1", "docs/git-deployment.md")
```
如出现 `Host key verification failed`,先通过可信渠道确认 `git.txyundm.cn:2222` 的 SSH 主机指纹,再更新 `known_hosts`。Codex 不自动覆盖主机信任记录。
## SSH 检查
```powershell
powershell -ExecutionPolicy Bypass -File scripts/dev/windows/check-gitea-ssh.ps1
```
该脚本只检查已有 known_hosts 与 SSH 握手,不自动写入新主机指纹。
## 当前记录
- 2026-06-15 首次 `origin/main` push 已成功,且 `HEAD == origin/main` 校验通过。
- 如后续再次出现 `Host key verification failed`,仍应先通过可信渠道确认主机指纹,不自动追加或覆盖 known_hosts。
## 生产发布
生产服务器不得因 Gitea push 自动发布。管理员必须在 Ubuntu 上通过 `/opt/apps/setup.sh` 菜单拉取、构建、迁移和复检。
## 域名与证书
- Nginx 模板位于 `deploy/nginx/api.txyundm.cn.conf.template`
- Certbot 管理员命令说明位于 `deploy/certbot/api.txyundm.cn.commands.md`
- `setup.sh --https` 仅检查域名、Nginx、TLS、健康端点和 Certbot 状态,不自动申请证书或 reload Nginx。
## EMQX
- EMQX 安装说明位于 `deploy/emqx/install-ubuntu24-amd64.md`
- ACL 模板位于 `deploy/emqx/acl.conf.template`,授权配置模板位于 `deploy/emqx/authorization.hocon.template`
- `setup.sh --mqtt` 仅检查 EMQX 命令、服务、端口和模板状态,不自动安装或写入 `/etc/emqx`
## Backup And Restore
- 备份策略模板位于 `deploy/backup/backup-policy.template.json`
- 备份/恢复 runbook 位于 `deploy/backup/backup-restore-runbook.md`
- `setup.sh --backup-status` 仅检查工具、目录和模板状态,不自动导出 MySQL、EMQX 或上传文件。