From 490814db06c5277eacfdb506065a47cefb2475c9 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 21 Aug 2023 16:39:18 +0200 Subject: [PATCH] Simplify regenconf hook handling --- .../98-nginx_garage => conf/regenconf_nginx_garage | 0 scripts/backup | 5 ----- scripts/install | 8 ++------ scripts/remove | 1 - scripts/restore | 1 - scripts/upgrade | 3 +++ sources/extra_files/app/.gitignore | 2 -- sources/patches/.gitignore | 2 -- 8 files changed, 5 insertions(+), 17 deletions(-) rename sources/hooks/conf_regen/98-nginx_garage => conf/regenconf_nginx_garage (100%) delete mode 100644 sources/extra_files/app/.gitignore delete mode 100644 sources/patches/.gitignore diff --git a/sources/hooks/conf_regen/98-nginx_garage b/conf/regenconf_nginx_garage similarity index 100% rename from sources/hooks/conf_regen/98-nginx_garage rename to conf/regenconf_nginx_garage diff --git a/scripts/backup b/scripts/backup index 3f1e253..6524c9b 100755 --- a/scripts/backup +++ b/scripts/backup @@ -32,8 +32,6 @@ ynh_backup --src_path="$install_dir" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" - - #================================================= # SPECIFIC BACKUP #================================================= @@ -54,9 +52,6 @@ ynh_backup --src_path="/usr/share/yunohost/hooks/conf_regen/98-nginx_$app" ynh_backup --src_path="/etc/systemd/system/$app.service" - -ynh_backup --src_path="/usr/share/yunohost/hooks/conf_regen/98-nginx_$app" - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/install b/scripts/install index a518790..1be7697 100755 --- a/scripts/install +++ b/scripts/install @@ -91,13 +91,9 @@ fi #================================================= # ADD REGEN-CONF HOOK #================================================= -ynh_script_progression --message="adding regen-conf hook..." --weight=1 - - ynh_add_config --template="../sources/hooks/conf_regen/98-nginx_garage" --destination="/usr/share/yunohost/hooks/conf_regen/98-nginx_$app" -#cp -R ../sources/hooks/conf_regen/98-nginx_garage /usr/share/yunohost/hooks/conf_regen/95-nginx_$app - -ynh_systemd_action --service_name=nginx --action="reload" +ynh_script_progression --message="Adding regen-conf hook..." --weight=1 +ynh_add_config --template="regenconf_nginx_garage" --destination="/usr/share/yunohost/hooks/conf_regen/98-nginx_$app" yunohost tools regen-conf nginx #================================================= diff --git a/scripts/remove b/scripts/remove index 0c1407f..ecbf940 100755 --- a/scripts/remove +++ b/scripts/remove @@ -114,7 +114,6 @@ ynh_secure_remove --file="/var/log/$app" ynh_secure_remove --file="/usr/share/yunohost/hooks/conf_regen/98-nginx_$app" yunohost tools regen-conf nginx -ynh_systemd_action --service_name=nginx --action="reload" #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 84f975b..29eadd6 100755 --- a/scripts/restore +++ b/scripts/restore @@ -63,7 +63,6 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/usr/share/yunohost/hooks/conf_regen/98-nginx_$app" yunohost tools regen-conf nginx -ynh_systemd_action --service_name=nginx --action="reload" #================================================= # RESTORE SYSTEMD diff --git a/scripts/upgrade b/scripts/upgrade index 1943280..1e120ae 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -45,6 +45,9 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." # Create a dedicated NGINX config ynh_add_nginx_config +ynh_add_config --template="regenconf_nginx_garage" --destination="/usr/share/yunohost/hooks/conf_regen/98-nginx_$app" +yunohost tools regen-conf nginx + #================================================= # SETUP SYSTEMD #================================================= diff --git a/sources/extra_files/app/.gitignore b/sources/extra_files/app/.gitignore deleted file mode 100644 index 783a4ae..0000000 --- a/sources/extra_files/app/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*~ -*.sw[op] diff --git a/sources/patches/.gitignore b/sources/patches/.gitignore deleted file mode 100644 index 783a4ae..0000000 --- a/sources/patches/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*~ -*.sw[op]