Final deployment test
This commit is contained in:
@@ -23,23 +23,25 @@ git push origin main
|
|||||||
# Update the variables below with your VPS credentials
|
# Update the variables below with your VPS credentials
|
||||||
SERVER_USER="root"
|
SERVER_USER="root"
|
||||||
SERVER_IP="194.163.173.157" # Contabo VPS
|
SERVER_IP="194.163.173.157" # Contabo VPS
|
||||||
PROJECT_DIR="/home/intaleqapp-musadeq/htdocs"
|
PROJECT_DIR="/home/intaleqapp-musadeq/htdocs/musadeq.intaleqapp.com"
|
||||||
|
|
||||||
echo "🌐 Synchronizing with production server ($SERVER_IP)..."
|
echo "🌐 Synchronizing with production server ($SERVER_IP)..."
|
||||||
|
|
||||||
ssh $SERVER_USER@$SERVER_IP << EOF
|
ssh $SERVER_USER@$SERVER_IP << EOF
|
||||||
git config --global --add safe.directory $PROJECT_DIR
|
|
||||||
mkdir -p $PROJECT_DIR
|
|
||||||
cd $PROJECT_DIR
|
cd $PROJECT_DIR
|
||||||
|
git config --global --add safe.directory $PROJECT_DIR
|
||||||
|
|
||||||
if [ ! -d ".git" ]; then
|
if [ ! -d ".git" ]; then
|
||||||
echo "🌑 Initializing production repository (Force setup in non-empty dir)..."
|
echo "🌑 Initializing production repository (Force setup in non-empty dir)..."
|
||||||
git init
|
git init
|
||||||
|
git config --global --add safe.directory $PROJECT_DIR
|
||||||
git remote add origin https://git.intaleqapp.com/Hamza/musadeq.git
|
git remote add origin https://git.intaleqapp.com/Hamza/musadeq.git
|
||||||
git fetch --all
|
git fetch --all
|
||||||
git reset --hard origin/main
|
git reset --hard origin/main
|
||||||
else
|
else
|
||||||
echo "⬇️ Pulling latest changes from Git..."
|
echo "⬇️ Pulling latest changes from Git..."
|
||||||
|
# In case remote was lost or ownership changed
|
||||||
|
git remote add origin https://git.intaleqapp.com/Hamza/musadeq.git 2>/dev/null
|
||||||
git pull origin main
|
git pull origin main
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user