-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake.ps1
More file actions
40 lines (39 loc) · 1.27 KB
/
Copy pathmake.ps1
File metadata and controls
40 lines (39 loc) · 1.27 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
38
39
40
param(
[Parameter(Position=0)]
[string]$Target = "run"
)
switch ($Target) {
"run" {
Write-Host "Running redisforge..." -ForegroundColor Cyan
go run ./cmd/redisforge
}
"build" {
Write-Host "Building redisforge to bin/redisforge.exe..." -ForegroundColor Cyan
if (!(Test-Path -Path "bin")) { New-Item -ItemType Directory -Path "bin" | Out-Null }
go build -o bin/redisforge.exe ./cmd/redisforge
}
"test" {
Write-Host "Running tests with race detection..." -ForegroundColor Cyan
go test -race ./...
}
"lint" {
Write-Host "Running golangci-lint..." -ForegroundColor Cyan
golangci-lint run ./...
}
"tidy" {
Write-Host "Running go mod tidy..." -ForegroundColor Cyan
go mod tidy
}
"up" {
Write-Host "Starting docker-compose stack..." -ForegroundColor Cyan
docker-compose -f deployments/docker-compose.yml up --build -d
}
"down" {
Write-Host "Stopping docker-compose stack..." -ForegroundColor Cyan
docker-compose -f deployments/docker-compose.yml down
}
default {
Write-Host "Unknown target: $Target" -ForegroundColor Red
Write-Host "Available targets: run, build, test, lint, tidy, up, down"
}
}