Monorepo for Aesthetic.Computer aesthetic.computer
at main 35 lines 1.1 kB view raw
1#!/bin/bash 2# Sync ac-source files to oven and prewarm the bundle cache. 3# Called automatically after git push (via .git/hooks/post-push) 4# or manually: ./oven/sync-source.sh 5 6set -e 7 8OVEN_HOST="137.184.237.166" 9SSH_KEY="${SSH_KEY:-$(dirname "$0")/../aesthetic-computer-vault/oven/ssh/oven-deploy-key}" 10SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" 11AC_SOURCE="$SCRIPT_DIR/../system/public/aesthetic.computer" 12 13# Only sync if SSH key exists (skip in CI or environments without vault) 14if [ ! -f "$SSH_KEY" ]; then 15 echo "⏭️ Skipping oven sync (no SSH key at $SSH_KEY)" 16 exit 0 17fi 18 19echo "📦 Syncing ac-source to oven..." 20rsync -az --delete \ 21 --include='*/' \ 22 --include='*.mjs' \ 23 --include='*.js' \ 24 --include='*.json' \ 25 --include='*.lisp' \ 26 --exclude='*' \ 27 -e "ssh -i $SSH_KEY -o StrictHostKeyChecking=no" \ 28 "$AC_SOURCE/" \ 29 "root@$OVEN_HOST:/opt/oven/ac-source/" 30 31echo "🔥 Prewarming bundle cache..." 32ssh -i "$SSH_KEY" -o StrictHostKeyChecking=no "root@$OVEN_HOST" \ 33 "curl -s -X POST http://localhost:3002/bundle-prewarm --max-time 120" 2>/dev/null || true 34 35echo "✅ Oven bundle cache updated."