#!/usr/bin/env bash set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" cd "$ROOT" ts="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" safe_ts="$(date -u +"%Y-%m-%dT%H-%M-%SZ")" note="${1:-}" mkdir -p out/checkpoints echo "== running ci ==" >&2 ci_json="$(./scripts/ci.sh)" echo "$ci_json" > "out/checkpoints/ci_${safe_ts}.json" tar_path="out/checkpoints/iftypeset_checkpoint_${safe_ts}.tar.gz" echo "== creating snapshot ${tar_path} ==" >&2 tar \ --exclude=".git" \ --exclude=".venv" \ --exclude="out" \ -czf "$tar_path" \ .forgejo .gitignore README.md STATUS.md app docs fixtures forgejo pyproject.toml requirements.txt scripts spec src tests tools sha="$(sha256sum "$tar_path" | awk '{print $1}')" cat > "out/checkpoints/checkpoint_${safe_ts}.md" < docs/CHECKPOINTS.md <<'EOF' # Checkpoints Durable restore points for this repo (useful when chat context resets). How to create a checkpoint: - `./scripts/checkpoint.sh "short note about what changed"` Each entry records the snapshot tarball path + sha256 and the CI JSON for that moment. EOF fi cat >> docs/CHECKPOINTS.md <&2