2026-04-12-1
This commit is contained in:
Executable
+44
@@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Configuration
|
||||
SERVER_IP="188.68.36.205"
|
||||
SERVER_USER="hamzadoctor"
|
||||
REMOTE_PATH="/home/hamzadoctor/app"
|
||||
KEY_PATH="/Users/hamzaaleghwairyeen/.ssh/doctory-key"
|
||||
|
||||
echo "🚀 Starting sync to server: $SERVER_IP..."
|
||||
|
||||
# Verify if the key exists
|
||||
if [ ! -f "$KEY_PATH" ]; then
|
||||
echo "⚠️ Warning: Identity file $KEY_PATH not found locally."
|
||||
echo "Attempting sync using default SSH configuration..."
|
||||
KEY_FLAG=""
|
||||
else
|
||||
KEY_FLAG="-i $KEY_PATH"
|
||||
fi
|
||||
|
||||
# Sync files using rsync (surgical sync)
|
||||
rsync -avz --progress $KEY_FLAG \
|
||||
--exclude 'infrastructure/osm-data' \
|
||||
--exclude 'osm-data' \
|
||||
--exclude 'venv' \
|
||||
--exclude '.git' \
|
||||
--exclude 'node_modules' \
|
||||
--exclude '.DS_Store' \
|
||||
.env \
|
||||
docker-compose.yml \
|
||||
apps \
|
||||
packages \
|
||||
infrastructure \
|
||||
$SERVER_USER@$SERVER_IP:$REMOTE_PATH/
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "✅ Sync successful!"
|
||||
echo "------------------------------------------------"
|
||||
echo "Now run the following on your SERVER terminal:"
|
||||
echo "cd $REMOTE_PATH"
|
||||
echo "docker-compose up -d --build api"
|
||||
echo "------------------------------------------------"
|
||||
else
|
||||
echo "❌ Sync failed. Please check your SSH connection or manually update the files."
|
||||
fi
|
||||
Reference in New Issue
Block a user