test
This commit is contained in:
40
dt.sh
40
dt.sh
@@ -46,8 +46,11 @@ deploy-test 后端/基础服务:
|
||||
status 调用 deploy-test/status.sh
|
||||
|
||||
deploy-test 前端:
|
||||
fe-start [project] 调用 deploy-test/07-start-frontend.sh [project]
|
||||
fe-stop [project] 调用 deploy-test/stop-frontend.sh [project]
|
||||
fe-start [project] 调用 deploy-test/07-start-frontend.sh [project](开发态前端)
|
||||
fe-stop [project] 调用 deploy-test/stop-frontend.sh [project]
|
||||
fe-build-static [project] 调用 deploy-test/08-build-static-frontend.sh [project](pc/cms/build-cms/build-down)
|
||||
fe-verify-static 调用 deploy-test/09-verify-static-frontends.sh
|
||||
fe-publish [project] 构建静态前端 + 更新 Nginx + 校验(默认 all)
|
||||
|
||||
常用组合:
|
||||
up pull + build + restart
|
||||
@@ -60,7 +63,9 @@ deploy-test 前端:
|
||||
./deploy-test/dt.sh pull
|
||||
./deploy-test/dt.sh build
|
||||
./deploy-test/dt.sh restart
|
||||
./deploy-test/dt.sh fe-start pc
|
||||
./deploy-test/dt.sh fe-build-static pc
|
||||
./deploy-test/dt.sh fe-verify-static
|
||||
sudo ./deploy-test/dt.sh fe-publish
|
||||
./deploy-test/dt.sh deploy
|
||||
EOF
|
||||
}
|
||||
@@ -72,6 +77,14 @@ require_deploy_test() {
|
||||
fi
|
||||
}
|
||||
|
||||
require_root_for_publish() {
|
||||
if [[ "$(id -u)" -ne 0 ]]; then
|
||||
err "fe-publish 需要 root / sudo,因为会执行 nginx 安装与重载"
|
||||
echo "请执行: sudo ./deploy-test/dt.sh fe-publish${1:+ $1}"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
run_deploy_test_script() {
|
||||
local script="$1"
|
||||
shift || true
|
||||
@@ -195,6 +208,27 @@ main() {
|
||||
fe-stop)
|
||||
run_deploy_test_script "stop-frontend.sh" "$@"
|
||||
;;
|
||||
fe-build-static)
|
||||
run_deploy_test_script "08-build-static-frontend.sh" "$@"
|
||||
;;
|
||||
fe-verify-static)
|
||||
run_deploy_test_script "09-verify-static-frontends.sh" "$@"
|
||||
;;
|
||||
fe-publish)
|
||||
publish_target="${1:-all}"
|
||||
require_root_for_publish "$publish_target"
|
||||
run_deploy_test_script "08-build-static-frontend.sh" "$@"
|
||||
run_deploy_test_script "00-init-tools.sh" nginx
|
||||
run_deploy_test_script "09-verify-static-frontends.sh"
|
||||
echo ""
|
||||
ok "静态前端发布完成: ${publish_target}"
|
||||
echo "已执行:"
|
||||
echo " 1. 构建 dist"
|
||||
echo " 2. 更新并重载 Nginx"
|
||||
echo " 3. 校验静态站点入口"
|
||||
echo "建议复查:"
|
||||
echo " ./deploy-test/status.sh"
|
||||
;;
|
||||
up)
|
||||
update_all_repos
|
||||
run_deploy_test_script "04-build.sh"
|
||||
|
||||
Reference in New Issue
Block a user