- git 仓只进压缩版(构建用);原图落 ~/docker_apps/blog/photos-originals/
(迁移器/ingest 双入口写入,幂等),build.sh 独立 rsync 到
staging/photos-originals/(同一静态根,零 nginx 改动)
- lightbox 增「原图」(新标签全尺寸)+「下载」(download 属性带文件名)
- 原图持久保障:store + Phase 0 备份 tar 双留档;存量 21 张已回填(196M)
验证: astro build 11 页 exit 0;dist/gallery 含 lb-original×2 与
photos-originals 引用;staging/photos-originals 21 张实测
Spec: none (用户功能补req:原图查看/下载,跨 Phase 独立小特性)
Co-authored-by: GLM-5.3
21 lines
937 B
Bash
21 lines
937 B
Bash
#!/bin/sh
|
||
# 构建管线:gitea push(main) → webhook → 本脚本 → dist rsync 到 www-staging
|
||
# Phase 1:真实 astro build;webhook 侧 HMAC 验签仍留 Phase 4 实装(见 webhook-receive.sh)
|
||
set -e
|
||
REPO_DIR="$HOME/Code/Github/my-blog" # Phase 4 构建机改裸 clone 路径
|
||
STAGING="$HOME/docker_apps/blog/www-staging"
|
||
|
||
echo "[build] pnpm install --frozen-lockfile + astro build"
|
||
cd "$REPO_DIR"
|
||
pnpm install --frozen-lockfile >/dev/null
|
||
pnpm astro build
|
||
|
||
echo "[build] rsync -> $STAGING"
|
||
mkdir -p "$STAGING"
|
||
rsync -a --delete "$REPO_DIR/dist/" "$STAGING/"
|
||
# 原图仓独立同步(不进 git/dist):/photos-originals/ 供图库"查看原图/下载"
|
||
ORIG="$HOME/docker_apps/blog/photos-originals"
|
||
if [ -d "$ORIG" ]; then rsync -a "$ORIG/" "$STAGING/photos-originals/"; fi
|
||
printf 'built at %s\n' "$(date -Is)" > "$STAGING/.build-stamp"
|
||
echo "[build] done: $(find "$STAGING" -name '*.html' | wc -l) html files"
|