Add upgrade script
This commit is contained in:
parent
82b3895e00
commit
e9918816e5
2 changed files with 43 additions and 0 deletions
|
@ -37,6 +37,8 @@ USER root:root
|
||||||
RUN mkdir -p /var/log/pterodactyl
|
RUN mkdir -p /var/log/pterodactyl
|
||||||
COPY install.sh /usr/local/bin/install
|
COPY install.sh /usr/local/bin/install
|
||||||
RUN chmod +x /usr/local/bin/install
|
RUN chmod +x /usr/local/bin/install
|
||||||
|
COPY upgrade.sh /usr/local/bin/upgrade
|
||||||
|
RUN chmod +x /usr/local/bin/upgrade
|
||||||
COPY schedule /var/spoon/cron/crontabs/schedule
|
COPY schedule /var/spoon/cron/crontabs/schedule
|
||||||
COPY supervisord.conf /etc/supervisor/supervisord.conf
|
COPY supervisord.conf /etc/supervisor/supervisord.conf
|
||||||
COPY www.conf /usr/local/etc/php-fpm.d/www.conf
|
COPY www.conf /usr/local/etc/php-fpm.d/www.conf
|
||||||
|
|
41
services/php/upgrade.sh
Normal file
41
services/php/upgrade.sh
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
#!/bin/ash
|
||||||
|
|
||||||
|
##
|
||||||
|
# This is an install script to quickly upgrade Pterodactyl Panel. Before running,
|
||||||
|
# please BACK UP any important data!
|
||||||
|
##
|
||||||
|
if [ "$(whoami)" != "pterodactyl" ]; then
|
||||||
|
echo "Rerunning script as webserver user."
|
||||||
|
exec su -c /usr/local/bin/upgrade pterodactyl
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Are you sure you want to continue the upgrade script? (Y/n)"
|
||||||
|
read -n1 run
|
||||||
|
|
||||||
|
if [ "$run" = "Y" ]; then
|
||||||
|
echo "Running upgrade script."
|
||||||
|
php artisan down
|
||||||
|
|
||||||
|
# Change introduced in 0.7.0.
|
||||||
|
echo "Removing cached configuration."
|
||||||
|
rm -r bootstrap/cache/*
|
||||||
|
|
||||||
|
echo "Rerunning configuration scripts."
|
||||||
|
php artisan p:environment:setup --cache=redis --session=redis --queue=redis \
|
||||||
|
--redis-host=redis --redis-pass="" --redis-port=6379
|
||||||
|
|
||||||
|
echo "Removing cached views."
|
||||||
|
php artisan view:clear
|
||||||
|
|
||||||
|
echo "Running migrations."
|
||||||
|
php artisan migrate --force
|
||||||
|
php artisan db:seed --force
|
||||||
|
|
||||||
|
echo "Cleaning up API keys."
|
||||||
|
php artisan p:migration:clean-orphaned-keys
|
||||||
|
|
||||||
|
echo "Upgrade complete. Please restart the container to load changes."
|
||||||
|
php artisan up
|
||||||
|
else
|
||||||
|
echo "Exiting."
|
||||||
|
fi
|
Reference in a new issue