- build.sh:构建源改 ~/docker_apps/blog/build-repo(fetch+reset 硬跟
origin/main,匿名 fetch)——线上=远端 main 确定性闭环,Sveltia 保存
即自动上线生效;stamp 记录构建 commit;node_modules 留仓内做增量
(loader 逻辑变更时须清 node_modules/.astro——EXIF 教训已注)
- en/archives/index.astro 补缺(此前 404):PostList locale 复用 +
译题映射;三级目录 import 深度坑再犯一次(已修)
验证: bash infra/deploy/build.sh → staging 29 html @0e792a7(裸 clone
实测);build 本地 28+1 页;E2E 30/30 PASS
Spec: 2026-10-25_add-blog-5c
Co-authored-by: GLM-5.3
24 lines
1.1 KiB
Bash
Executable File
24 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Lighthouse 移动端真测:对本地 staging 五页跑分(Phase 5c T3)。
|
|
# 走 pnpm dlx 而非装进 devDependencies:本车道边界只有本目录与产物,不动 package.json。
|
|
# 用法:run.sh [staging基址,默认 http://127.0.0.1:18743] [产物目录,默认 /tmp/e2e-shots/lighthouse]
|
|
set -euo pipefail
|
|
BASE="${1:-http://127.0.0.1:18743}"
|
|
OUT="${2:-/tmp/e2e-shots/lighthouse}"
|
|
DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
# Playwright 的 chromium 复用为 lighthouse 引擎(无系统 Chrome 依赖)
|
|
export CHROME_PATH="${CHROME_PATH:-$HOME/.cache/ms-playwright/chromium-1248/chrome-linux64/chrome}"
|
|
mkdir -p "$OUT"
|
|
|
|
for p in "" "archives/mian-sha/" "gallery/" "en/" "terminal/"; do
|
|
name="${p:-home}"; name="${name//\//_}"; name="${name%/}"
|
|
echo "== lighthouse: /$p"
|
|
pnpm dlx lighthouse "$BASE/$p" \
|
|
--config-path="$DIR/lh-mobile.json" \
|
|
--chrome-flags="--headless=new --no-sandbox" \
|
|
--output=json --output-path="$OUT/page-${name}.json" \
|
|
--quiet >/dev/null || echo "WARN: /$p 未完成(产物可能缺失)"
|
|
done
|
|
|
|
python3 "$DIR/summarize.py" "$OUT"
|