fpm config: cf YunoHost 11.2, remove the necessity to handle fpm_usage / footprint manually

This commit is contained in:
Alexandre Aubin 2023-07-24 16:11:17 +02:00
parent 827eea2939
commit 2d7a1239f0
3 changed files with 10 additions and 30 deletions

View file

@ -23,7 +23,7 @@ cpe = "???"
fund = "???"
[integration]
yunohost = ">= 11.1.21"
yunohost = ">= 11.2"
# FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"]
architectures = "all"
multi_instance = true

View file

@ -31,18 +31,13 @@ source /usr/share/yunohost/helpers
#
#=================================================
# RETRIEVE ARGUMENTS FROM THE MANIFEST
# INITIALIZE AND STORE SETTINGS
#=================================================
fpm_usage=low
fpm_footprint=low
#=================================================
# STORE SETTINGS FROM MANIFEST
#=================================================
ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
# If you need to, you can define custom settings
# (or remove this section entirely if not relevant for you)
foo="bar"
ynh_app_setting_set --app=$app --key=foo --value=$foo
#=================================================
# APP "BUILD" (DEPLOYING SOURCES, VENV, COMPILING ETC)
@ -70,7 +65,7 @@ ynh_script_progression --message="Adding system configurations related to $app..
### `ynh_add_fpm_config` is used to set up a PHP config.
### You can remove it if your app doesn't use PHP.
### `ynh_add_fpm_config` will use the files conf/php-fpm.conf
### `ynh_add_fpm_config` will use the files conf/extra_php-fpm.conf
### If you're not using these lines:
### - You can remove these files in conf/.
### - Remove the section "BACKUP THE PHP-FPM CONFIGURATION" in the backup script
@ -79,8 +74,8 @@ ynh_script_progression --message="Adding system configurations related to $app..
### with the reload at the end of the script.
### - And the section "PHP-FPM CONFIGURATION" in the upgrade script
# Create a dedicated PHP-FPM config using the conf/php-fpm.conf or conf/extra_php-fpm.conf
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
# Create a PHP-FPM config (with conf/extra_php-fpm.conf being appended to it)
ynh_add_fpm_config
# Create a dedicated NGINX config using the conf/nginx.conf template
ynh_add_nginx_config

View file

@ -55,21 +55,6 @@ upgrade_type=$(ynh_check_app_version_changed)
# ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir
#fi
### Use these functions if the package was released
### without "php fpm footprint" and you are implementing it
### Take values from 'install' script
#If fpm_footprint doesn't exist, create it
if [ -z "$fpm_footprint" ]; then
fpm_footprint=low
ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint
fi
# If fpm_usage doesn't exist, create it
if [ -z "$fpm_usage" ]; then
fpm_usage=low
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
fi
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
@ -103,7 +88,7 @@ ynh_script_progression --message="Upgrading system configurations related to $ap
# This should be a literal copypasta of what happened in the install's "System configuration" section
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
ynh_add_fpm_config
ynh_add_nginx_config