This directory contains automation scripts for Synapse DB development.
Complete development environment setup
./scripts/setup.sh
What it does:
When to use: First-time setup or setting up a new machine
Time: ~10-15 minutes
Install Git hooks for code quality
./scripts/install-hooks.sh
What it does:
hooks/ to .git/hooks/When to use:
Time: < 1 second
Run all CI checks locally before pushing
./scripts/pre-push-check.sh
What it does:
cargo fmt)cargo clippy)cargo test)cargo-audit installed)When to use:
Time: ~2-10 seconds (depends on cache)
Generate changelog from git commits
./scripts/generate-changelog.sh
What it does:
git-cliff if not presentCHANGELOG.md from git historybook/changelog.mdWhen to use:
Time: < 5 seconds
Requirements: Commits must follow Conventional Commits
# 1. Clone repository
git clone https://github.com/aaronberkhoff/synapse-db.git
cd synapse-db
# 2. Run setup (only needed once)
./scripts/setup.sh
# 3. Start developing!
cargo run
# 1. Make changes to code
# 2. Commit (hooks run automatically)
git commit -m "feat: add new feature"
# 3. Before pushing, run checks
./scripts/pre-push-check.sh
# 4. Push if all checks pass
git push
# 1. Update version in Cargo.toml
# 2. Generate changelog
./scripts/generate-changelog.sh
# 3. Review and commit changelog
git add CHANGELOG.md book/changelog.md
git commit -m "docs: update changelog for v0.2.0"
# 4. Create and push tag
git tag v0.2.0
git push origin v0.2.0
# CI will automatically build and release
# After pulling changes that updated hooks
./scripts/install-hooks.sh
When adding new scripts to this directory:
chmod +x scripts/my-script.sh
#!/bin/bash
set -e # Exit on error
#!/bin/bash
# Description: What this script does
set -e
# Color codes
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m'
# Helper functions
print_status() {
if [ $1 -eq 0 ]; then
echo -e "${GREEN}โ${NC} $2"
else
echo -e "${RED}โ${NC} $2"
exit 1
fi
}
# Main script logic
echo "Starting my script..."
# Do something
result=$?
print_status $result "Task completed"
Error: permission denied
Solution:
chmod +x scripts/script-name.sh
Error: scripts/script-name.sh: No such file or directory
Solution: Ensure youโre in the repository root:
cd /path/to/synapse-db
./scripts/script-name.sh
Error: Git hooks not running
Solution:
./scripts/install-hooks.sh
Error: Check failures
Solution:
# Format code
cargo fmt
# Fix clippy issues
cargo clippy --fix
# Run again
./scripts/pre-push-check.sh
Scripts may respect these environment variables:
CARGO_HOME - Cargo installation directory (default: ~/.cargo)RUSTUP_HOME - Rustup installation directoryScripts require:
Optional dependencies (installed by setup.sh):
To test scripts without running them:
# Check syntax
bash -n scripts/script-name.sh
# Dry run (if supported)
./scripts/script-name.sh --dry-run
These scripts are also used in GitHub Actions workflows:
setup.sh - Not used in CI (CI has its own setup)install-hooks.sh - Not used in CI (no git operations)pre-push-check.sh - Similar checks run in CIgenerate-changelog.sh - Used in docs workflowSee .github/workflows/ for CI configurations.
set -e - Exit on first errorWhen modifying scripts:
Last Updated: 2026-01-22