Files
wecom-ai-assistant/scripts/test-images.ps1
bujie9527 91c3d75557
Some checks are pending
Build and Deploy / test-backend (push) Waiting to run
Build and Deploy / build-backend (push) Blocked by required conditions
Build and Deploy / build-admin (push) Waiting to run
Deploy to Production / build-backend (push) Waiting to run
Deploy to Production / deploy (push) Blocked by required conditions
Add build verification scripts and documentation
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-05 23:04:43 +08:00

47 lines
1.4 KiB
PowerShell

# 测试 Docker 镜像
# 用途:快速测试镜像是否可以正常运行
param(
[string]$Tag = "latest",
[string]$Registry = "registry.667788.cool"
)
Write-Host "=== 测试 Docker 镜像 ===" -ForegroundColor Cyan
Write-Host ""
# 测试 Backend 镜像
Write-Host "1. 测试 Backend 镜像..." -ForegroundColor Yellow
$backendImage = "$Registry/wecom-backend:$Tag"
docker run --rm $backendImage python --version
if ($LASTEXITCODE -eq 0) {
Write-Host "✓ Backend 镜像正常" -ForegroundColor Green
} else {
Write-Host "✗ Backend 镜像测试失败" -ForegroundColor Red
}
Write-Host ""
# 测试 Admin 镜像
Write-Host "2. 测试 Admin 镜像..." -ForegroundColor Yellow
$adminImage = "$Registry/wecom-admin:$Tag"
docker run --rm $adminImage node --version
if ($LASTEXITCODE -eq 0) {
Write-Host "✓ Admin 镜像正常" -ForegroundColor Green
} else {
Write-Host "✗ Admin 镜像测试失败" -ForegroundColor Red
}
Write-Host ""
# 测试 Nginx 镜像
Write-Host "3. 测试 Nginx 镜像..." -ForegroundColor Yellow
$nginxImage = "$Registry/wecom-nginx:$Tag"
docker run --rm $nginxImage nginx -v
if ($LASTEXITCODE -eq 0) {
Write-Host "✓ Nginx 镜像正常" -ForegroundColor Green
} else {
Write-Host "✗ Nginx 镜像测试失败" -ForegroundColor Red
}
Write-Host ""
Write-Host "=== 测试完成 ===" -ForegroundColor Cyan
Write-Host ""