Restore to commit 74e578279624c6045ca440a3459ebfa1f8d54191
This commit is contained in:
38
scripts/build-and-verify.ps1
Normal file
38
scripts/build-and-verify.ps1
Normal file
@@ -0,0 +1,38 @@
|
||||
# PowerShell helper script to build and verify the WordPress Plugin AI Builder container
|
||||
|
||||
param(
|
||||
[switch]$NoCache
|
||||
)
|
||||
|
||||
$buildArgs = @('compose', 'build')
|
||||
if ($NoCache) { $buildArgs += '--no-cache' }
|
||||
|
||||
Write-Host "Building WordPress Plugin AI Builder container..."
|
||||
docker @buildArgs
|
||||
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Error "Build failed"
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "Starting container..."
|
||||
docker compose up -d
|
||||
|
||||
Write-Host "Waiting for container readiness (healthcheck)..."
|
||||
Start-Sleep -Seconds 5
|
||||
|
||||
Write-Host "Verifying tools inside container..."
|
||||
|
||||
docker compose exec wordpress-plugin-ai-builder pwsh -NoProfile -Command 'pwsh --version; opencode --version; node --version; if (Get-Command opencode -ErrorAction SilentlyContinue) { Write-Host "opencode available" } else { Write-Error "opencode not found"; exit 1 }'
|
||||
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Error "Verification failed"
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "All checks passed." -ForegroundColor Green
|
||||
Write-Host "Open http://localhost:4000 for the web interface." -ForegroundColor Cyan
|
||||
Write-Host "Open http://localhost:4001 for the terminal." -ForegroundColor Cyan
|
||||
Write-Host "Verifying `github` helper is available in profile (sourcing profile)..."
|
||||
docker compose exec wordpress-plugin-ai-builder pwsh -NoProfile -Command ". /root/.config/powershell/Microsoft.PowerShell_profile.ps1; Get-Command github"
|
||||
if ($LASTEXITCODE -ne 0) { Write-Warning "`github` helper not detected. Ensure you built the image with the new profile, or update the volume via README instructions." }
|
||||
Reference in New Issue
Block a user