feat: Linux one-click start pulls from Gitea ai_site

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
whm
2026-07-31 10:20:46 +08:00
parent 6366859bb3
commit 3d2851a1f1
5 changed files with 86 additions and 14 deletions

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env bash
# AI 建站 — Linux 一键启动Docker Compose
# 用法cd 项目根 && ./start.sh [--rebuild]
# 用法cd 项目根 && ./start.sh [--rebuild] [--no-pull]
# 默认从 Gitea 拉取最新代码再启动(可用 --no-pull / AIJZ_SKIP_GIT_PULL=1 跳过)
# 行尾LF
set -euo pipefail
ROOT="$(cd "$(dirname "$0")" && pwd)"
@@ -9,21 +10,35 @@ cd "$ROOT"
. "$ROOT/scripts/lib-aijz-deploy.sh"
REBUILD=0
DO_PULL=1
for a in "$@"; do
case "$a" in
--rebuild|-r) REBUILD=1 ;;
--no-pull) DO_PULL=0 ;;
--pull) DO_PULL=1 ;;
-h|--help)
echo "用法: $0 [--rebuild]"
echo "用法: $0 [--rebuild] [--no-pull|--pull]"
echo " 默认拉取: ${AIJZ_GIT_URL:-https://gitea.yuxindazhineng.com/whm/ai_site.git} 分支 ${GIT_BRANCH:-main}"
echo " 跳过拉取: --no-pull 或 AIJZ_SKIP_GIT_PULL=1"
exit 0
;;
esac
done
if [ "${AIJZ_SKIP_GIT_PULL:-0}" = "1" ]; then
DO_PULL=0
fi
echo "========================================"
echo " AI 建站 启动"
echo " 路径: $ROOT"
echo "========================================"
if [ "$DO_PULL" = "1" ]; then
git_pull_hard
else
echo "已跳过代码拉取(--no-pull / AIJZ_SKIP_GIT_PULL"
fi
ensure_docker
stack_up "$REBUILD"
healthcheck