mirror of
https://github.com/YunoHost-Apps/matomo_ynh.git
synced 2024-09-03 19:45:56 +02:00
best use of new php-fpm helper
This commit is contained in:
parent
166addea13
commit
c752d184c5
4 changed files with 10 additions and 7 deletions
|
@ -27,11 +27,11 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
|
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DECLARE DATA AND CONF FILES TO BACKUP
|
# DECLARE DATA AND CONF FILES TO BACKUP
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_print_info --message="Declaring files to be backed up..."
|
ynh_print_info --message="Declaring files to be backed up..."
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -50,7 +50,7 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
# BACKUP THE PHP-FPM CONFIGURATION
|
# BACKUP THE PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/php/${YNH_PHP_VERSION}/fpm/pool.d/$app.conf"
|
ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP A CRON FILE
|
# BACKUP A CRON FILE
|
||||||
|
|
|
@ -98,6 +98,7 @@ ynh_script_progression --message="Configuring php-fpm..."
|
||||||
|
|
||||||
# Create a dedicated php-fpm config
|
# Create a dedicated php-fpm config
|
||||||
ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies"
|
ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies"
|
||||||
|
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC SETUP
|
# SPECIFIC SETUP
|
||||||
|
@ -106,7 +107,7 @@ ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencie
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Installing composer and dependencies..."
|
ynh_script_progression --message="Installing composer and dependencies..."
|
||||||
|
|
||||||
ynh_install_composer --phpversion="${YNH_PHP_VERSION}" --workdir="$final_path"
|
ynh_install_composer --phpversion="$phpversion" --workdir="$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP A CRON
|
# SETUP A CRON
|
||||||
|
|
|
@ -29,6 +29,7 @@ path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
db_user=$db_name
|
db_user=$db_name
|
||||||
|
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE RESTORED
|
# CHECK IF THE APP CAN BE RESTORED
|
||||||
|
@ -75,10 +76,10 @@ chown -R $app: $final_path
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE PHP-FPM CONFIGURATION
|
# RESTORE THE PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Restoring PHP-FPM configuration..."
|
ynh_script_progression --message="Restoring PHP-FPM configuration..."
|
||||||
|
|
||||||
# Restore the file first, so it can have a backup if different
|
# Restore the file first, so it can have a backup if different
|
||||||
ynh_restore_file --origin_path="/etc/php/${YNH_PHP_VERSION}/fpm/pool.d/$app.conf"
|
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
||||||
|
|
||||||
# Recreate a dedicated php-fpm config
|
# Recreate a dedicated php-fpm config
|
||||||
ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies"
|
ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies"
|
||||||
|
@ -116,7 +117,7 @@ ynh_restore_file --origin_path="/etc/cron.d/$app"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Reloading nginx web server and php-fpm..."
|
ynh_script_progression --message="Reloading nginx web server and php-fpm..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name=php${YNH_PHP_VERSION}-fpm --action=reload
|
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
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -121,6 +121,7 @@ ynh_script_progression --message="Upgrading php-fpm configuration..."
|
||||||
|
|
||||||
# Create a dedicated php-fpm config
|
# Create a dedicated php-fpm config
|
||||||
ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies"
|
ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies"
|
||||||
|
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC UPGRADE
|
# SPECIFIC UPGRADE
|
||||||
|
@ -129,7 +130,7 @@ ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencie
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Installating composer and dependencies..."
|
ynh_script_progression --message="Installating composer and dependencies..."
|
||||||
|
|
||||||
ynh_install_composer --phpversion="${YNH_PHP_VERSION}" --workdir=$final_path
|
ynh_install_composer --phpversion="$phpversion" --workdir="$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP A CRON
|
# SETUP A CRON
|
||||||
|
|
Loading…
Reference in a new issue