dco commands will run sequential with single projs
This commit is contained in:
parent
9dca986b74
commit
0b644b7fdd
|
@ -1,6 +1,6 @@
|
|||
[CmdletBinding(SupportsShouldProcess)]param(
|
||||
[ArgumentCompleter({ param (
|
||||
$commandName,
|
||||
[CmdletBinding(SupportsShouldProcess)]param(
|
||||
[ArgumentCompleter({ param (
|
||||
$commandName,
|
||||
$parameterName,
|
||||
$wordToComplete,
|
||||
$commandAst,
|
||||
|
@ -54,7 +54,8 @@ $local:dcPathList = $ProjectPath | ForEach-Object {
|
|||
}
|
||||
}
|
||||
if( -not $dcPathList ) { return }
|
||||
Write-Verbose "$dcPathList"
|
||||
|
||||
$local:SingleProject = $dcPathList.Length -eq 1
|
||||
|
||||
foreach( $local:p in $CliParams ) {
|
||||
if( -not $p ) { continue }
|
||||
|
@ -65,8 +66,8 @@ foreach( $local:p in $CliParams ) {
|
|||
if( $p -isnot [String] -or $p.Length -eq 1 ) {
|
||||
$local:skipFirst = $true
|
||||
switch( $p[0] ) {
|
||||
'&' { $AsJob = $true }
|
||||
'!' { $Wait = $true }
|
||||
'&' { $AsJob = -not $SingleProject }
|
||||
'!' { $Wait = -not $SingleProject }
|
||||
default { $skipFirst = $false }
|
||||
}
|
||||
if( $skipFirst ) { $p = $p | Select-Object -Skip 1 }
|
||||
|
@ -92,10 +93,11 @@ foreach( $local:p in $CliParams ) {
|
|||
|
||||
if( -not $dcParams ) { continue }
|
||||
|
||||
$local:nextActionDescription = "In $dcPath Run $(if($AsJob){"(bg) "})with: $dcParams"
|
||||
if( $WhatIfPreference ) {
|
||||
Write-Host "In $dcPath Run $(if($AsJob){"(bg) "})with: $dcParams"
|
||||
Write-Host -ForegroundColor DarkYellow $nextActionDescription
|
||||
} else {
|
||||
Write-Verbose "& docker-compose --file $dcPath $dcParams"
|
||||
Write-Verbose $nextActionDescription
|
||||
|
||||
if( $AsJob ) {
|
||||
$JobQueue += Start-Job -ArgumentList @($dcPath,$dcParams) -ScriptBlock {
|
||||
|
|
Loading…
Reference in New Issue