Files
probably-rendering-one-more…/tests/release-mode.sh
T
codex-bot b67574f950
PROMPT Docker CI and deployment / verify-and-deploy (push) Successful in 5m36s
Add cached Web-only releases through existing Docker runtime
2026-10-23 19:45:26 +08:00

44 lines
1.6 KiB
Bash

#!/usr/bin/env bash
# Policy regression: a shared/API/dependency change must never take the Web shortcut.
set -Eeuo pipefail
SCRIPT=$(cd "$(dirname "$0")/.." && pwd)/scripts/release-mode.sh
FIXTURE=$(mktemp -d)
trap 'rm -rf "$FIXTURE"' EXIT
cd "$FIXTURE"
git init -q
git config user.name 'Codex Bot'
git config user.email 'codex-bot@gitea.entroia.local'
mkdir -p src/pages/api src/components src/lib public
for file in src/pages/index.tsx src/pages/api/feed.ts src/components/Feed.tsx src/lib/model.ts package-lock.json public/llms.txt; do echo initial > "$file"; done
git add .
git commit -qm baseline
BASE=$(git rev-parse HEAD)
check(){ local expected="$1" actual; actual=$(bash "$SCRIPT" "$BASE"); test "$actual" = "$expected" || { echo "Expected $expected, received $actual"; exit 1; }; }
echo page >> src/pages/index.tsx
git commit -qam page
check web
# The comparison must include ALL changes since the deployed release, not just HEAD^.
echo shared >> src/lib/model.ts
git commit -qam shared
echo component >> src/components/Feed.tsx
git commit -qam component
check full
git reset -q --hard "$BASE"
echo api >> src/pages/api/feed.ts
git commit -qam api
check full
git reset -q --hard "$BASE"
git mv src/lib/model.ts public/model.ts
git commit -qm rename
check full
git reset -q --hard "$BASE"
echo lock >> package-lock.json
git commit -qam dependencies
check full
git reset -q --hard "$BASE"
echo markdown >> public/llms.txt
git commit -qam public-content
check web
test "$(bash "$SCRIPT" 0000000000000000000000000000000000000000)" = full
echo 'Release policy: page/public shortcut, shared/API/dependencies/rename/missing baseline fallback passed'