1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/friendica_ynh.git synced 2024-09-03 18:36:14 +02:00

Merge pull request #112 from orhtej2/patch-1

Use console.php for entering/exiting maintenance mode.
This commit is contained in:
eric_G 2024-02-10 15:46:45 +01:00 committed by GitHub
commit fe4078a6f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 4 deletions

View file

@ -15,7 +15,9 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
ynh_print_info --message="Declaring files to be backed up..." ynh_print_info --message="Declaring files to be backed up..."
(cd $install_dir && ynh_exec_as "$app" php$phpversion bin/console maintenance 1) (cd $install_dir && ynh_exec_as "$app" php$phpversion bin/console.php maintenance 1)
trap "(cd $install_dir && ynh_exec_as "$app" php$phpversion bin/console.php maintenance 0)" EXIT
#================================================= #=================================================
# BACKUP THE APP MAIN DIR # BACKUP THE APP MAIN DIR
@ -61,8 +63,6 @@ ynh_print_info --message="Backing up the MySQL database..."
ynh_mysql_dump_db --database="$db_name" > db.sql ynh_mysql_dump_db --database="$db_name" > db.sql
(cd $install_dir && ynh_exec_as "$app" php$phpversion bin/console maintenance 0)
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================

View file

@ -57,6 +57,13 @@ ynh_systemd_action --service_name=php$phpversion-fpm --action=reload
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
#==============
# FINALIZATION
#==============
# exit maintenance mode since the app was backed up while in maintenance mode
(cd $install_dir && ynh_exec_as "$app" php$phpversion bin/console.php maintenance 0)
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================

View file

@ -65,7 +65,7 @@ ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failreg
# Run Composer # Run Composer
pushd "$install_dir" pushd "$install_dir"
ynh_exec_as "$app" php$phpversion bin/composer.phar install --no-dev --quiet ynh_exec_as "$app" php$phpversion bin/composer.phar install --no-dev --quiet
ynh_exec_as "$app" php$phpversion bin/console dbstructure update ynh_exec_as "$app" php$phpversion bin/console.php dbstructure update
popd popd
#================================================= #=================================================