在前后端开发联调前 的提交20260223

This commit is contained in:
Neo
2026-02-23 23:02:20 +08:00
parent 254ccb1e77
commit fafc95e64c
1142 changed files with 10366960 additions and 36957 deletions

View File

@@ -1,6 +1,6 @@
# 微信小程序上线清单
> 最后更新2026-02-19
> 最后更新2026-02-20
> 本文档合并自 ENV-MANAGEMENT.md、MINIPROGRAM-RELEASE.md、PRE-TEST-VERIFICATION.md 及补充建议。
> 按优先级从高到低排列,同时兼顾依赖关系(后续步骤依赖前置步骤完成)。
> 每项完成后在状态栏标注完成日期。
@@ -23,32 +23,36 @@
| 状态 | 项目 |
|------|------|
| | 在 Windows Server 上创建目录结构 |
| | 克隆仓库并切换分支 |
| 20260220 | 在 Windows Server 上创建目录结构 |
| 20260220 | 克隆仓库并切换分支 |
| | 配置环境变量文件 |
| | 安装 Python 依赖 |
| | 运行 `setup-server-git.py` 配置 Git 排除规则 |
| | 运行 `init-server-env.ps1` 删除排除文件 + 创建 export 目录 |
在 Windows Server 上执行:
```powershell
# 创建目录
# 创建目录(日志统一放在 repo/export/ 下,随 .env 配置走)
New-Item -ItemType Directory -Path D:\NeoZQYY\test\repo -Force
New-Item -ItemType Directory -Path D:\NeoZQYY\test\logs -Force
New-Item -ItemType Directory -Path D:\NeoZQYY\prod\repo -Force
New-Item -ItemType Directory -Path D:\NeoZQYY\prod\logs -Force
New-Item -ItemType Directory -Path D:\NeoZQYY\scripts -Force
```
> 旧方案在 repo 外单独建 `logs/` 目录,现已废弃。
> 所有运行时输出日志、JSON 导出、报告)统一放在 `repo/export/` 下,
> 路径由 `.env` 中的 `LOG_ROOT`、`EXPORT_ROOT` 等变量控制。
> 详见 [`docs/deployment/EXPORT-PATHS.md`](EXPORT-PATHS.md)。
```powershell
# 克隆仓库
cd D:\NeoZQYY\test
git clone <你的仓库地址> repo
git clone https://git.langlangzhuoqiu.cn/root/Neo-ZQYY.git repo
cd repo
git checkout test
cd D:\NeoZQYY\prod
git clone <你的仓库地址> repo
git clone https://git.langlangzhuoqiu.cn/root/Neo-ZQYY.git repo
cd repo
git checkout master
```
@@ -63,8 +67,17 @@ DB_USER=local-Python
DB_PASSWORD=<密码>
APP_DB_NAME=test_zqyy_app
ETL_DB_NAME=test_etl_feiqiu
PG_NAME=test_etl_feiqiu
PG_DSN=postgresql://<用户>:<密码>@<主机>:5432/test_etl_feiqiu
APP_DB_DSN=postgresql://<用户>:<密码>@<主机>:5432/test_zqyy_app
LOG_LEVEL=DEBUG
# 输出路径(统一放在 repo/export/ 下)
EXPORT_ROOT=D:/NeoZQYY/test/repo/export/ETL-Connectors/feiqiu/JSON
LOG_ROOT=D:/NeoZQYY/test/repo/export/ETL-Connectors/feiqiu/LOGS
FETCH_ROOT=D:/NeoZQYY/test/repo/export/ETL-Connectors/feiqiu/JSON
ETL_REPORT_ROOT=D:/NeoZQYY/test/repo/export/ETL-Connectors/feiqiu/REPORTS
SYSTEM_ANALYZE_ROOT=D:/NeoZQYY/test/repo/export/SYSTEM/REPORTS/dataflow_analysis
BACKEND_LOG_ROOT=D:/NeoZQYY/test/repo/export/BACKEND/LOGS
```
正式环境 `D:\NeoZQYY\prod\repo\.env`
@@ -75,8 +88,17 @@ DB_USER=prod-Python
DB_PASSWORD=<正式密码>
APP_DB_NAME=zqyy_app
ETL_DB_NAME=etl_feiqiu
PG_NAME=etl_feiqiu
PG_DSN=postgresql://<用户>:<密码>@<主机>:5432/etl_feiqiu
APP_DB_DSN=postgresql://<用户>:<密码>@<主机>:5432/zqyy_app
LOG_LEVEL=INFO
# 输出路径(统一放在 repo/export/ 下)
EXPORT_ROOT=D:/NeoZQYY/prod/repo/export/ETL-Connectors/feiqiu/JSON
LOG_ROOT=D:/NeoZQYY/prod/repo/export/ETL-Connectors/feiqiu/LOGS
FETCH_ROOT=D:/NeoZQYY/prod/repo/export/ETL-Connectors/feiqiu/JSON
ETL_REPORT_ROOT=D:/NeoZQYY/prod/repo/export/ETL-Connectors/feiqiu/REPORTS
SYSTEM_ANALYZE_ROOT=D:/NeoZQYY/prod/repo/export/SYSTEM/REPORTS/dataflow_analysis
BACKEND_LOG_ROOT=D:/NeoZQYY/prod/repo/export/BACKEND/LOGS
```
> 正式环境建议使用独立的数据库用户(如 `prod-Python`),权限最小化。
@@ -100,6 +122,16 @@ cd D:\NeoZQYY\prod\repo
python scripts/server/setup-server-git.py
```
```powershell
# 删除排除文件 + 创建 export 目录树test + prod 一次搞定)
cd D:\NeoZQYY
.\test\repo\scripts\server\init-server-env.ps1
# 也可以只初始化单个环境
.\test\repo\scripts\server\init-server-env.ps1 -Envs test
.\prod\repo\scripts\server\init-server-env.ps1 -Envs prod
```
Git 排除方案说明(统一 .gitignore + skip-worktree
三个分支dev / test / master共用同一份 `.gitignore`(宽松版,允许 `.env``export/` 等留存文件提交)。