mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-19 09:51:37 +00:00
fix updater and add post-update (#213)
This commit is contained in:
parent
e3ea8f975f
commit
d9a791755e
2
scripts/post-update.sh
Normal file
2
scripts/post-update.sh
Normal file
@ -0,0 +1,2 @@
|
||||
# post-update script is here to cover extra commands in case of an update requires it.
|
||||
echo "Running post-update script..."
|
@ -1,23 +1,27 @@
|
||||
#!/bin/bash
|
||||
echo "Updating Vito..."
|
||||
|
||||
cd /home/vito/vito
|
||||
|
||||
php artisan down
|
||||
|
||||
echo "Pulling changes..."
|
||||
git fetch --all
|
||||
|
||||
git checkout $(git tag -l --merged 1.x --sort=-v:refname | head -n 1)
|
||||
echo "Checking out the latest tag..."
|
||||
NEW_RELEASE=$(git tag -l --merged 1.x --sort=-v:refname | head -n 1)
|
||||
git checkout "$NEW_RELEASE"
|
||||
|
||||
echo "Installing composer dependencies..."
|
||||
composer install --no-dev
|
||||
|
||||
echo "Running migrations..."
|
||||
php artisan migrate --force
|
||||
|
||||
php artisan config:clear
|
||||
php artisan cache:clear
|
||||
php artisan view:clear
|
||||
|
||||
php artisan config:cache
|
||||
echo "Optimizing..."
|
||||
php artisan optimize:clear
|
||||
php artisan optimize
|
||||
|
||||
echo "Restarting workers..."
|
||||
sudo supervisorctl restart worker:*
|
||||
|
||||
php artisan up
|
||||
bash scripts/post-update.sh
|
||||
|
||||
echo "Vito updated successfully to $NEW_RELEASE! 🎉"
|
||||
|
Loading…
x
Reference in New Issue
Block a user