Files
wecom_it_smart_desk/deploy-server/package-deploy.bat
T
Simon 364e688382 chore(release): v0.5.0-beta 发版准备
主要改动:

backend 业务:
- feat(error-codes): 统一错误码表 E1011/E1012 拆码
  - E1011 AUTH_PASSWORD_WRONG: 本地密码错误
  - E1012 AUTH_FIRST_LOGIN_PASSWORD_REQUIRED: 首次登录请先设置密码
  - E1015 AUTH_OLD_PASSWORD_REQUIRED: 改密需要旧密码
  - E1016 AUTH_OLD_PASSWORD_WRONG: 旧密码错误
- fix(agents): P0 降级放行时,如坐席已注册但未设密码,正确 raise 1012
  (修复前会撞 1011 本地密码错误,与场景不符)
- feat(approval): 审批模块 (T审批/A审批)
- feat(config): approval_template_resource / approval_template_device 配置
- feat(main): /ready, /metrics, /version 端点(K8s 友好)

backend 测试:
- test(agents): 新增 test_agents.py — 3 个 Fix-4 降级登录测试
  - 错误密码拒绝
  - 缺密码拒绝
  - 正确密码通过
  pytest tests/test_agents.py → 3/3 通过
- test(conftest): 模块级 mock + slowapi 限流重置 + UTF-8 patch
  解决 Windows pytest GBK 读 .env 失败 + 降级路径无法测试

仓库治理:
- chore(gitignore): 排除 .workbuddy/memory/(workbuddy 本地记忆)
- chore(docs): 重命名两份 IT 文档(前缀加智能区分版本)

部署与文档:
- docs: RELEASE_NOTES_v0.5.0-beta.md / dashboard.html / 需求-发版预览页面
- docs: 部署、架构、PRD、安全、评审报告等同步 v0.5.0-beta
- deploy-server: 打包脚本、nginx、docker-compose 版本号 bump

前端 (frontend-h5 / frontend-agent / frontend-admin / frontend-portal):
- index.html / package.json 版本号与构建号 bump

自动验收(RELEASE_NOTES L100-104):
- [x] pytest tests/test_agents.py -v → 3 passed
- [x] grep Bs7ucT backend frontend-h5 frontend-agent → 无输出
- [x] grep AppException(101[123]) backend → 仅 1 处(登录场景 1012)
- [ ] npm run build (frontend-h5 / frontend-agent) → 合并后跑

后续: 合并 feature/t-1-t4-merge → main,tag v0.5.0-beta
2026-06-15 14:14:58 +08:00

113 lines
3.1 KiB
Batchfile

@echo off
REM =============================================================================
REM 智能IT支持服务台 — 打包部署脚本(Windows)
REM 目标:生成部署包,通过堡垒机上传到服务器
REM =============================================================================
echo ==========================================
echo 智能IT支持服务台 部署包打包
echo 时间: %date% %time%
echo ==========================================
REM 切换到项目根目录
cd /d "D:\资料\03-项目开发\wecom_it_smart_desk"
REM --------------------------------------------------------------------------
REM 1. 打包后端代码
REM --------------------------------------------------------------------------
echo.
echo ">>> 步骤1: 打包后端代码..."
REM 创建临时目录
if not exist "deploy-temp" mkdir deploy-temp
REM 打包后端(排除 .env、__pycache__、.git 等)
cd backend
tar -cf "../deploy-temp/deploy-backend.tar" ^
--exclude="__pycache__" ^
--exclude="*.pyc" ^
--exclude=".env" ^
--exclude="it_smart_desk.db" ^
--exclude=".venv" ^
app/
alembic/
requirements.txt
Dockerfile
cd ..
echo "后端代码已打包"
REM --------------------------------------------------------------------------
REM 2. 打包前端代码(如果已构建)
REM --------------------------------------------------------------------------
echo.
echo ">>> 步骤2: 打包前端代码..."
REM H5 前端
if exist "frontend-h5\dist" (
cd frontend-h5
tar -cf "../deploy-temp/deploy-h5.tar" dist/
cd ..
echo "H5 前端已打包"
) else (
echo "H5 前端未构建,跳过"
)
REM 坐席前端
if exist "frontend-agent\dist" (
cd frontend-agent
tar -cf "../deploy-temp/deploy-agent.tar" dist/
cd ..
echo "坐席前端已打包"
) else (
echo "坐席前端未构建,跳过"
)
REM 管理后台
if exist "frontend-admin\dist" (
cd frontend-admin
tar -cf "../deploy-temp/deploy-admin.tar" dist/
cd ..
echo "管理后台已打包"
) else (
echo "管理后台未构建,跳过"
)
REM Portal 统一入口
if exist "frontend-portal\dist" (
cd frontend-portal
tar -cf "../deploy-temp/deploy-portal.tar" dist/
cd ..
echo "Portal 已打包"
) else (
echo "Portal 未构建,跳过"
)
REM --------------------------------------------------------------------------
REM 3. 打包部署脚本
REM --------------------------------------------------------------------------
echo.
echo ">>> 步骤3: 打包部署脚本..."
copy deploy-server\deploy.sh deploy-temp\
echo "部署脚本已复制"
REM --------------------------------------------------------------------------
REM 4. 完成
REM --------------------------------------------------------------------------
echo.
echo ==========================================
echo 打包完成!
echo ==========================================
echo.
echo 部署包位置: deploy-temp\
echo.
echo 下一步:
echo 1. 通过堡垒机上传 deploy-temp\ 目录下的所有文件到服务器 /tmp/
echo 2. 在服务器执行: bash /tmp/deploy.sh
echo.
echo 堡垒机信息:
echo 地址: 10.212.189.210:2222
echo 用户: sxn
echo 认证: OTP
echo.