$token = Get-Content 'c:\Users\Administrator\.ssh\coolify-redbull-token'
$baseUrl = "https://redbull.rede5.com.br/api/v1"

$apps = @(
    @{ Name = "q1food-backend-dev"; Uuid = "eosgwscc4g044c884k0ws4gc" },
    @{ Name = "q1food-frontend-dev"; Uuid = "g8w440g0w0oowo8skss440wk" }
)

foreach ($app in $apps) {
    Write-Host "Iniciando deploy de $($app.Name) (UUID: $($app.Uuid))..."
    try {
        $response = Invoke-RestMethod -Uri "$baseUrl/deploy?uuid=$($app.Uuid)" -Headers @{Authorization = "Bearer $token" } -Method Get
        Write-Host "Resposta do Deploy:"
        $response | ConvertTo-Json -Depth 3
    }
    catch {
        Write-Host "Erro ao iniciar o deploy do $($app.Name): $($_.Exception.Message)"
    }
}
