#!/bin/bash # ════════════════════════════════════════════════════════════ # مُصادَق (Musadaq) — Production Synchronization Script # ════════════════════════════════════════════════════════════ # Usage: ./sync-to-server.sh "Your commit message" # ════════════════════════════════════════════════════════════ COMMIT_MESSAGE=$1 if [ -z "$COMMIT_MESSAGE" ] then COMMIT_MESSAGE="🚀 Musadaq deployment sync: $(date)" fi # ── 1. Push to Git ────────────────────────────────────────── echo "📤 Pushing changes to remote repository..." git add . git commit -m "$COMMIT_MESSAGE" git push origin main # ── 2. Deploy to Production ───────────────────────────────── # Update the variables below with your VPS credentials SERVER_USER="root" SERVER_IP="intaleqapp.com" # Or your Contabo IP PROJECT_DIR="/var/www/musadeq" echo "🌐 Synchronizing with production server ($SERVER_IP)..." ssh $SERVER_USER@$SERVER_IP << EOF cd $PROJECT_DIR echo "⬇️ Pulling latest changes..." git pull origin main echo "🏗️ Rebuilding production containers..." docker compose up -d --build echo "✅ Deployment successful!" EOF echo "✨ Sync completed successfully!"