add flarum rollback scripts
This commit is contained in:
parent
1a8b6d60d6
commit
b5cebf05a2
6
rollback/flarum/config.env
Normal file
6
rollback/flarum/config.env
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
pac=
|
||||||
|
user=forum
|
||||||
|
db=${pac}_flarum
|
||||||
|
dbuser=${pac}_${user}
|
||||||
|
dump=$HOME/var/rollback/flarum.sql
|
||||||
|
domain=/home/doms/$(ls $HOME/doms) # Hostsharing eG specific
|
15
rollback/flarum/rollback.sh
Normal file
15
rollback/flarum/rollback.sh
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
source $HOME/scripts/config.env
|
||||||
|
|
||||||
|
cd $HOME/flarum
|
||||||
|
php ./flarum nearataMaintenanceMode:toggle true
|
||||||
|
|
||||||
|
echo "syncing data..."
|
||||||
|
rsync -aAX --delete $HOME/var/rollback/flarum/ $HOME/flarum/
|
||||||
|
|
||||||
|
echo "feeding the dump..."
|
||||||
|
mysql -u $dbuser $db < $dump
|
||||||
|
|
||||||
|
php ./flarum nearataMaintenanceMode:toggle false
|
22
rollback/flarum/setstate.sh
Normal file
22
rollback/flarum/setstate.sh
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
source $HOME/scripts/config.env
|
||||||
|
|
||||||
|
read -p "DANGER – everything will be made permanent. Proceed? (Yy)" -n 1 -r
|
||||||
|
echo
|
||||||
|
if [[ ! $REPLY =~ ^[Yy]$ ]]
|
||||||
|
then
|
||||||
|
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd $HOME/flarum
|
||||||
|
|
||||||
|
php ./flarum nearataMaintenanceMode:toggle true
|
||||||
|
|
||||||
|
echo "creating database dump..."
|
||||||
|
mysqldump -u$dbuser $db --add-drop-table > $dump
|
||||||
|
|
||||||
|
echo "syncing flarum..."
|
||||||
|
rsync -aAX --delete /home/pacs/$pac/users/$user/flarum/ /home/pacs/$pac/users/$user/var/rollback/flarum/
|
||||||
|
|
||||||
|
php ./flarum nearataMaintenanceMode:toggle false
|
18
rollback/flarum/update.sh
Normal file
18
rollback/flarum/update.sh
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "calling for rollback.sh"
|
||||||
|
. $HOME/scripts/rollback.sh
|
||||||
|
|
||||||
|
php ./flarum nearataMaintenanceMode:toggle true
|
||||||
|
|
||||||
|
composer update --prefer-dist --no-plugins --no-dev -a --with-all-dependencies
|
||||||
|
php flarum migrate
|
||||||
|
php flarum cache:clear
|
||||||
|
|
||||||
|
echo "calling setstate.sh to make the update permanent"
|
||||||
|
echo "the following prompt is an opportunity to check whether the forum is still operational."
|
||||||
|
. $HOME/scripts/setstate.sh
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "all scripts done."
|
Loading…
Reference in New Issue
Block a user