Spaces:
Sleeping
Sleeping
Delete deploy.ps1
Browse files- deploy.ps1 +0 -68
deploy.ps1
DELETED
@@ -1,68 +0,0 @@
|
|
1 |
-
# Madverse Music Deployment Script for Windows
|
2 |
-
# Run with: .\deploy.ps1
|
3 |
-
|
4 |
-
Write-Host "π΅ Deploying Madverse Music API..." -ForegroundColor Cyan
|
5 |
-
|
6 |
-
# Check if Docker is installed
|
7 |
-
try {
|
8 |
-
docker --version | Out-Null
|
9 |
-
Write-Host "β
Docker found" -ForegroundColor Green
|
10 |
-
} catch {
|
11 |
-
Write-Host "β Docker is not installed. Please install Docker Desktop first." -ForegroundColor Red
|
12 |
-
exit 1
|
13 |
-
}
|
14 |
-
|
15 |
-
# Check if docker-compose is installed
|
16 |
-
try {
|
17 |
-
docker-compose --version | Out-Null
|
18 |
-
Write-Host "β
Docker Compose found" -ForegroundColor Green
|
19 |
-
} catch {
|
20 |
-
Write-Host "β Docker Compose is not installed. Please install Docker Desktop with Compose." -ForegroundColor Red
|
21 |
-
exit 1
|
22 |
-
}
|
23 |
-
|
24 |
-
# Set environment variables
|
25 |
-
if (-not $env:MADVERSE_API_KEY) {
|
26 |
-
$env:MADVERSE_API_KEY = "madverse-music-api-key-2024"
|
27 |
-
}
|
28 |
-
|
29 |
-
Write-Host "π§ Building Docker image..." -ForegroundColor Yellow
|
30 |
-
docker-compose build
|
31 |
-
|
32 |
-
if ($LASTEXITCODE -ne 0) {
|
33 |
-
Write-Host "β Failed to build Docker image" -ForegroundColor Red
|
34 |
-
exit 1
|
35 |
-
}
|
36 |
-
|
37 |
-
Write-Host "π Starting services..." -ForegroundColor Yellow
|
38 |
-
docker-compose up -d
|
39 |
-
|
40 |
-
if ($LASTEXITCODE -ne 0) {
|
41 |
-
Write-Host "β Failed to start services" -ForegroundColor Red
|
42 |
-
exit 1
|
43 |
-
}
|
44 |
-
|
45 |
-
Write-Host "β³ Waiting for services to be healthy..." -ForegroundColor Yellow
|
46 |
-
Start-Sleep -Seconds 30
|
47 |
-
|
48 |
-
# Test the API
|
49 |
-
Write-Host "π§ͺ Testing API health..." -ForegroundColor Yellow
|
50 |
-
try {
|
51 |
-
$response = Invoke-WebRequest -Uri "http://localhost:8000/health" -Method GET -TimeoutSec 10
|
52 |
-
if ($response.StatusCode -eq 200) {
|
53 |
-
Write-Host "β
API is healthy and running!" -ForegroundColor Green
|
54 |
-
Write-Host "π API URL: http://localhost:8000" -ForegroundColor Cyan
|
55 |
-
Write-Host "π API Docs: http://localhost:8000/" -ForegroundColor Cyan
|
56 |
-
Write-Host "π API Key: $env:MADVERSE_API_KEY" -ForegroundColor Cyan
|
57 |
-
} else {
|
58 |
-
throw "Health check failed"
|
59 |
-
}
|
60 |
-
} catch {
|
61 |
-
Write-Host "β API health check failed. Check logs:" -ForegroundColor Red
|
62 |
-
docker-compose logs madverse-api
|
63 |
-
exit 1
|
64 |
-
}
|
65 |
-
|
66 |
-
Write-Host ""
|
67 |
-
Write-Host "π― Quick Test Command:" -ForegroundColor Yellow
|
68 |
-
Write-Host "Invoke-RestMethod -Uri 'http://localhost:8000/analyze' -Method POST -Headers @{'X-API-Key'='$env:MADVERSE_API_KEY'; 'Content-Type'='application/json'} -Body '{`"urls`": [`"https://example.com/song.mp3`"]}'" -ForegroundColor Gray
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|