Global upgrade

This commit is contained in:
Maniack Crudelis
2019-02-10 15:02:38 +01:00
parent 57cceced5d
commit 05d5511136
9 changed files with 114 additions and 28 deletions

View File

@@ -23,6 +23,7 @@ ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
ynh_print_info "Load settings"
app=$YNH_APP_INSTANCE_NAME
@@ -51,12 +52,14 @@ ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================
ynh_print_info "Restore the app main directory"
ynh_restore_file "$final_path"
#=================================================
# RECREATE THE DEDICATED USER
#=================================================
ynh_print_info "Recreate the dedicated user"
# Create the dedicated user (if not existing)
ynh_system_user_create $app
@@ -79,6 +82,7 @@ ynh_restore_file "/etc/php/7.0/fpm/pool.d/$app.conf"
#=================================================
# REINSTALL DEPENDENCIES
#=================================================
ynh_print_info "Reinstall dependencies"
# Define and install dependencies
ynh_install_app_dependencies deb1 deb2
@@ -86,6 +90,7 @@ ynh_install_app_dependencies deb1 deb2
#=================================================
# RESTORE THE MYSQL DATABASE
#=================================================
ynh_print_info "Restore the mysql database"
db_pwd=$(ynh_app_setting_get $app mysqlpwd)
ynh_mysql_setup_db $db_name $db_name $db_pwd
@@ -94,6 +99,7 @@ ynh_mysql_connect_as $db_name $db_pwd $db_name < ./db.sql
#=================================================
# RESTORE SYSTEMD
#=================================================
ynh_print_info "Restore the systemd configuration"
ynh_restore_file "/etc/systemd/system/$app.service"
systemctl enable $app.service
@@ -121,6 +127,13 @@ ynh_restore_file "/etc/logrotate.d/$app"
#=================================================
# RELOAD NGINX AND PHP-FPM
#=================================================
ynh_print_info "Reload nginx and php-fpm"
systemctl reload php7.0-fpm
systemctl reload nginx
#=================================================
# END OF SCRIPT
#=================================================
ynh_print_info "Restoration completed"