feat: 增加跨平台打包脚本
This commit is contained in:
+16
-48
@@ -1,58 +1,26 @@
|
||||
# 构建脚本
|
||||
# Build Notes
|
||||
|
||||
## 使用方法
|
||||
Use the root scripts for release builds:
|
||||
|
||||
在项目根目录运行:
|
||||
|
||||
```bash
|
||||
python build/build.py
|
||||
```powershell
|
||||
scripts\build.bat server
|
||||
scripts\build.bat docker
|
||||
scripts\build.bat desktop
|
||||
```
|
||||
|
||||
选择构建类型:
|
||||
- `1` - 完整部署包(MySQL + 应用)
|
||||
- `2` - 更新包(仅应用)
|
||||
On Linux or macOS:
|
||||
|
||||
## 输出
|
||||
|
||||
构建完成后在 `dist/` 目录生成:
|
||||
- `capacity-report-full.tar.gz` - 完整部署包
|
||||
- `capacity-report-update.tar.gz` - 更新包
|
||||
|
||||
## 部署包内容
|
||||
|
||||
**完整部署包**:
|
||||
- `images/capacity-images.tar` - Docker 镜像
|
||||
- `docker-compose.yml` - 编排文件
|
||||
- `deploy.sh` - 部署脚本
|
||||
- `Configure.json` - 配置文件(已更新为 Docker 环境)
|
||||
- `ReportScript.sql` - SQL 脚本
|
||||
- `mysql/` - MySQL 配置
|
||||
|
||||
**更新包**:
|
||||
- `images/capacity-app-update.tar` - 应用镜像
|
||||
- `docker-compose.yml` - 编排文件
|
||||
- `update.sh` - 更新脚本
|
||||
|
||||
## 部署
|
||||
|
||||
**完整部署**:
|
||||
```bash
|
||||
tar -xzf capacity-report-full.tar.gz
|
||||
cd capacity-report-full
|
||||
sh deploy.sh
|
||||
sh scripts/build.sh server
|
||||
sh scripts/build.sh docker
|
||||
sh scripts/build.sh desktop
|
||||
```
|
||||
|
||||
**更新应用**:
|
||||
```bash
|
||||
tar -xzf capacity-report-update.tar.gz
|
||||
cd capacity-report-update
|
||||
sh update.sh
|
||||
```
|
||||
## Targets
|
||||
|
||||
## 配置
|
||||
- `server`: builds a portable server package for the current OS.
|
||||
- `docker`: builds the Docker image and validates the compose file.
|
||||
- `desktop`: builds a Tauri desktop package with the Python server sidecar.
|
||||
- `all`: runs all targets.
|
||||
|
||||
所有配置在 `build/build.py` 文件头部:
|
||||
- 默认镜像版本
|
||||
- 版本要求范围
|
||||
- 数据库账号密码
|
||||
- 端口映射:前端 `19081 -> 9081`
|
||||
Native server and desktop packages must be built on the target OS. Build Windows packages on Windows, Linux packages on Linux, and macOS packages on macOS. Docker images can be built from the Windows development host.
|
||||
|
||||
Reference in New Issue
Block a user