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