2020-11-11 21:38:56 +00:00
|
|
|
[CmdletBinding(SupportsShouldProcess)]param(
|
|
|
|
[string[]]$ProjectPath=@($PWD),
|
|
|
|
[Parameter(Position = 0, ValueFromRemainingArguments = $true)]
|
|
|
|
[string[]]$CliParams
|
|
|
|
)
|
2020-10-31 21:10:32 +00:00
|
|
|
|
|
|
|
$local:dcParams = [string]::Empty
|
2020-11-11 21:38:56 +00:00
|
|
|
if( $CliParams ) {
|
|
|
|
$dcParams = $CliParams | ForEach-Object {
|
2020-10-31 21:10:32 +00:00
|
|
|
if( $_ -match "(?:^'[^']+'$)|(?:^`"[^`"]+`"$)|(?:^[^\s]+$)" ) { $_ }
|
|
|
|
else { "'$($_.Replace( "'", "''" ))'" }
|
|
|
|
}
|
|
|
|
}
|
2020-11-11 21:38:56 +00:00
|
|
|
$ProjectPath | ForEach-Object {
|
|
|
|
$local:dcPath = $(Resolve-Path $(Join-Path $_ docker-compose.yml))
|
|
|
|
Write-Verbose "docker-compose --file $dcPath up -d --remove-orphans $dcParams && docker-compose --file $dcPath logs --follow --tail 10 $dcParams"
|
|
|
|
docker-compose --file $dcPath up -d --remove-orphans $dcParams && docker-compose --file $dcPath logs --follow --tail 10 $dcParams
|
|
|
|
}
|
|
|
|
|