feat: 建立测试留痕与Docker云部署流程
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
param(
|
||||
[Parameter(Mandatory = $true)][string]$Registry,
|
||||
[Parameter(Mandatory = $true)][string]$Namespace,
|
||||
[string]$Repository = "mini-openclaw",
|
||||
[string]$Tag = ""
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
$root = (Resolve-Path (Join-Path $PSScriptRoot "..")).Path
|
||||
if (-not $Tag) {
|
||||
$Tag = (git -C $root rev-parse --short HEAD).Trim()
|
||||
}
|
||||
if ($Registry -notmatch "\.aliyuncs\.com$") {
|
||||
throw "Registry must be an Alibaba Cloud ACR domain ending in .aliyuncs.com"
|
||||
}
|
||||
$image = "$Registry/$Namespace/$Repository`:$Tag"
|
||||
|
||||
python (Join-Path $root "scripts/verify.py")
|
||||
if ($LASTEXITCODE -ne 0) { throw "Verification failed; image was not published" }
|
||||
|
||||
docker build --pull -t $image $root
|
||||
if ($LASTEXITCODE -ne 0) { throw "Docker build failed" }
|
||||
docker push $image
|
||||
if ($LASTEXITCODE -ne 0) { throw "Docker push failed" }
|
||||
|
||||
Write-Output "Published immutable image: $image"
|
||||
Reference in New Issue
Block a user