Files
vito/scripts/update.sh
Saeed Vaziry a3db7cbc85 fix installer
2025-06-21 12:43:46 +02:00

34 lines
658 B
Bash
Executable File

echo "Updating Vito..."
cd /home/vito/vito
echo "Pulling changes..."
git fetch --all
echo "Checking out the latest tag..."
NEW_RELEASE=$(git tag -l "2.*" --sort=-v:refname | head -n 1)
git checkout "$NEW_RELEASE"
git pull origin "$NEW_RELEASE"
echo "Installing composer dependencies..."
composer install --no-dev
echo "Installing npm packages..."
npm install
npm run build
echo "Running migrations..."
php artisan migrate --force
echo "Optimizing..."
php artisan optimize:clear
php artisan optimize
echo "Restarting workers..."
sudo supervisorctl restart worker:*
bash scripts/post-update.sh
echo "Vito updated successfully to $NEW_RELEASE! 🎉"