mirror of
https://github.com/idanoo/pixelfed-upgrade-script
synced 2025-07-02 22:32:17 +00:00
Compare commits
No commits in common. "main" and "0.0.1" have entirely different histories.
2 changed files with 7 additions and 12 deletions
|
@ -1,4 +1,4 @@
|
||||||
# pixelfed-upgrade-script
|
# pixelfed-upgrade-script
|
||||||
|
|
||||||
A simple upgrade script to update pixelfed via cron nightly.
|
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.
|
|
||||||
|
|
15
update.sh
15
update.sh
|
@ -3,18 +3,10 @@
|
||||||
# CONFIGURATION #
|
# CONFIGURATION #
|
||||||
WEB_ROOT=/var/www/pixelfed
|
WEB_ROOT=/var/www/pixelfed
|
||||||
WEB_USER=www-data
|
WEB_USER=www-data
|
||||||
HORIZON_SERVICE=horizon.service
|
|
||||||
# END CONFIGURATION #
|
# END CONFIGURATION #
|
||||||
|
|
||||||
set +x
|
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 && 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 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 && 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 route:cache"
|
||||||
su - $WEB_USER -s /bin/bash -c "cd $WEB_ROOT && php artisan migrate --force"
|
su - $WEB_USER -s /bin/bash -c "cd $WEB_ROOT && php artisan migrate --force"
|
||||||
|
|
||||||
# Make sure we restart Horizon workers too
|
# Make sure we restart workers on new code too
|
||||||
systemctl restart $HORIZON_SERVICE
|
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"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue