整理前后端与测试构建目录并完善配置和安全引导
Security Checks / security (push) Waiting to run

统一 frontend、backend、test、test-log 和 out 目录,更新构建、部署及测试入口;纳入配置管理兼容与首次安全引导修复;排除本机配置、密钥和测试产物。
This commit is contained in:
xuans committed 2026-09-05 19:19:52 +08:00
1 parent 28cd9d3406
commit f60d3b0880
603 files changed
+2351 -660

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
param([switch]$SkipFrontend)
$ErrorActionPreference = 'Stop'
$root = Split-Path -Parent $PSScriptRoot
$output = Join-Path $root 'out\backend'
New-Item -ItemType Directory -Path $output -Force | Out-Null
if (-not $SkipFrontend) {
Push-Location (Join-Path $root 'frontend')
try {
& npm.cmd run build
if ($LASTEXITCODE -ne 0) { throw '前端构建失败' }
} finally { Pop-Location }
}
Push-Location (Join-Path $root 'backend')
try {
& go build -o (Join-Path $output 'smail-dev.exe') .
if ($LASTEXITCODE -ne 0) { throw '开发后端构建失败' }
& go build -o (Join-Path $output 'smail-admin.exe') ./cmd/smail-admin
if ($LASTEXITCODE -ne 0) { throw '管理工具构建失败' }
& go build -o (Join-Path $output 'smail-config.exe') ./cmd/smail-config
if ($LASTEXITCODE -ne 0) { throw '配置工具构建失败' }
} finally { Pop-Location }
Write-Output '构建完成:out/frontend 和 out/backend。正式发行请使用 Makefile 的跨平台构建目标。'