Skip to content

Commit

Permalink
Created powershell scripts to automatically start all docker compose …
Browse files Browse the repository at this point in the history
…files when using the foundatio workspace.
  • Loading branch information
niemyjski committed Sep 26, 2024
1 parent 4f6cca6 commit dda4e98
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions start-all-services.ps1
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions stop-all-services.ps1
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit dda4e98

Please sign in to comment.