fix(deploy): 修复组件版本解析和安装升级验收流程
This commit is contained in:
@@ -345,17 +345,31 @@ function Start-Services {
|
||||
$useComposeV2 = $false
|
||||
try { & docker compose version *> $null; if ($LASTEXITCODE -eq 0) { $useComposeV2 = $true } } catch { }
|
||||
|
||||
. (Join-Path $script:Root 'scripts/Initialize-ApplicationVersions.ps1')
|
||||
. (Join-Path $script:Root 'scripts/DeploymentRuntime.ps1')
|
||||
$plan = @(Get-ApplicationVersionPlan -Path (Join-Path $script:Root '.env'))
|
||||
Set-ApplicationVersions -Path (Join-Path $script:Root '.env') -Plan $plan
|
||||
Set-DeploymentReleaseSource -Path (Join-Path $script:Root '.env')
|
||||
Initialize-DeploymentDockerConfig -ProjectRoot $script:Root
|
||||
$composeCommand = if ($useComposeV2) { @('docker','compose') } else { @('docker-compose') }
|
||||
Test-DeploymentStorage -ComposeCommand $composeCommand
|
||||
Test-ApplicationVersionImages -Plan $plan -ComposeCommand $composeCommand
|
||||
Test-DeploymentImages -ComposeCommand $composeCommand
|
||||
if ($useComposeV2) {
|
||||
docker compose pull
|
||||
if ($LASTEXITCODE -ne 0) { Fail "docker compose pull failed." }
|
||||
Test-PulledReleaseImages -ComposeCommand $composeCommand
|
||||
docker compose up -d
|
||||
if ($LASTEXITCODE -ne 0) { Fail "docker compose up failed." }
|
||||
} else {
|
||||
docker-compose pull
|
||||
if ($LASTEXITCODE -ne 0) { Fail "docker-compose pull failed." }
|
||||
Test-PulledReleaseImages -ComposeCommand $composeCommand
|
||||
docker-compose up -d
|
||||
if ($LASTEXITCODE -ne 0) { Fail "docker-compose up failed." }
|
||||
}
|
||||
$timeout = if ($env:DEPLOY_HEALTH_TIMEOUT_SECONDS) { [int]$env:DEPLOY_HEALTH_TIMEOUT_SECONDS } else { 600 }
|
||||
Wait-DeploymentServices -ComposeCommand $composeCommand -TimeoutSeconds $timeout
|
||||
Ok "EasyAI started"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user