-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.ps1
More file actions
66 lines (59 loc) · 1.44 KB
/
dev.ps1
File metadata and controls
66 lines (59 loc) · 1.44 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Development script for TSG CrossMsg Signing project
param(
[Parameter(Position = 0)]
[string]$Command = "help"
)
function Show-Help {
Write-Host "Available commands:"
Write-Host " build - Build the project"
Write-Host " test - Run tests"
Write-Host " clean - Clean build files"
Write-Host " shell - Open a shell in the dev container"
Write-Host " start - Start the dev container"
Write-Host " stop - Stop the dev container"
Write-Host " help - Show this help message"
}
function Start-DevContainer {
docker-compose up -d dev
}
function Stop-DevContainer {
docker-compose down
}
function Enter-DevContainer {
docker-compose exec dev bash
}
function Invoke-GradleCommand {
param([string]$GradleCommand)
docker-compose exec dev gradle $GradleCommand
}
switch ($Command) {
"build" {
Start-DevContainer
Invoke-GradleCommand "build"
}
"test" {
Start-DevContainer
Invoke-GradleCommand "test"
}
"clean" {
Start-DevContainer
Invoke-GradleCommand "clean"
}
"shell" {
Start-DevContainer
Enter-DevContainer
}
"start" {
Start-DevContainer
}
"stop" {
Stop-DevContainer
}
"help" {
Show-Help
}
default {
Write-Host "Unknown command: $Command"
Show-Help
}
}