-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild-all.ps1
More file actions
157 lines (147 loc) · 4.09 KB
/
build-all.ps1
File metadata and controls
157 lines (147 loc) · 4.09 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
# SPDX-License-Identifier: Apache-2.0
# Copyright 2025 SentinelOps Platform Contributors
Write-Host "SentinelOps Platform - Build All Components" -ForegroundColor Green
Write-Host "=============================================="
function Write-Success($message) {
Write-Host "✅ $message" -ForegroundColor Green
}
function Write-Fail($message) {
Write-Host "❌ $message" -ForegroundColor Red
}
# Build Go services
Write-Host ""
Write-Host "Building Go Services..." -ForegroundColor Yellow
$services = @("api-gateway", "spec-service", "proof-service", "build-orchestrator", "evidence-service", "replay-service")
$repoRoot = Get-Location
foreach ($service in $services) {
Write-Host "Building $service..."
Set-Location "services\$service"
try {
& go mod tidy
if ($LASTEXITCODE -eq 0) {
& go build
if ($LASTEXITCODE -eq 0) {
Write-Success "$service built successfully"
}
else {
Write-Fail "$service build failed"
}
}
else {
Write-Fail "$service go mod tidy failed"
}
}
catch {
Write-Fail "$service build error: $_"
}
finally {
Set-Location $repoRoot
}
}
# Build TypeScript SDK
Write-Host ""
Write-Host "Building TypeScript SDK..." -ForegroundColor Yellow
try {
Set-Location "core\sdk\typescript"
if (Get-Command npm -ErrorAction SilentlyContinue) {
& npm ci --no-audit --no-fund
if ($LASTEXITCODE -ne 0) { & npm install }
}
else {
Write-Fail "npm not found - skipping TypeScript SDK build"
throw
}
if ($LASTEXITCODE -eq 0) {
& npm run build
if ($LASTEXITCODE -eq 0) {
Write-Success "TypeScript SDK built successfully"
}
else {
Write-Fail "TypeScript SDK build failed"
}
}
else {
Write-Fail "TypeScript SDK npm install failed"
}
}
catch {
Write-Fail "TypeScript SDK error: $_"
}
finally {
Set-Location $repoRoot
}
# Build Demo Application
Write-Host ""
Write-Host "Building Demo Application..." -ForegroundColor Yellow
try {
Set-Location "demos\verifiable-mcp-fraud"
if (Get-Command npm -ErrorAction SilentlyContinue) {
& npm ci --no-audit --no-fund
if ($LASTEXITCODE -ne 0) { & npm install }
}
else {
Write-Fail "npm not found - skipping Demo build"
throw
}
if ($LASTEXITCODE -eq 0) {
& npm run build
if ($LASTEXITCODE -eq 0) {
Write-Success "Demo application built successfully"
}
else {
Write-Fail "Demo application build failed"
}
}
else {
Write-Fail "Demo application npm install failed"
}
}
catch {
Write-Fail "Demo application error: $_"
}
finally {
Set-Location $repoRoot
}
# Build Console UI
Write-Host ""
Write-Host "Building Console UI..." -ForegroundColor Yellow
try {
Set-Location "console"
if (Get-Command npm -ErrorAction SilentlyContinue) {
& npm ci --no-audit --no-fund
if ($LASTEXITCODE -ne 0) { & npm install }
}
else {
Write-Fail "npm not found - skipping Console UI build"
throw
}
if ($LASTEXITCODE -eq 0) {
& npm run build
if ($LASTEXITCODE -eq 0) {
Write-Success "Console UI built successfully"
}
else {
Write-Fail "Console UI build failed"
}
}
else {
Write-Fail "Console UI npm install failed"
}
}
catch {
Write-Fail "Console UI error: $_"
}
finally {
Set-Location $repoRoot
}
Write-Host ""
Write-Host "🎉 Build validation completed!" -ForegroundColor Green
Write-Host ""
Write-Host "Summary:" -ForegroundColor Cyan
Write-Host " - Go services (6): Tested" -ForegroundColor White
Write-Host " - TypeScript SDK: Tested" -ForegroundColor White
Write-Host " - Demo application: Tested" -ForegroundColor White
Write-Host " - Console UI: Tested" -ForegroundColor White
Write-Host ""
Write-Host 'Ready for Docker deployment!' -ForegroundColor Green
Write-Host 'Run: docker compose up --build -d' -ForegroundColor Cyan