From 5b53519e8d183e20e577864acf9af1a3317deb95 Mon Sep 17 00:00:00 2001 From: notplants Date: Sun, 5 Dec 2021 16:20:38 +0100 Subject: [PATCH] Fix upgrade script --- scripts/install | 6 ------ scripts/upgrade | 17 ++++++++++------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/scripts/install b/scripts/install index c91501a..53e907f 100755 --- a/scripts/install +++ b/scripts/install @@ -215,12 +215,6 @@ fi ynh_script_progression --message="Finishing Archivebox Setup" --weight=1 cd $datadir && ynh_exec_as $app $ynh_node_load_PATH $archivebox_cmd init --setup -#================================================= -# ADD A CONFIGURATION -#================================================= -# config files for archive box live in $data_dir/ArchiveBox.conf -# and are handled manually outside of YunoHost - #================================================= # SETUP SYSTEMD #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index b7ae57a..457288e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -26,6 +26,12 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) language=$(ynh_app_setting_get --app=$app --key=language) port=$(ynh_app_setting_get --app=$app --key=port) + +#================================================= +# SET CORRECT NODE VERSION +#================================================= +ynh_use_nodejs --nodejs_version=$nodejs_version + #================================================= # CHECK VERSION #================================================= @@ -93,6 +99,9 @@ fi datadir=/home/yunohost.app/$app +# debug message +ynh_script_progression --message="ynh_node_load_PATH: $ynh_node_load_PATH" --weight=1 + if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading via pip" --weight=1 @@ -114,7 +123,7 @@ then # rerun archivebox setup (its idempotent, so it should be ok during upgrade) ynh_script_progression --message="Finishing Archivebox Setup" --weight=1 - cd $datadir && ynh_exec_as $app $archivebox_cmd init --setup + cd $datadir && ynh_exec_as $app $ynh_node_load_PATH $archivebox_cmd init --setup fi chmod 750 "$final_path" @@ -129,12 +138,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# UPDATE A CONFIG FILE -#================================================= -# config files for archive box live in $data_dir/ArchiveBox.conf -# and are handled manually outside of YunoHost - #================================================= # SETUP SYSTEMD #=================================================