修改user端的项目文件到mini-user
CI / verify (pull_request) Has been cancelled

This commit is contained in:
2026-07-14 15:52:27 +08:00
parent e0f5977dd9
commit 9403d22544
8 changed files with 42 additions and 11 deletions
+21 -7
View File
@@ -41,7 +41,11 @@ corepack enable 2>/dev/null || true
corepack prepare pnpm@11.2.2 --activate 2>/dev/null || true
echo "==> 2. 安装依赖"
export NODE_OPTIONS="${NODE_OPTIONS:---max-old-space-size=2048}"
# mini-user H5Taro)构建峰值内存较高
export NODE_OPTIONS="${NODE_OPTIONS:---max-old-space-size=8192}"
# 生产部署 pathnginx 入口为 /user/
export TARO_H5_PUBLIC_PATH="${TARO_H5_PUBLIC_PATH:-/user/}"
export TARO_H5_ROUTER_BASENAME="${TARO_H5_ROUTER_BASENAME:-/user}"
pnpm approve-builds --all 2>/dev/null || true
pnpm install --frozen-lockfile 2>/dev/null || pnpm install
@@ -68,16 +72,26 @@ else
fi
if [[ "$SKIP_BUILD" == false ]]; then
echo "==> 4. 构建"
pnpm build
echo "==> 4. 构建C 端使用 mini-user H5,跳过 h5-user"
pnpm --filter @dukang/shared-types \
--filter @dukang/domain \
--filter @dukang/api \
--filter @dukang/mini-user \
--filter @dukang/h5-shop \
--filter @dukang/h5-partner \
--filter @dukang/admin-web \
build
else
echo "==> 4. 跳过构建"
fi
echo "==> 5. 重启 PM2"
if pm2 describe dukang-api &>/dev/null; then
pm2 restart dukang-api dukang-h5-user dukang-h5-shop dukang-h5-partner dukang-admin-web 2>/dev/null \
|| pm2 restart dukang-api dukang-h5-user dukang-h5-shop dukang-h5-partner
# delete+start 以确保 cwd 从 h5-user 切到 mini-user
pm2 delete dukang-h5-user 2>/dev/null || true
pm2 start "$DEPLOY_DIR/ecosystem.config.cjs" --only dukang-h5-user
pm2 restart dukang-api dukang-h5-shop dukang-h5-partner dukang-admin-web 2>/dev/null \
|| pm2 restart dukang-api dukang-h5-shop dukang-h5-partner
else
pm2 start "$DEPLOY_DIR/ecosystem.config.cjs"
fi
@@ -86,8 +100,8 @@ pm2 save
echo "==> 6. 健康检查"
sleep 2
pm2 list
ss -tlnp | grep -E '809[0-3]' || true
curl -sf -o /dev/null -w "h5-user: %{http_code}\n" http://127.0.0.1:8091/ || echo "h5-user: FAIL"
ss -tlnp | grep -E '809[0-4]' || true
curl -sf -o /dev/null -w "mini-user(h5): %{http_code}\n" http://127.0.0.1:8091/ || echo "mini-user(h5): FAIL"
curl -sf -o /dev/null -w "api: %{http_code}\n" http://127.0.0.1:8090/api/v1/health 2>/dev/null \
|| curl -sf -o /dev/null -w "api: %{http_code}\n" http://127.0.0.1:8090/ \
|| echo "api: FAIL"