diff --git a/README.md b/README.md index 7a6ca75..3e117c9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ # pixelfed-upgrade-script -A simple upgrade script to update pixelfed via cron nightly. -Simple set the Configuration values at the top and run this script when you want things updated. +A simple upgrade script to update pixelfed via cron nightly. + diff --git a/update.sh b/update.sh index 7538318..02557ff 100755 --- a/update.sh +++ b/update.sh @@ -3,18 +3,10 @@ # CONFIGURATION # WEB_ROOT=/var/www/pixelfed WEB_USER=www-data -HORIZON_SERVICE=horizon.service # END CONFIGURATION # set +x -# We want to su into web user, so lets be root -if [ "$EUID" -ne 0 ] - then echo "Please run as root" - exit -fi - -# Run the stuff su - $WEB_USER -s /bin/bash -c "cd $WEB_ROOT && git pull" su - $WEB_USER -s /bin/bash -c "cd $WEB_ROOT && composer install --no-ansi --no-dev --no-interaction --no-progress --no-scripts --optimize-autoloader" su - $WEB_USER -s /bin/bash -c "cd $WEB_ROOT && composer dump-autoload --optimize" @@ -22,5 +14,8 @@ su - $WEB_USER -s /bin/bash -c "cd $WEB_ROOT && php artisan config:cache" su - $WEB_USER -s /bin/bash -c "cd $WEB_ROOT && php artisan route:cache" su - $WEB_USER -s /bin/bash -c "cd $WEB_ROOT && php artisan migrate --force" -# Make sure we restart Horizon workers too -systemctl restart $HORIZON_SERVICE +# Make sure we restart workers on new code too +sudo systemctl restart horizon.service + +#su - $WEB_USER -s /bin/bash -c "cd $WEB_ROOT && php artisan horizon:purge" +#su - $WEB_USER -s /bin/bash -c "cd $WEB_ROOT && php artisan storage:link"