Add build verification scripts and documentation
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
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
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
46
scripts/test-images.ps1
Normal file
46
scripts/test-images.ps1
Normal file
@@ -0,0 +1,46 @@
|
||||
# 测试 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 ""
|
||||
Reference in New Issue
Block a user