mirror of
https://github.com/fawney19/Aether.git
synced 2026-01-10 19:52:27 +08:00
feat: 添加版本更新检查功能
- 后端新增 /api/admin/system/check-update 接口,从 GitHub Tags 获取最新版本 - 前端新增 UpdateDialog 组件,管理员登录后自动检查更新并弹窗提示 - 同一会话内只检查一次,点击"稍后提醒"后 24 小时内不再提示 - CI 和 deploy.sh 自动生成 _version.py 版本文件
This commit is contained in:
19
deploy.sh
19
deploy.sh
@@ -88,9 +88,28 @@ build_base() {
|
||||
save_deps_hash
|
||||
}
|
||||
|
||||
# 生成版本文件
|
||||
generate_version_file() {
|
||||
# 从 git 获取版本号
|
||||
local version
|
||||
version=$(git describe --tags --always 2>/dev/null | sed 's/^v//')
|
||||
if [ -z "$version" ]; then
|
||||
version="unknown"
|
||||
fi
|
||||
echo ">>> Generating version file: $version"
|
||||
cat > src/_version.py << EOF
|
||||
# Auto-generated by deploy.sh - do not edit
|
||||
__version__ = '$version'
|
||||
__version_tuple__ = tuple(int(x) for x in '$version'.split('-')[0].split('.') if x.isdigit())
|
||||
version = __version__
|
||||
version_tuple = __version_tuple__
|
||||
EOF
|
||||
}
|
||||
|
||||
# 构建应用镜像
|
||||
build_app() {
|
||||
echo ">>> Building app image (code only)..."
|
||||
generate_version_file
|
||||
docker build -f Dockerfile.app.local -t aether-app:latest .
|
||||
save_code_hash
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user