Files
digital-psychology/scripts/deploy-h5.sh
T
jackyu66gitandCursor 57687de360 feat(h5): 小程序原生顶栏 + 本地联调与一键部署
nh=1 隐藏 H5 顶栏并由 cover 承载 logo;H5 仅 4px 顶距避免重复留白。新增 dev:mp、deploy:h5 与联调文档。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-25 01:38:32 +08:00

27 lines
781 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# 构建并 rsync 上传 user-h5 dist(配置见 deploy.env.example
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT"
ENV_FILE="${DEPLOY_ENV:-$ROOT/deploy.env}"
if [ ! -f "$ENV_FILE" ]; then
echo "缺少 $ENV_FILE — 请复制 deploy.env.example 为 deploy.env 并填写服务器信息" >&2
exit 1
fi
# shellcheck disable=SC1090
source "$ENV_FILE"
: "${H5_DEPLOY_USER:?在 deploy.env 设置 H5_DEPLOY_USER}"
: "${H5_DEPLOY_HOST:?在 deploy.env 设置 H5_DEPLOY_HOST}"
: "${H5_DEPLOY_PATH:?在 deploy.env 设置 H5_DEPLOY_PATH}"
echo ">>> build h5"
npm run build:h5
DEST="${H5_DEPLOY_USER}@${H5_DEPLOY_HOST}:${H5_DEPLOY_PATH}/"
echo ">>> rsync → $DEST"
rsync -avz --delete "${ROOT}/apps/user-h5/dist/" "$DEST"
echo ">>> done"