-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify-setup.ps1
More file actions
157 lines (144 loc) Β· 5.31 KB
/
verify-setup.ps1
File metadata and controls
157 lines (144 loc) Β· 5.31 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# TSG-CrossMsg-Signing Setup Verification Script
# This script verifies that the core project development environment is working correctly
Write-Host "π TSG-CrossMsg-Signing Setup Verification" -ForegroundColor Cyan
Write-Host "=============================================" -ForegroundColor Cyan
# Check if Docker is running
Write-Host "`n1. Checking Docker Desktop..." -ForegroundColor Yellow
try {
$dockerVersion = docker --version
Write-Host "β
Docker is available: $dockerVersion" -ForegroundColor Green
}
catch {
Write-Host "β Docker is not available. Please install Docker Desktop." -ForegroundColor Red
exit 1
}
# Check if docker-compose is available
Write-Host "`n2. Checking Docker Compose..." -ForegroundColor Yellow
try {
$composeVersion = docker-compose --version
Write-Host "β
Docker Compose is available: $composeVersion" -ForegroundColor Green
}
catch {
Write-Host "β Docker Compose is not available." -ForegroundColor Red
exit 1
}
# Check if dev.ps1 exists
Write-Host "`n3. Checking development script..." -ForegroundColor Yellow
if (Test-Path "dev.ps1") {
Write-Host "β
dev.ps1 script found" -ForegroundColor Green
}
else {
Write-Host "β dev.ps1 script not found. Are you in the correct directory?" -ForegroundColor Red
exit 1
}
# Check if docker-compose.yml exists
Write-Host "`n4. Checking Docker Compose configuration..." -ForegroundColor Yellow
if (Test-Path "docker-compose.yml") {
Write-Host "β
docker-compose.yml found" -ForegroundColor Green
}
else {
Write-Host "β docker-compose.yml not found. Are you in the correct directory?" -ForegroundColor Red
exit 1
}
# Start the development environment
Write-Host "`n5. Starting development environment..." -ForegroundColor Yellow
try {
.\dev.ps1 start
Write-Host "β
Development environment started successfully" -ForegroundColor Green
}
catch {
Write-Host "β Failed to start development environment" -ForegroundColor Red
Write-Host " Try: docker-compose down --volumes; docker system prune -f" -ForegroundColor Yellow
exit 1
}
# Wait a moment for container to fully start
Start-Sleep -Seconds 5
# Check if container is running
Write-Host "`n6. Verifying container status..." -ForegroundColor Yellow
try {
$containerStatus = docker-compose ps
if ($containerStatus -match "Up") {
Write-Host "β
Development container is running" -ForegroundColor Green
}
else {
Write-Host "β Development container is not running properly" -ForegroundColor Red
exit 1
}
}
catch {
Write-Host "β Failed to check container status" -ForegroundColor Red
exit 1
}
# Test Java installation
Write-Host "`n7. Testing Java installation..." -ForegroundColor Yellow
try {
$javaVersion = docker-compose exec dev java -version 2>&1
if ($javaVersion -match "17") {
Write-Host "β
Java 17 is available in container" -ForegroundColor Green
}
else {
Write-Host "β Java 17 not found in container" -ForegroundColor Red
exit 1
}
}
catch {
Write-Host "β Failed to test Java installation" -ForegroundColor Red
exit 1
}
# Test Gradle installation
Write-Host "`n8. Testing Gradle installation..." -ForegroundColor Yellow
try {
$gradleVersion = docker-compose exec dev gradle --version 2>&1
if ($gradleVersion -match "8.6") {
Write-Host "β
Gradle 8.6 is available in container" -ForegroundColor Green
}
else {
Write-Host "β Gradle 8.6 not found in container" -ForegroundColor Red
exit 1
}
}
catch {
Write-Host "β Failed to test Gradle installation" -ForegroundColor Red
exit 1
}
# Test project structure
Write-Host "`n9. Testing project structure..." -ForegroundColor Yellow
try {
$projectFiles = docker-compose exec dev ls -la /app
if ($projectFiles -match "build.gradle") {
Write-Host "β
Project files are accessible in container" -ForegroundColor Green
}
else {
Write-Host "β Project files not accessible in container" -ForegroundColor Red
exit 1
}
}
catch {
Write-Host "β Failed to test project structure" -ForegroundColor Red
exit 1
}
# Run a quick test
Write-Host "`n10. Running quick test..." -ForegroundColor Yellow
try {
$testResult = docker-compose exec dev gradle test --tests "*ProjectSetup*Test" --console=plain 2>&1
if ($testResult -match "BUILD SUCCESSFUL") {
Write-Host "β
Quick test passed successfully" -ForegroundColor Green
}
else {
Write-Host "β Quick test failed" -ForegroundColor Red
Write-Host " Test output: $testResult" -ForegroundColor Yellow
exit 1
}
}
catch {
Write-Host "β Failed to run quick test" -ForegroundColor Red
exit 1
}
Write-Host "`nπ SETUP VERIFICATION COMPLETE!" -ForegroundColor Green
Write-Host "=============================================" -ForegroundColor Green
Write-Host "β
Your TSG-CrossMsg-Signing development environment is working correctly!" -ForegroundColor Green
Write-Host "`nNext steps:" -ForegroundColor Cyan
Write-Host "1. Run all tests: .\dev.ps1 test" -ForegroundColor White
Write-Host "2. Access development shell: .\dev.ps1 shell" -ForegroundColor White
Write-Host "3. View test reports: build/reports/tests/html/index.html" -ForegroundColor White
Write-Host "`nFor more information, see the README.md file." -ForegroundColor Cyan