From 6c132730a59b0b5b2a112abc76380b40057a8435 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 24 Jun 2021 14:58:47 +0200 Subject: [PATCH] Add redis-server --- conf/parameters.yml.dist | 2 +- scripts/_common.sh | 2 ++ scripts/install | 7 +++++++ scripts/remove | 8 ++++++++ scripts/restore | 8 ++++++++ scripts/upgrade | 7 +++++++ 6 files changed, 33 insertions(+), 1 deletion(-) diff --git a/conf/parameters.yml.dist b/conf/parameters.yml.dist index 97f194e..4c7cbfa 100644 --- a/conf/parameters.yml.dist +++ b/conf/parameters.yml.dist @@ -65,7 +65,7 @@ parameters: # Redis processing redis_scheme: tcp - redis_host: localhost + redis_host: 127.0.0.1 redis_port: 6379 redis_path: null redis_password: null diff --git a/scripts/_common.sh b/scripts/_common.sh index 93b407e..9ba6dbc 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -9,6 +9,8 @@ YNH_PHP_VERSION="7.3" # dependencies used by the app extra_php_dependencies="php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-tidy php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-gettext php${YNH_PHP_VERSION}-redis" +pkg_dependencies="redis-server redis-tools" + #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index ccdf6b4..26a174f 100644 --- a/scripts/install +++ b/scripts/install @@ -47,6 +47,13 @@ ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=admin --value=$admin +#================================================= +# INSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing dependencies..." --weight=1 + +ynh_install_app_dependencies $pkg_dependencies + #================================================= # CREATE A MYSQL DATABASE #================================================= diff --git a/scripts/remove b/scripts/remove index c9f814c..5ff1af7 100644 --- a/scripts/remove +++ b/scripts/remove @@ -31,6 +31,14 @@ ynh_script_progression --message="Removing the MySQL database" --weight=2 # Remove a database if it exists, along with the associated user ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name +#================================================= +# REMOVE DEPENDENCIES +#================================================= +ynh_script_progression --message="Removing dependencies..." --weight=1 + +# Remove metapackage and its dependencies +ynh_remove_app_dependencies + #================================================= # REMOVE APP MAIN DIR #================================================= diff --git a/scripts/restore b/scripts/restore index 22fa388..b0845a9 100644 --- a/scripts/restore +++ b/scripts/restore @@ -96,6 +96,14 @@ ynh_restore_file "/etc/fail2ban/filter.d/$app.conf" ynh_systemd_action --action=reload --service_name=fail2ban # Reload instead of restart for better performance +#================================================= +# REINSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Reinstalling dependencies..." --weight=1 + +# Define and install dependencies +ynh_install_app_dependencies $pkg_dependencies + #================================================= # RESTORE THE MYSQL DATABASE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 5f6ffb7..323c497 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -117,6 +117,13 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated nginx config ynh_add_nginx_config +#================================================= +# UPGRADE DEPENDENCIES +#================================================= +ynh_script_progression --message="Upgrading dependencies..." --weight=1 + +ynh_install_app_dependencies $pkg_dependencies + #================================================= # PHP-FPM CONFIGURATION #=================================================