fix(build): Docker 构建注入版本号并同步 aicodex 镜像脚本

This commit is contained in:
yangjianbo
2026-02-14 21:16:21 +08:00
parent 5feff6b1e5
commit e2107ce45e
3 changed files with 37 additions and 8 deletions

View File

@@ -40,7 +40,12 @@ var (
)
func init() {
// Read version from embedded VERSION file
// 如果 Version 已通过 ldflags 注入(例如 -X main.Version=...),则不要覆盖。
if strings.TrimSpace(Version) != "" {
return
}
// 默认从 embedded VERSION 文件读取版本号(编译期打包进二进制)。
Version = strings.TrimSpace(embeddedVersion)
if Version == "" {
Version = "0.0.0-dev"