- webhook-receive.sh:HMAC 骨架 + 仅 main 分支触发(干跑验证两条 ref 路径)
- build.sh:锁发布链形态与路径约定,astro 命令留 Phase 1 TODO
- rollback-dryrun.sh:回滚四前置条件验证 + 人为操作手册(秒级回 18090)
- staging 落用户区 ~/docker_apps/blog/www-staging(宿主 sudo 不可用,nginx 以 root 读用户目录无碍)
验证: webhook 干跑 main accepted / non-main ignored;rollback-dryrun
四要素 ok(halo vhost/容器/响应/staging)
Co-authored-by: GLM-5.3
16 lines
759 B
Bash
16 lines
759 B
Bash
#!/bin/sh
|
|
# 构建管线骨架(Phase 0 占位,Phase 1 填充真实命令)
|
|
#
|
|
# 发布链:gitea push(main) → webhook → 本脚本 → 构建产物 rsync 到 www-staging
|
|
# → nginx 切换/生效。Phase 0 只锁形态与路径约定,不引入 Astro 依赖。
|
|
set -e
|
|
REPO_DIR="$HOME/Code/Github/my-blog" # Phase 4 改为构建机上的裸 clone
|
|
STAGING="$HOME/docker_apps/blog/www-staging"
|
|
|
|
echo "[build] placeholder: Phase 1 将在此执行 astro build"
|
|
# TODO(phase1): cd "$REPO_DIR" && pnpm install --frozen-lockfile && pnpm build
|
|
# TODO(phase1): rsync -a --delete "$REPO_DIR/dist/" "$STAGING/"
|
|
mkdir -p "$STAGING"
|
|
printf 'staging placeholder built at %s\n' "$(date -Is)" > "$STAGING/index.html"
|
|
echo "[build] staging updated: $STAGING"
|