144 lines
3.0 KiB
YAML
144 lines
3.0 KiB
YAML
# Web App - Web应用示例配置
|
|
# 这个示例展示了如何为Web应用配置ZIP安装包
|
|
|
|
name: "WebApp"
|
|
version: "2.1.3"
|
|
description: "A modern web application"
|
|
author: "Web Developer Team"
|
|
license: "MIT"
|
|
|
|
# 构建目标 - 为多个平台生成ZIP包
|
|
targets:
|
|
- platform: "windows"
|
|
arch: "amd64"
|
|
packageType: "zip"
|
|
outputPath: "dist/windows"
|
|
- platform: "linux"
|
|
arch: "amd64"
|
|
packageType: "zip"
|
|
outputPath: "dist/linux"
|
|
- platform: "darwin"
|
|
arch: "amd64"
|
|
packageType: "zip"
|
|
outputPath: "dist/macos"
|
|
|
|
# 文件 - 指定要包含在安装包中的文件
|
|
files:
|
|
# 后端服务
|
|
- source: "bin/server-win.exe"
|
|
destination: "bin/server.exe"
|
|
permissions: "0755"
|
|
platforms: ["windows"]
|
|
- source: "bin/server-linux"
|
|
destination: "bin/server"
|
|
permissions: "0755"
|
|
platforms: ["linux"]
|
|
- source: "bin/server-macos"
|
|
destination: "bin/server"
|
|
permissions: "0755"
|
|
platforms: ["darwin"]
|
|
|
|
# 配置文件
|
|
- source: "config/app.json"
|
|
destination: "config/app.json"
|
|
permissions: "0644"
|
|
- source: "config/database.json"
|
|
destination: "config/database.json"
|
|
permissions: "0644"
|
|
|
|
# 文档
|
|
- source: "README.md"
|
|
destination: "README.md"
|
|
permissions: "0644"
|
|
- source: "docs/api.md"
|
|
destination: "docs/api.md"
|
|
permissions: "0644"
|
|
- source: "docs/deployment.md"
|
|
destination: "docs/deployment.md"
|
|
permissions: "0644"
|
|
|
|
# 目录 - 指定要包含在安装包中的目录
|
|
directories:
|
|
# 前端资源
|
|
- source: "frontend/dist"
|
|
destination: "public"
|
|
permissions: "0755"
|
|
recursive: true
|
|
|
|
# 静态资源
|
|
- source: "assets"
|
|
destination: "assets"
|
|
permissions: "0755"
|
|
recursive: true
|
|
|
|
# 数据目录
|
|
- source: "data"
|
|
destination: "data"
|
|
permissions: "0755"
|
|
recursive: true
|
|
|
|
# 日志目录 (空目录)
|
|
- source: "logs"
|
|
destination: "logs"
|
|
permissions: "0755"
|
|
recursive: true
|
|
|
|
# Web应用特定配置
|
|
plugins:
|
|
webapp:
|
|
# 服务器配置
|
|
server:
|
|
port: 3000
|
|
host: "0.0.0.0"
|
|
ssl: false
|
|
|
|
# 数据库配置
|
|
database:
|
|
type: "postgres"
|
|
migration: "auto"
|
|
|
|
# 前端配置
|
|
frontend:
|
|
spa: true
|
|
apiPath: "/api"
|
|
|
|
# 环境变量
|
|
env:
|
|
NODE_ENV: "production"
|
|
LOG_LEVEL: "info"
|
|
|
|
# 安装前脚本 - 检查依赖和环境
|
|
preInstall:
|
|
path: "scripts/pre-install.js"
|
|
type: "node"
|
|
args: ["--check-env"]
|
|
|
|
# 安装后脚本 - 配置和初始化
|
|
postInstall:
|
|
path: "scripts/post-install.js"
|
|
type: "node"
|
|
args: ["--init-app"]
|
|
|
|
# 依赖项 - Web应用运行所需的依赖
|
|
dependencies:
|
|
- name: "nodejs"
|
|
version: ">=14.0.0"
|
|
type: "runtime"
|
|
- name: "postgresql"
|
|
version: ">=12.0"
|
|
type: "optional"
|
|
|
|
# 启动脚本
|
|
scripts:
|
|
start:
|
|
windows: "bin\\start.bat"
|
|
linux: "bin/start.sh"
|
|
darwin: "bin/start.sh"
|
|
stop:
|
|
windows: "bin\\stop.bat"
|
|
linux: "bin/stop.sh"
|
|
darwin: "bin/stop.sh"
|
|
status:
|
|
windows: "bin\\status.bat"
|
|
linux: "bin/status.sh"
|
|
darwin: "bin/status.sh" |