-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.ps1
More file actions
37 lines (31 loc) · 1.21 KB
/
Copy pathdemo.ps1
File metadata and controls
37 lines (31 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
$env:PATH = "C:\Program Files\Go\bin;" + $env:PATH
Set-Location "C:\Users\jimmy\Desktop\new-project"
# Kill previous instances
Get-Process -Name demo, failmap -ErrorAction SilentlyContinue | Stop-Process -Force
# Build
go build -o bin/failmap.exe ./cmd/failmap
if ($LASTEXITCODE -ne 0) { Write-Host "FAILMAP BUILD FAILED"; exit 1 }
go build -o bin/demo.exe ./cmd/demo
if ($LASTEXITCODE -ne 0) { Write-Host "DEMO BUILD FAILED"; exit 1 }
Write-Host "BUILD OK"
# Launch demo services (7 UP, 5 DOWN for realistic mix)
$services = @(
@{ Name = "load-balancer"; Port = "9001" },
@{ Name = "cdn-proxy"; Port = "9002" },
@{ Name = "api-gateway"; Port = "9003" },
@{ Name = "auth-service"; Port = "9004" },
@{ Name = "user-service"; Port = "9005" },
@{ Name = "notification-service"; Port = "9007" },
@{ Name = "cache-layer"; Port = "9009" }
)
foreach ($svc in $services) {
$env:SERVICE_NAME = $svc.Name
$env:SERVICE_PORT = $svc.Port
Start-Process -FilePath ".\bin\demo.exe" -WindowStyle Hidden
}
Start-Sleep -Seconds 1
Write-Host ""
Write-Host "=== 7 services UP / 5 DOWN ==="
Write-Host "Starting failmap on http://localhost:3000 ..."
Write-Host ""
& .\bin\failmap.exe -config failmap.test.yaml