glam/infrastructure/sync-schemas.sh
kempersc a4184cb805 feat(infra): add webhook-based schema deployment pipeline
- Add FastAPI webhook receiver for Forgejo push events
- Add setup script for server deployment
- Add Caddy snippet for webhook endpoint
- Add local sync-schemas.sh helper script
- Sync frontend schemas with source (archived deprecated slots)

Infrastructure scripts staged for optional webhook deployment.
Current deployment uses: ./infrastructure/deploy.sh --frontend
2026-01-10 21:45:02 +01:00

32 lines
870 B
Bash
Executable file

#!/bin/bash
# Sync LinkML schemas from source to frontend public directory
# This ensures the frontend serves the latest schemas during development and in production builds
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
SOURCE_DIR="$PROJECT_ROOT/schemas/20251121/linkml"
DEST_DIR="$PROJECT_ROOT/frontend/public/schemas/20251121/linkml"
echo "Syncing LinkML schemas..."
echo " Source: $SOURCE_DIR"
echo " Dest: $DEST_DIR"
# Ensure destination directory exists
mkdir -p "$DEST_DIR"
# Rsync with delete to remove old files
rsync -av --delete \
--exclude "*.pyc" \
--exclude "__pycache__" \
--exclude ".git" \
"$SOURCE_DIR/" \
"$DEST_DIR/"
echo "Schema sync complete!"
# Count files synced
TOTAL=$(find "$DEST_DIR" -type f -name "*.yaml" | wc -l | tr -d ' ')
echo " Total YAML files: $TOTAL"