Add Fleet control plane and split manage.sh deploy menu.

Strategy nodes gain fleet token APIs; control/ app for local ops; manage.sh offers strategy vs control one-click deploy.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-30 10:46:40 +08:00
parent 200702d066
commit da5eb4c18c
44 changed files with 4623 additions and 15 deletions
+31 -6
View File
@@ -182,9 +182,11 @@ show_banner() {
}
show_menu() {
echo " 1) 一键部署"
echo " 2) 一键卸载"
echo " 3) 更新"
echo " 1) 一键部署策略机"
echo " 2) 一键部署中控机"
echo " 3) 一键卸载"
echo " 4) 更新策略机"
echo " 5) 更新中控机"
echo " 0) 退出"
echo ""
}
@@ -205,6 +207,23 @@ cm_read() {
printf -v "${__var}" '%s' "${__line}"
}
# 中控:依赖已齐 + 仓库在位后跑 control/deploy/update.sh
deploy_control_node() {
require_root
if ! REPO_ROOT="$(resolve_repo_root)"; then
die "未找到安装目录 ${INSTALL_ROOT},请先执行「1) 一键部署策略机」或完成仓库自举"
fi
if [[ ! -f "${REPO_ROOT}/control/deploy/update.sh" ]]; then
die "缺少 control/deploy/update.sh,请先 git pull 更新仓库"
fi
step "一键部署中控机 — 环境检测 (缺则装,有则跳过)"
ensure_system_deps
step "部署中控 (git pull + 构建 + pm2 eth-hedge-control)"
bash "${REPO_ROOT}/control/deploy/update.sh"
echo ""
log "中控部署完成 → http://<本机IP>:5160 默认账号 admin / admin123"
}
main_menu() {
bootstrap_repo
# shellcheck source=lib/common.sh
@@ -215,23 +234,29 @@ main_menu() {
show_banner
show_menu
local choice=""
cm_read choice "请选择 [0-3]: "
cm_read choice "请选择 [0-5]: "
case "${choice}" in
1)
bash "${LIB_DIR}/install.sh"
;;
2)
bash "${LIB_DIR}/uninstall.sh"
deploy_control_node
;;
3)
bash "${LIB_DIR}/uninstall.sh"
;;
4)
bash "${LIB_DIR}/update.sh"
;;
5)
deploy_control_node
;;
0)
echo "再见."
exit 0
;;
*)
echo "无效选项,请输入 0-3"
echo "无效选项,请输入 0-5"
;;
esac
echo ""