mirror of
https://github.com/idanoo/pixelfed-upgrade-script
synced 2025-07-01 05:42:16 +00:00
26 lines
862 B
Bash
Executable file
26 lines
862 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# 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"
|
|
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
|