chore: v0.1.1 发版脚本修复与 K8s 镜像坐标更新
- run.sh release 改用 docker-compose build,修复 buildx 缺失导致发版失败 - K8s deployment/quick-deploy 镜像更新为 lghost/aiops:v0.1.1 - 恢复 backend/static/.gitkeep 供 go:embed 目录占位
This commit is contained in:
1 parent
7e1c8f583c
commit
5770f2ccd4
3 files changed
+17
-20
No files matched your search
@@ -505,27 +505,24 @@ build_embed_image() {
|
||||
clean_frontend_artifacts
|
||||
clean_embed_static
|
||||
|
||||
export DOCKERHUB_IMAGE
|
||||
export DOCKER_BUILDKIT=1
|
||||
local build_args=(
|
||||
-f Dockerfile
|
||||
--build-arg "VERSION=${BUILD_VERSION}"
|
||||
--build-arg "BUILD_TIME=${BUILD_TIME}"
|
||||
--build-arg "GIT_COMMIT=${GIT_COMMIT}"
|
||||
--label "org.opencontainers.image.version=${BUILD_VERSION}"
|
||||
-t "$EMBED_IMAGE"
|
||||
-t "${DOCKERHUB_IMAGE}:dev"
|
||||
.
|
||||
)
|
||||
if [ "$no_cache" -eq 1 ]; then
|
||||
build_args=(--no-cache --pull "${build_args[@]}")
|
||||
info "无缓存全量构建 (--no-cache --pull)"
|
||||
export COMPOSE_DOCKER_CLI_BUILD=1
|
||||
local compose_cmd
|
||||
compose_cmd=$(detect_compose_cmd)
|
||||
if [ -z "$compose_cmd" ]; then
|
||||
error "Docker Compose 未安装,无法构建 embed 镜像"
|
||||
return 1
|
||||
fi
|
||||
|
||||
info "构建中(前端 + 后端 embed)..."
|
||||
docker build "${build_args[@]}" || {
|
||||
error "镜像构建失败"
|
||||
return 1
|
||||
}
|
||||
info "使用 $compose_cmd build(version=$BUILD_VERSION)..."
|
||||
if [ "$no_cache" -eq 1 ]; then
|
||||
info "无缓存全量构建 (--no-cache)..."
|
||||
$compose_cmd build --no-cache aiops || { error "镜像构建失败"; return 1; }
|
||||
else
|
||||
$compose_cmd build aiops || { error "镜像构建失败"; return 1; }
|
||||
fi
|
||||
docker tag "$EMBED_IMAGE" "${DOCKERHUB_IMAGE}:dev" 2>/dev/null || true
|
||||
|
||||
local img_size
|
||||
img_size=$(docker images "$EMBED_IMAGE" --format "{{.Size}}" | head -1)
|
||||
|
||||
Reference in new issue
Block a user