-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathtest-and-deploy.ps1
More file actions
105 lines (87 loc) · 3.66 KB
/
test-and-deploy.ps1
File metadata and controls
105 lines (87 loc) · 3.66 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
#!/usr/bin/env pwsh
# arifOS Test and Deploy Script
# Tests with MCP Inspector and deploys to VPS/Horizon
#
# Usage:
# .\test-and-deploy.ps1 test # Run tests only
# .\test-and-deploy.ps1 vps # Deploy to VPS
# .\test-and-deploy.ps1 horizon # Deploy to Horizon
param(
[Parameter(Mandatory=$true)]
[ValidateSet("test", "vps", "horizon")]
[string]$Target
)
$ErrorActionPreference = "Stop"
function Write-Info($msg) { Write-Host "[INFO] $msg" -ForegroundColor Blue }
function Write-Success($msg) { Write-Host "[SUCCESS] $msg" -ForegroundColor Green }
function Write-Warn($msg) { Write-Host "[WARN] $msg" -ForegroundColor Yellow }
function Write-Error($msg) { Write-Host "[ERROR] $msg" -ForegroundColor Red }
Write-Host "========================================" -ForegroundColor Cyan
Write-Host " arifOS Test and Deploy" -ForegroundColor Cyan
Write-Host " Target: $Target" -ForegroundColor Cyan
Write-Host "========================================" -ForegroundColor Cyan
Write-Host ""
# Test Phase
if ($Target -eq "test" -or $Target -eq "vps" -or $Target -eq "horizon") {
Write-Info "Running MCP Inspector tests..."
try {
python arifosmcp/evals/mcp_inspector_test.py --all --output deployments/mcp_inspector_report.json
if ($LASTEXITCODE -ne 0) {
Write-Error "MCP Inspector tests FAILED"
exit 1
}
Write-Success "MCP Inspector tests PASSED"
} catch {
Write-Error "MCP Inspector tests failed: $_"
exit 1
}
Write-Info "Running deployment gate tests..."
try {
python arifosmcp/evals/deploy_gate.py --output deployments/deploy_gate_report.json
if ($LASTEXITCODE -eq 0) {
Write-Success "Deployment gates PASSED (SEAL)"
} elseif ($LASTEXITCODE -eq 2) {
Write-Warn "Deployment gates: HOLD (needs human ratification)"
} else {
Write-Warn "Deployment gates: SABAR or VOID (review required)"
}
} catch {
Write-Warn "Deployment gate check had issues: $_"
}
}
# Deploy Phase
if ($Target -eq "vps") {
Write-Info "Deploying to VPS..."
# Check if we should proceed
$proceed = Read-Host "Continue with VPS deployment? (y/N)"
if ($proceed -ne 'y' -and $proceed -ne 'Y') {
Write-Info "Deployment cancelled"
exit 0
}
# Build Docker image
Write-Info "Building Docker image..."
docker build -t arifos/arifosmcp:latest .
# Deploy via SSH (requires SSH access configured)
Write-Info "Deploying via SSH..."
ssh root@arif-fazil.com "cd /root/arifOS && git pull origin main && docker-compose -f docker-compose.yml -f deployments/vps-deploy.yml up -d"
Write-Success "VPS deployment complete!"
Write-Info "Check health: https://arifosmcp.arif-fazil.com/health"
}
if ($Target -eq "horizon") {
Write-Info "Deploying to Horizon..."
$proceed = Read-Host "Continue with Horizon deployment? (y/N)"
if ($proceed -ne 'y' -and $proceed -ne 'Y') {
Write-Info "Deployment cancelled"
exit 0
}
Write-Info "Building Docker image..."
docker build -t arifos/arifosmcp:horizon .
Write-Info "Deploying via SSH..."
ssh root@horizon.arif-fazil.com "cd /root/arifOS && git pull origin main && docker-compose -f docker-compose.yml -f deployments/horizon-deploy.yml up -d"
Write-Success "Horizon deployment complete!"
}
Write-Host ""
Write-Host "========================================" -ForegroundColor Green
Write-Host " DITEMPA BUKAN DIBERI" -ForegroundColor Green
Write-Host " 999 SEAL ALIVE" -ForegroundColor Green
Write-Host "========================================" -ForegroundColor Green