From 95f2d2b78000e0512f3ae93548e48275d29f4088 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 26 Jul 2022 21:05:19 +0200 Subject: [PATCH 1/3] fix mongo version --- scripts/_common.sh | 4 ++-- scripts/upgrade | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index ce634ac..8170e19 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,11 +6,11 @@ nodejs_version=14 +mongo_version=5.0 + # dependencies used by the app pkg_dependencies="apt-transport-https build-essential gzip curl fontconfig graphicsmagick" -YNH_MONGO_VERSION=4.4 - #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 4ebd4e3..ea52458 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -25,11 +25,11 @@ port=$(ynh_app_setting_get --app=$app --key=port) password=$(ynh_app_setting_get --app=$app --key=password) admin=$(ynh_app_setting_get --app=$app --key=admin) email=$(ynh_app_setting_get --app=$app --key=email) +mongo_version=$(ynh_app_setting_get --app=$app --key=mongo_version) #================================================= # CHECK VERSION #================================================= -ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) @@ -75,6 +75,12 @@ if ynh_legacy_permissions_exists; then ynh_app_setting_delete --app=$app --key=is_public fi +# If mongo_version doesn't exist, create it +if [ -z "$mongo_version" ]; then + mongo_version="$(mongod --version | grep -oP 'db version v\K.{0,3}')" + ynh_app_setting_set --app=$app --key=mongo_version --value=$mongo_version +fi + #================================================= # CREATE DEDICATED USER #================================================= @@ -107,7 +113,7 @@ ynh_script_progression --message="Upgrading dependencies..." --weight=7 ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version -ynh_exec_warn_less ynh_install_mongo +ynh_exec_warn_less ynh_install_mongo --mongo_version=$mongo_version ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" #================================================= From af5e535390dab076bc74da51bbd6897bc0088f47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 26 Jul 2022 21:08:00 +0200 Subject: [PATCH 2/3] Fix --- scripts/install | 2 +- scripts/restore | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index eac10b7..c2e34c4 100644 --- a/scripts/install +++ b/scripts/install @@ -79,7 +79,7 @@ ynh_script_progression --message="Installing dependencies..." --weight=20 ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version -ynh_exec_warn_less ynh_install_mongo +ynh_exec_warn_less ynh_install_mongo --mongo_version=$mongo_version ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" #================================================= diff --git a/scripts/restore b/scripts/restore index c8df5a2..b4f28d8 100644 --- a/scripts/restore +++ b/scripts/restore @@ -32,6 +32,7 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name +mongo_version=$(ynh_app_setting_get --app=$app --key=mongo_version) #================================================= # CHECK IF THE APP CAN BE RESTORED @@ -72,7 +73,7 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=1 # Define and install dependencies ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version -ynh_exec_warn_less ynh_install_mongo +ynh_exec_warn_less ynh_install_mongo --mongo_version=$mongo_version ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" #================================================= From 73223feb2c25950a1952508d26632125efb3cb74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 26 Jul 2022 23:28:43 +0200 Subject: [PATCH 3/3] Update app.src --- conf/app.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/app.src b/conf/app.src index cd3b68e..a8b5527 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ SOURCE_URL=https://releases.rocket.chat/5.0.0/download -SOURCE_SUM=5acd6cb786e19c6feceef2897860052dc002d0288e561987ff6334fe9198de5b +SOURCE_SUM=2622a5501d0ad46d0b943bad6385f4aecab7b3333ae48d028c42863545901d9c SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true