#!/bin/bash ## ## ⚠️ DEPRECATED - Use scripts/deploy.sh instead ## ## This script is deprecated in favor of the unified deployment script. ## The new script provides: ## - Automatic cache versioning (update-cache-version.js) ## - Auto-commit of cache changes (no more manual loops) ## - Frontend-only mode (--frontend-only flag) ## - Better security and validation ## ## Migration: ## OLD: ./scripts/deploy-frontend.sh ## NEW: ./scripts/deploy.sh --frontend-only ## ## See: scripts/deploy.sh for full documentation ## echo "⚠️ WARNING: This script is deprecated" echo "Please use: ./scripts/deploy.sh --frontend-only" echo "" read -p "Continue with deprecated script anyway? (yes/NO): " continue_deprecated if [ "$continue_deprecated" != "yes" ]; then echo "Cancelled. Use ./scripts/deploy.sh --frontend-only instead." exit 1 fi # Deploy Frontend with Automatic Cache Busting # Ensures users always get latest JS/CSS without manual cache clearing set -e TIMESTAMP=$(date +%s) DEPLOY_KEY="/home/theflow/.ssh/tractatus_deploy" REMOTE_USER="ubuntu" REMOTE_HOST="vps-93a693da.vps.ovh.net" REMOTE_PATH="/var/www/tractatus/public" echo "=== Frontend Deployment with Cache Busting ===" echo "" echo "Timestamp: $TIMESTAMP" echo "" # Update cache-busting version in all HTML files echo "Updating cache-busting versions..." find public -name "*.html" -type f | while read -r file; do # Update script tags - match .js followed by anything (including ?v=digits) before closing quote sed -i "s|\(src=\"[^\"]*\.js\)[^\"]*\"|\1?v=${TIMESTAMP}\"|g" "$file" # Update link tags (CSS) - same pattern sed -i "s|\(href=\"[^\"]*\.css\)[^\"]*\"|\1?v=${TIMESTAMP}\"|g" "$file" echo " ✓ Updated: $file" done echo "" echo "Deploying to production..." # Deploy all public files rsync -avz --delete \ -e "ssh -i $DEPLOY_KEY" \ --exclude='node_modules' \ --exclude='.git' \ public/ ${REMOTE_USER}@${REMOTE_HOST}:${REMOTE_PATH}/ echo "" echo "=== Deployment Complete ===" echo "" echo "All users will receive new version: $TIMESTAMP" echo "No cache clearing required!" echo "" echo "Test URL: https://agenticgovernance.digital"