From 1aa9296625b1c9b0b52e7773143945ad7fb8438d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Fri, 21 Jun 2024 10:45:45 +0200 Subject: [PATCH] Fix upgrade (missing build), cleanup install and remove nodejs on remove --- scripts/install | 3 +-- scripts/remove | 7 +++++++ scripts/upgrade | 20 ++++++++++++++++++-- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index bafefa6..5df8375 100755 --- a/scripts/install +++ b/scripts/install @@ -64,14 +64,13 @@ ynh_add_systemd_config yunohost service add "$app" --description="Fider Feedback platform" --log="/var/log/$app/$app.log" # Use logrotate to manage application logfile(s) -ynh_use_logrotate --nonappend +ynh_use_logrotate #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -# Start a systemd service ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/$app.log" #================================================= diff --git a/scripts/remove b/scripts/remove index 05971e7..b5ecb84 100755 --- a/scripts/remove +++ b/scripts/remove @@ -28,6 +28,13 @@ ynh_remove_nginx_config ynh_remove_nodejs +#================================================= +# REMOVE DEPENDENCIES +#================================================= +ynh_script_progression --message="Removing dependencies..." --weight=1 + +ynh_remove_nodejs + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 20d9a3c..b32478d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -30,24 +30,40 @@ if [ -d "/opt/yunohost/$app" ]; then mv "/opt/yunohost/$app" "$install_dir" fi +#================================================= +# UPDATE DEPENDENCIES +#================================================= +ynh_script_progression --message="Updating dependencies..." --weight=1 + +ynh_exec_warn_less ynh_install_go --go_version=$go_version +ynh_use_go + +ynh_install_nodejs --nodejs_version=$nodejs_version + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep="run_fider" +ynh_setup_source --dest_dir="$install_dir/sources" --full_replace=1 chmod -R o-rwx "$install_dir" chown -R "$app:www-data" "$install_dir" +#================================================= +# DOWNLOAD, CHECK AND UNPACK SOURCE +#================================================= +ynh_script_progression --message="Compiling Fider application..." --weight=1 + +ynh_exec_warn_less build_fider + #================================================= # UPDATE A CONFIG FILE #================================================= ynh_script_progression --message="Updating $app's configuration file..." --weight=1 ynh_add_config --template="run_fider" --destination="$install_dir/run_fider" - chown "$app:www-data" "$install_dir/run_fider" chmod 744 "$install_dir/run_fider"