feat(update): 发布双链路更新进度与线上验收审计
This commit is contained in:
+13
@@ -191,6 +191,19 @@ if (-not $skipRepoUpdate) {
|
||||
if (-not (Test-Path ".env")) { Write-Err "未找到 .env,请先执行 start.ps1 完成初始化" }
|
||||
|
||||
# 每次更新都执行版本化、幂等的环境配置迁移;已有非空自定义值保持不变。
|
||||
. (Join-Path $scriptDir "scripts\Initialize-SecurityEnv.ps1")
|
||||
$environmentPath = Join-Path $scriptDir ".env"
|
||||
$environmentContent = Get-Content $environmentPath -Raw -Encoding UTF8
|
||||
if (-not (Get-EnvValue $environmentContent "SYSTEM_UPDATE_MODE")) {
|
||||
& docker inspect easyai-server *> $null
|
||||
$hasServer = $LASTEXITCODE -eq 0
|
||||
& docker inspect easyai-updater *> $null
|
||||
$hasUpdater = $LASTEXITCODE -eq 0
|
||||
if ($hasServer -and -not $hasUpdater) {
|
||||
$environmentContent = Set-EnvValue $environmentContent "SYSTEM_UPDATE_MODE" "legacy_watchtower"
|
||||
[System.IO.File]::WriteAllText($environmentPath, $environmentContent, [System.Text.UTF8Encoding]::new($false))
|
||||
}
|
||||
}
|
||||
& (Join-Path $scriptDir "scripts\Apply-UpdateEnvMigrations.ps1") `
|
||||
-EnvPath (Join-Path $scriptDir ".env") `
|
||||
-ProjectRoot $scriptDir
|
||||
|
||||
Reference in New Issue
Block a user