build: 实现真正的执行一次脚本就部署的流程
This commit is contained in:
parent
e192d75a1c
commit
01e508a566
|
|
@ -58,7 +58,7 @@ export const zhCN: Translations = {
|
|||
// Welcome
|
||||
welcome: {
|
||||
// TODO: 测试环境标识
|
||||
greeting: "轻办公 · XClaw Tag:v3.1.0fix: xclaw_used切换欢迎样式和对话样式",
|
||||
greeting: "轻办公 · XClaw Tag:v3.1.0 build: 实现真正的执行一次脚本就部署的流程",
|
||||
description:
|
||||
"欢迎使用 🦌 DeerFlow,一个完全开源的超级智能体。通过内置和自定义的 Skills,\nDeerFlow 可以帮你搜索网络、分析数据,还能为你生成幻灯片、\n图片、视频、播客及网页等,几乎可以做任何事情。",
|
||||
|
||||
|
|
|
|||
|
|
@ -8,21 +8,21 @@ cd "$REPO_ROOT"
|
|||
usage() {
|
||||
cat <<'EOF'
|
||||
Usage:
|
||||
./scripts/deploy-frontend-standalone.sh <remote> <remote_app_dir> [--restart]
|
||||
./scripts/deploy-frontend-standalone.sh <remote> <remote_app_dir>
|
||||
|
||||
Arguments:
|
||||
remote SSH target, e.g. user@example.com
|
||||
remote_app_dir Remote deerflow2 root dir, e.g. /home/user/deerflow2
|
||||
|
||||
Options:
|
||||
--restart Run "make start" on the remote host after upload
|
||||
|
||||
Example:
|
||||
./scripts/deploy-frontend-standalone.sh ubuntu@1.2.3.4 /opt/deerflow2 --restart
|
||||
./scripts/deploy-frontend-standalone.sh ubuntu@1.2.3.4 /opt/deerflow2
|
||||
|
||||
Notes:
|
||||
- Run this script on your local machine (build machine), not on the server.
|
||||
- Requires: pnpm, rsync, ssh
|
||||
- Script will run:
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart deerflow.service
|
||||
EOF
|
||||
}
|
||||
|
||||
|
|
@ -31,20 +31,13 @@ if [ "${1:-}" = "-h" ] || [ "${1:-}" = "--help" ]; then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$#" -lt 2 ] || [ "$#" -gt 3 ]; then
|
||||
if [ "$#" -ne 2 ]; then
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
REMOTE="$1"
|
||||
REMOTE_APP_DIR="$2"
|
||||
RESTART="${3:-}"
|
||||
|
||||
if [ "$RESTART" != "" ] && [ "$RESTART" != "--restart" ]; then
|
||||
echo "Unknown option: $RESTART"
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "==> Building frontend (standalone)..."
|
||||
pnpm -C frontend build
|
||||
|
|
@ -64,9 +57,7 @@ rsync -azP --info=progress2 \
|
|||
frontend/public/ \
|
||||
"$REMOTE:$REMOTE_APP_DIR/frontend/.next/standalone/public/"
|
||||
|
||||
if [ "$RESTART" = "--restart" ]; then
|
||||
echo "==> Restarting DeerFlow on remote host..."
|
||||
ssh "$REMOTE" "cd '$REMOTE_APP_DIR' && make start"
|
||||
fi
|
||||
echo "==> Reloading systemd and restarting deerflow.service on remote host..."
|
||||
ssh "$REMOTE" "sudo systemctl daemon-reload && sudo systemctl restart deerflow.service"
|
||||
|
||||
echo "==> Done."
|
||||
|
|
|
|||
Loading…
Reference in New Issue