feat: 建立三项目可选部署编排 (#154)
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
param(
|
||||
[Parameter(Mandatory = $true)][string]$Manifest,
|
||||
[string[]]$Product = @('all'),
|
||||
[switch]$Json
|
||||
)
|
||||
. (Join-Path $PSScriptRoot 'coordination-common.ps1')
|
||||
|
||||
try {
|
||||
$configuration = Read-CoordinationManifest -Manifest $Manifest
|
||||
$selection = Resolve-CoordinationSelection -Configuration $configuration -Product $Product -Operation status
|
||||
$result = @($selection | ForEach-Object { Get-CoordinationProductStatus -Configuration $configuration -Product $_ })
|
||||
if ($Json) { $result | ConvertTo-Json -Depth 4 } else { $result | Format-Table -AutoSize }
|
||||
if (@($result | Where-Object Status -ne 'running').Count -gt 0) { exit 3 }
|
||||
exit 0
|
||||
} catch {
|
||||
Write-Error $_.Exception.Message
|
||||
exit 1
|
||||
}
|
||||
Reference in New Issue
Block a user