feat: add native Windows local orchestration

This commit is contained in:
2026-08-20 19:30:30 +03:30
parent 67777bde5b
commit 08b43b427a
6 changed files with 346 additions and 1 deletions

26
scripts/local-dev.ps1 Normal file
View File

@@ -0,0 +1,26 @@
[CmdletBinding()]
param(
[Parameter(Position = 0)][ValidateSet('check', 'start', 'stop', 'status')][string]$Action = 'status',
[string]$BackendPath,
[string]$FrontendPath
)
$ErrorActionPreference = 'Stop'
$deploymentPath = Split-Path $PSScriptRoot -Parent
if (-not $BackendPath) { $BackendPath = Join-Path (Split-Path $deploymentPath -Parent) 'zarinpal-analytics-backend' }
if (-not $FrontendPath) { $FrontendPath = Join-Path (Split-Path $deploymentPath -Parent) 'zarinpal-analytics-frontend' }
Import-Module (Join-Path $PSScriptRoot 'LocalDev.psm1') -Force
try {
switch ($Action) {
'check' { Invoke-LocalDevCheck -DeploymentPath $deploymentPath -BackendPath $BackendPath -FrontendPath $FrontendPath | Format-List }
'start' { Start-LocalDev -DeploymentPath $deploymentPath -BackendPath $BackendPath -FrontendPath $FrontendPath | Format-Table -AutoSize }
'stop' { Stop-LocalDev -DeploymentPath $deploymentPath; Write-Output 'Local services stopped.' }
'status' { Get-LocalDevStatus -DeploymentPath $deploymentPath | Format-Table -AutoSize }
}
}
catch {
Write-Error $_
exit 1
}