chore: take deployment-specific material out of the repository for the first release
- MBU parity map, cutover runbook and the tasks/ planning notes move outside the repo - tests/mbu becomes tests/fixtures with generic application names and no placement inventory - test fixtures in Rust and web use neutral names - scripts/export-public.sh checks an external list of private terms instead of naming them Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,17 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build a clean, single-commit tree for the public repository. Nothing is pushed.
|
||||
# Usage: scripts/export-public.sh /path/to/empty-dir
|
||||
# Build a clean, single-commit tree of the current HEAD for a fresh public repository. Nothing is pushed.
|
||||
# Usage: [TESSERA_PRIVATE_TERMS=/path/to/terms.txt] scripts/export-public.sh /path/to/empty-dir
|
||||
#
|
||||
# TESSERA_PRIVATE_TERMS names a file, kept outside the repository, with one term per line (host names,
|
||||
# customer names, internal systems). If any of them occurs in the exported tree the export is refused.
|
||||
set -euo pipefail
|
||||
out="${1:?target directory}"
|
||||
[ -z "$(ls -A "$out" 2>/dev/null)" ] || { echo "target must be empty" >&2; exit 1; }
|
||||
root="$(git rev-parse --show-toplevel)"
|
||||
git -C "$root" diff --quiet HEAD || { echo "commit or stash first" >&2; exit 1; }
|
||||
git -C "$root" archive HEAD | tar -x -C "$out"
|
||||
# Deployment-specific and planning material stays in the private repository.
|
||||
rm -rf "$out/tasks" "$out/tests/mbu" "$out/docs/MBU-BACKUP-PARITY.md" "$out/docs/MBU-CUTOVER.md" "$out/floorplan" "$out/graft"
|
||||
if grep -rIlE "mbugroup|backup\.mbu|hafizh|senkensha\.space" "$out" --exclude-dir=node_modules --exclude=export-public.sh >/dev/null; then
|
||||
echo "private references remain:" >&2
|
||||
grep -rIlE "mbugroup|backup\.mbu|hafizh|senkensha\.space" "$out" --exclude-dir=node_modules --exclude=export-public.sh >&2
|
||||
exit 1
|
||||
if [ -n "${TESSERA_PRIVATE_TERMS:-}" ]; then
|
||||
if grep -rIl -i -F -f "$TESSERA_PRIVATE_TERMS" "$out" --exclude-dir=node_modules >/dev/null; then
|
||||
echo "private terms found in:" >&2
|
||||
grep -rIl -i -F -f "$TESSERA_PRIVATE_TERMS" "$out" --exclude-dir=node_modules >&2
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "note: TESSERA_PRIVATE_TERMS is not set, so no check for private terms was made" >&2
|
||||
fi
|
||||
echo "clean tree at $out; review it, then: git init && git add -A && git commit"
|
||||
|
||||
Reference in New Issue
Block a user