refactor(deploy): simplify script to git push-based deployment
Replace the previous Next.js build + rsync + archive workflow with a minimal `push_to_server` helper that only does `git push` to the `server` remote. Build, install, and start are now expected to be handled by the server's post-receive hook, removing duplicate logic and shrinking the script from 164 lines to 46. The old `build`, `deploy`, `archive`, `setup_env`, and `check_local_build_dir` functions (along with pnpm/rsync/sshpass usage) have been removed.
This commit is contained in:
@@ -1,25 +1,15 @@
|
||||
#!/bin/bash
|
||||
# ==========================================
|
||||
# 测试环境 Web 部署脚本(Next.js)
|
||||
# 测试环境 Web 部署脚本(Next.js + git push 模型)
|
||||
# 原始 Dart: scripts/deploy/deploy_web_test.sh
|
||||
# ==========================================
|
||||
|
||||
# 设置环境配置文件(Next.js 命名:.env.test)
|
||||
ENV_FILE="env/.env.test"
|
||||
|
||||
# 加载服务器配置
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "$SCRIPT_DIR/config/test_server"
|
||||
|
||||
# 加载公共函数库
|
||||
source "$SCRIPT_DIR/_deploy_lib.sh"
|
||||
|
||||
# 主函数
|
||||
main() {
|
||||
setup_env "$ENV_FILE"
|
||||
build
|
||||
deploy
|
||||
|
||||
push_to_server "test"
|
||||
purge_cdn_cache
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user