DockerCompose commands refactoring

All dc... commands are now based on Invoke-DockerCompose.
dco is aliased to Invoke-DockerCompose.
dco_ is aliased to the docker-compose binary.
'&' and '!' shorthand introduced to dco to execut in bg as job and wait
for all bg jobs to complete respectively.
This commit is contained in:
lksz 2021-01-15 01:15:54 -05:00
parent c453e5bdea
commit dcc9113cda
13 changed files with 172 additions and 70 deletions

View file

@ -10,9 +10,11 @@
})]
[string[]]$ProjectPath=@($PWD),
[Parameter(Position = 0, ValueFromRemainingArguments = $true)]
[string[]]$CliParams
[array]$CliParams=@('--timeout=3','--volumes','--remove-orphans')
)
$ProjectPath | ForEach-Object {
docker-compose --file $(Resolve-Path $(Join-Path $_ docker-compose.yml)) down --timeout=3 --volumes --remove-orphans "$CliParams"
}
if( $CliParams[0] -is [string] ) { $CliParams = @($CliParams,@($null)) }
$CliParams[0] = @('down') + $CliParams[0]
Invoke-DockerCompose -ProjectPath $ProjectPath -CliParams $CliParams