From f631bf45a977bb17d49fa8dbd09736220deccf00 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 18 Feb 2020 23:06:11 +0100 Subject: [PATCH] Fix upgrade --- check_process | 3 +++ scripts/_common.sh | 2 +- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 18 ++++++++++++++++-- 5 files changed, 22 insertions(+), 5 deletions(-) diff --git a/check_process b/check_process index 25fbfda..54f979c 100644 --- a/check_process +++ b/check_process @@ -11,7 +11,10 @@ setup_private=1 setup_public=1 upgrade=1 + # 2.98 upgrade=1 from_commit=dab614bd7679f2f7978d1df2e360fba7ae0edfa4 + # 3.45 + upgrade=1 from_commit=ca58231e8488e09a2cb298f9c85e2f0387f238e6 backup_restore=1 multi_instance=1 # This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version. diff --git a/scripts/_common.sh b/scripts/_common.sh index c1ffb11..681c2d6 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,7 +6,7 @@ # dependencies used by the app pkg_dependencies="mongodb mongodb-server mongo-tools" -nodejs_version=12.15.0 +nodejsversion=12.15.0 #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index 53e71d6..cf27827 100755 --- a/scripts/install +++ b/scripts/install @@ -75,7 +75,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port #================================================= ynh_print_info --message="Installing dependencies..." -ynh_install_nodejs --nodejs_version=$nodejs_version +ynh_install_nodejs --nodejs_version=$nodejsversion ynh_use_nodejs ynh_install_app_dependencies $pkg_dependencies diff --git a/scripts/restore b/scripts/restore index c2943ad..cbf1c11 100644 --- a/scripts/restore +++ b/scripts/restore @@ -84,7 +84,7 @@ find "$final_path" -type d -print0 | xargs -0 chmod 750 ynh_print_info --message="Reinstalling dependencies..." # Define and install dependencies -ynh_install_nodejs --nodejs_version=$nodejs_version +ynh_install_nodejs --nodejs_version=$nodejsversion ynh_use_nodejs ynh_install_app_dependencies $pkg_dependencies diff --git a/scripts/upgrade b/scripts/upgrade index a7c1f55..81c0f89 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -73,15 +73,18 @@ ynh_abort_if_errors ynh_print_info --message="Managing upgrade from previous version..." if ynh_version_gt "0.45-2" "${previous_version}" ; then + ynh_print_info --message="Upgrading to 0.45-2..." ynh_replace_string --match_string="Environment=ROOT_URL=http://127.0.0.1:$port$path_url" --replace_string="Environment=ROOT_URL=https://$domain$path_url/" --target_file="/etc/systemd/system/$app.service" systemctl daemon-reload fi if ynh_version_gt "0.45-3" "${previous_version}" ; then + ynh_print_info --message="Upgrading to 0.45-3..." yunohost service add $app fi if ynh_version_gt "0.77-2" "${previous_version}" ; then + ynh_print_info --message="Upgrading to 0.77-2..." ynh_install_nodejs --nodejs_version="8.9.3" ynh_use_nodejs @@ -96,6 +99,7 @@ if ynh_version_gt "0.77-2" "${previous_version}" ; then fi if ynh_version_gt "1.07~ynh2" "${previous_version}" ; then + ynh_print_info --message="Upgrading to 1.07~ynh2..." # Replace mongodb packages # Assume no other app needs it >.> @@ -115,6 +119,7 @@ if ynh_version_gt "1.07~ynh2" "${previous_version}" ; then fi if ynh_version_gt "2.48~ynh1" "${previous_version}" ; then + ynh_print_info --message="Upgrading to 2.48~ynh1..." # Install dependencies ynh_remove_nodejs ynh_install_nodejs --nodejs_version="8.16.0" @@ -136,9 +141,10 @@ if ynh_version_gt "2.48~ynh1" "${previous_version}" ; then fi if ynh_version_gt "3.55~ynh1" "${previous_version}" ; then + ynh_print_info --message="Upgrading to 3.55~ynh1..." # Install dependencies ynh_remove_nodejs - ynh_install_nodejs --nodejs_version=$nodejs_version + ynh_install_nodejs --nodejs_version=$nodejsversion ynh_use_nodejs # Create a dedicated systemd config @@ -157,6 +163,14 @@ if ynh_version_gt "3.55~ynh1" "${previous_version}" ; then ynh_store_file_checksum "$config_file" fi +if ynh_version_gt "3.79~ynh1" "${previous_version}" ; then + ynh_print_info --message="Upgrading to 3.79~ynh1..." + # Install dependencies + ynh_remove_nodejs + ynh_install_nodejs --nodejs_version=$nodejsversion + ynh_use_nodejs +fi + #================================================= # CHECK THE PATH #================================================= @@ -214,7 +228,7 @@ ynh_add_nginx_config #================================================= ynh_print_info --message="Upgrading dependencies..." -ynh_install_nodejs --nodejs_version=$nodejs_version +ynh_install_nodejs --nodejs_version=$nodejsversion ynh_use_nodejs ynh_install_app_dependencies $pkg_dependencies