chore: track Linux deploy scripts with forced git pull
Ship start/restart/pull-and-restart and deploy lib so production can one-line update; git_pull_hard uses checkout -f, restart --pull aligns then restarts.
This commit is contained in:
13
pull-and-restart.sh
Normal file
13
pull-and-restart.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
# AI 建站 — 拉取代码并重启(生产一键更新)
|
||||
# 用法:./pull-and-restart.sh
|
||||
# 等价:./restart.sh --pull
|
||||
# 默认仓库:https://gitea.yuxindazhineng.com/whm/ai_site.git
|
||||
# 环境变量:
|
||||
# AIJZ_GIT_URL 覆盖仓库地址
|
||||
# GIT_BRANCH 分支(默认 main)
|
||||
# FORCE_GIT_RESET 默认 1;硬对齐并丢弃已跟踪文件的本地改动(保留 .env 等未跟踪文件)
|
||||
set -euo pipefail
|
||||
ROOT="$(cd "$(dirname "$0")" && pwd)"
|
||||
cd "$ROOT"
|
||||
exec "$ROOT/restart.sh" --pull
|
||||
Reference in New Issue
Block a user