diff --git a/start-all-services.ps1 b/start-all-services.ps1 new file mode 100644 index 00000000..3b911b37 --- /dev/null +++ b/start-all-services.ps1 @@ -0,0 +1,14 @@ +$parentDirectory = Split-Path -Path $PSScriptRoot -Parent +$directories = Get-ChildItem -Path $parentDirectory -Directory -Filter "Foundatio.*" + +foreach ($directory in $directories) { + $composeFilePath = Join-Path -Path $directory.FullName -ChildPath "docker-compose.yml" + if (Test-Path -Path $composeFilePath) { + Set-Location -Path $directory.FullName + Write-Host "Starting services in directory: $($directory.FullName)" + docker compose -f $composeFilePath up --detach + } +} + +Write-Host "Services started successfully." +Set-Location -Path $PSScriptRoot diff --git a/stop-all-services.ps1 b/stop-all-services.ps1 new file mode 100644 index 00000000..995473fd --- /dev/null +++ b/stop-all-services.ps1 @@ -0,0 +1,14 @@ +$parentDirectory = Split-Path -Path $PSScriptRoot -Parent +$directories = Get-ChildItem -Path $parentDirectory -Directory -Filter "Foundatio.*" + +foreach ($directory in $directories) { + $composeFilePath = Join-Path -Path $directory.FullName -ChildPath "docker-compose.yml" + if (Test-Path -Path $composeFilePath) { + Set-Location -Path $directory.FullName + Write-Host "Stopping services in directory: $($directory.FullName)" + docker compose -f $composeFilePath down --remove-orphans + } +} + +Write-Host "Stopped services" +Set-Location -Path $PSScriptRoot