From 16975c2fd278d2da428d7ba5068346a4c8785a6e Mon Sep 17 00:00:00 2001 From: JensDiemer Date: Wed, 24 Aug 2022 08:04:05 +0200 Subject: [PATCH] unify ynh_script_progression --- scripts/change_url | 6 +++--- scripts/install | 12 ++++++------ scripts/remove | 2 +- scripts/restore | 4 ++-- scripts/upgrade | 8 ++++---- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 5bb62fb..ed3d59b 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -83,7 +83,7 @@ fi #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping systemd services..." +ynh_script_progression --message="Stopping systemd service '$app'..." ynh_systemd_action --service_name="$app" --action="stop" @@ -123,7 +123,7 @@ fi #================================================= # MODIFY SETTINGS #================================================= -ynh_script_progression --message="Modify django-fmd's config file..." +ynh_script_progression --message="Modify $app config file..." ynh_add_config --template="settings.py" --destination="$final_path/settings.py" @@ -132,7 +132,7 @@ ynh_add_config --template="settings.py" --destination="$final_path/settings.py" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting systemd services..." --weight=5 +ynh_script_progression --message="Starting systemd service '$app'..." --weight=5 ynh_systemd_action --service_name="$app" --action="start" diff --git a/scripts/install b/scripts/install index 751ca6f..bf74d35 100755 --- a/scripts/install +++ b/scripts/install @@ -72,7 +72,7 @@ ynh_app_setting_set --app="$app" --key=default_from_email --value="$default_from #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing dependencies..." --weight=20 +ynh_script_progression --message="Installing $app dependencies..." --weight=20 ynh_exec_warn_less ynh_install_app_dependencies "$pkg_dependencies" @@ -103,7 +103,7 @@ ynh_add_nginx_config "public_path" "port" #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Configuring system user..." +ynh_script_progression --message="Configuring system user '$app'..." # A home directory for venv and settings etc. ynh_system_user_create --username="$app" --home_dir="$final_path" --use_shell @@ -140,7 +140,7 @@ ynh_script_progression --message="Install project via pip..." --weight=45 #================================================= # copy config files # ================================================ -ynh_script_progression --message="Create project configuration files..." +ynh_script_progression --message="Create $app configuration files..." ynh_add_config --template="gunicorn.conf.py" --destination="$final_path/gunicorn.conf.py" @@ -188,7 +188,7 @@ ynh_use_logrotate "$log_file" #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description="Web based management to catalog things" --log="${log_file}" +yunohost service add $app --description="$app service" --log="${log_file}" #================================================= # GENERIC FINALIZATION @@ -208,7 +208,7 @@ chmod o-rwx "$final_path" #================================================= # SETUP SYSTEMD #================================================= -ynh_script_progression --message="Configuring a systemd service..." +ynh_script_progression --message="Configuring systemd service '$app'..." --weight=5 # https://yunohost.org/en/contribute/packaging_apps/helpers # https://github.com/YunoHost/yunohost/blob/dev/helpers/systemd @@ -230,7 +230,7 @@ fi #================================================= # Start the app server via systemd #================================================= -ynh_script_progression --message="Starting the application..." --weight=5 +ynh_script_progression --message="Starting systemd service '$app'..." --weight=5 ynh_systemd_action --service_name="$app" --action="start" diff --git a/scripts/remove b/scripts/remove index 5e630a4..dc573b8 100755 --- a/scripts/remove +++ b/scripts/remove @@ -36,7 +36,7 @@ fi #================================================= # STOP PYINVENTORY'S SERVICES #================================================= -ynh_script_progression --message="Stopping and removing systemd services..." --weight=5 +ynh_script_progression --message="Stopping and removing systemd service '$app'..." --weight=5 ynh_remove_systemd_config --service="$app" diff --git a/scripts/restore b/scripts/restore index 0401327..355e1de 100755 --- a/scripts/restore +++ b/scripts/restore @@ -48,7 +48,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." +ynh_script_progression --message="Restoring $app main directory..." ynh_restore_file --origin_path="$final_path" ynh_restore_file --origin_path="$public_path" @@ -158,7 +158,7 @@ chmod o-rwx "$final_path" #================================================= # START PYINVENTORY #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=5 +ynh_script_progression --message="Starting systemd service '$app'..." --weight=5 ynh_systemd_action --service_name="$app" --action="start" diff --git a/scripts/upgrade b/scripts/upgrade index 08bb3a3..f7f6384 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -58,7 +58,7 @@ fi #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=40 +ynh_script_progression --message="Backing up $app before upgrading (may take a while)..." --weight=40 # Backup the current version of the app ynh_backup_before_upgrade @@ -74,7 +74,7 @@ ynh_abort_if_errors #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping systemd services..." --weight=5 +ynh_script_progression --message="Stopping systemd service '$app'..." --weight=5 ynh_systemd_action --service_name="$app" --action="stop" @@ -108,7 +108,7 @@ ynh_system_user_create --username="$app" --home_dir="$final_path" --use_shell #================================================= # SETUP SYSTEMD #================================================= -ynh_script_progression --message="Configuring a systemd service..." +ynh_script_progression --message="Configuring a systemd service '$app'..." --weight=5 ynh_add_systemd_config --service="$app" --template="systemd.service" @@ -209,7 +209,7 @@ chmod o-rwx "$final_path" #================================================= # Start the app server via systemd #================================================= -ynh_script_progression --message="Starting the application..." --weight=5 +ynh_script_progression --message="Starting systemd service '$app'..." --weight=5 ynh_systemd_action --service_name="$app" --action="start"