bffbdafbfc
Co-authored-by: Cursor <cursoragent@cursor.com>
30 lines
754 B
Bash
Executable File
30 lines
754 B
Bash
Executable File
#!/usr/bin/env bash
|
||
# deploy/lib/update.sh — 更新(仅 git pull,禁止 scp)
|
||
set -e
|
||
set -u
|
||
if [ -n "${BASH_VERSION:-}" ]; then
|
||
set -o pipefail
|
||
fi
|
||
|
||
LIB_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||
# shellcheck source=common.sh
|
||
source "${LIB_DIR}/common.sh"
|
||
|
||
main_update() {
|
||
require_root
|
||
if ! REPO_ROOT="$(resolve_repo_root)"; then
|
||
die "未找到安装目录 ${INSTALL_ROOT},请先执行「1) 一键部署」"
|
||
fi
|
||
if ! repo_ready "${REPO_ROOT}"; then
|
||
die "安装不完整,请先执行「1) 一键部署」"
|
||
fi
|
||
|
||
step "更新 比特骆驼自动化对冲系统 (git pull + 构建 + pm2 reload)"
|
||
bash "${REPO_ROOT}/deploy/pull_and_restart.sh"
|
||
verify_health || true
|
||
echo ""
|
||
log "更新完成"
|
||
}
|
||
|
||
main_update "$@"
|