Skip to content

Commit

Permalink
Merge pull request #112 from orhtej2/patch-1
Browse files Browse the repository at this point in the history
Use console.php for entering/exiting maintenance mode.
  • Loading branch information
ericgaspar authored Feb 10, 2024
2 parents 3d29774 + 9aaece6 commit fe4078a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 3 additions & 3 deletions scripts/backup
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ source /usr/share/yunohost/helpers
#=================================================
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
Expand Down Expand Up @@ -61,8 +63,6 @@ ynh_print_info --message="Backing up the MySQL database..."

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
#=================================================
Expand Down
7 changes: 7 additions & 0 deletions scripts/restore
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ ynh_systemd_action --service_name=php$phpversion-fpm --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
#=================================================
Expand Down
2 changes: 1 addition & 1 deletion scripts/upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failreg
# Run Composer
pushd "$install_dir"
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

#=================================================
Expand Down

0 comments on commit fe4078a

Please sign in to comment.