数据库维护、安全校验和事务逻辑位于 [DatabaseMaintenanceService.cs (line 1)](C:/Users/BI/Documents/EIS-dotnet/src/Eis.Infrastructure/Data/DatabaseMaintenanceService.cs:1)。 内置完整演示数据:1200 名考生、10800 条成绩、2404 条招生记录。 删除旧 import-test-data.mjs 和 reset-dev-database.mjs 运行入口。 Docker 镜像同时包含 Web 和 /app/tools/Eis.Tools.dll。 [package.json (line 11)](C:/Users/BI/Documents/EIS-dotnet/package.json:11) 原数据库命令已改为调用 .NET。 新增统一发布脚本:[publish.ps1 (line 1)](C:/Users/BI/Documents/EIS-dotnet/scripts/publish.ps1:1)。
46 lines
1.3 KiB
PowerShell
46 lines
1.3 KiB
PowerShell
[CmdletBinding()]
|
|
param(
|
|
[string]$OutputDirectory = (Join-Path $PSScriptRoot '..\artifacts\publish')
|
|
)
|
|
|
|
$ErrorActionPreference = 'Stop'
|
|
$repositoryRoot = (Resolve-Path -LiteralPath (Join-Path $PSScriptRoot '..')).Path
|
|
$publishRoot = [IO.Path]::GetFullPath(
|
|
$(if ([IO.Path]::IsPathRooted($OutputDirectory)) {
|
|
$OutputDirectory
|
|
}
|
|
else {
|
|
Join-Path $repositoryRoot $OutputDirectory
|
|
}))
|
|
|
|
$projects = @(
|
|
@{
|
|
Project = Join-Path $repositoryRoot 'src\Eis.Web\Eis.Web.csproj'
|
|
Output = Join-Path $publishRoot 'web'
|
|
},
|
|
@{
|
|
Project = Join-Path $repositoryRoot 'src\Eis.Tools\Eis.Tools.csproj'
|
|
Output = Join-Path $publishRoot 'tools'
|
|
}
|
|
)
|
|
|
|
foreach ($item in $projects) {
|
|
$nativeArgs = @(
|
|
'publish'
|
|
$item.Project
|
|
'--configuration'
|
|
'Release'
|
|
'--output'
|
|
$item.Output
|
|
)
|
|
& dotnet @nativeArgs
|
|
$exitCode = $LASTEXITCODE
|
|
if ($exitCode -ne 0) {
|
|
throw "dotnet publish 失败,退出码:$exitCode"
|
|
}
|
|
}
|
|
|
|
Write-Host "Web 发布目录:$(Join-Path $publishRoot 'web')"
|
|
Write-Host "数据库工具目录:$(Join-Path $publishRoot 'tools')"
|
|
Write-Host "工具示例:dotnet $(Join-Path $publishRoot 'tools\Eis.Tools.dll') database seed --dry-run"
|