mirror of
https://github.com/YunoHost-Apps/overleaf_ynh.git
synced 2024-09-03 19:56:27 +02:00
mongo version compatible bookworm but for now let still install 4.0 for avx-less servers
This commit is contained in:
parent
172101ba74
commit
524c13f3b6
1 changed files with 206 additions and 211 deletions
|
@ -4,7 +4,7 @@
|
||||||
# COMMON VARIABLES
|
# COMMON VARIABLES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
nodejs_version="18.20.2"
|
nodejs_version=18.20.2
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# PERSONAL HELPERS
|
# PERSONAL HELPERS
|
||||||
|
@ -103,7 +103,7 @@ ynh_mongo_exec() {
|
||||||
database=""
|
database=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mongosh --quiet --username $user --password $password --authenticationDatabase $authenticationdatabase --host $host --port $port <<EOF
|
mongo --quiet $user $password $authenticationdatabase $host $port <<EOF
|
||||||
$database
|
$database
|
||||||
${command}
|
${command}
|
||||||
quit()
|
quit()
|
||||||
|
@ -117,7 +117,7 @@ EOF
|
||||||
database=""
|
database=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mongosh --quiet $database --username $user --password $password --authenticationDatabase $authenticationdatabase --host $host --port $port --eval="$command"
|
mongo --quiet $database $user $password $authenticationdatabase $host $port --eval="$command"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -326,23 +326,19 @@ ynh_install_mongo() {
|
||||||
ynh_handle_getopts_args "$@"
|
ynh_handle_getopts_args "$@"
|
||||||
mongo_version="${mongo_version:-$YNH_MONGO_VERSION}"
|
mongo_version="${mongo_version:-$YNH_MONGO_VERSION}"
|
||||||
|
|
||||||
debian=$(lsb_release --codename --short)
|
|
||||||
|
|
||||||
ynh_print_info --message="Installing MongoDB Community Edition..."
|
ynh_print_info --message="Installing MongoDB Community Edition..."
|
||||||
local mongo_debian_release=$(ynh_get_debian_release)
|
local mongo_debian_release=bullseye #$(ynh_get_debian_release)
|
||||||
|
|
||||||
if [ "$mongo_debian_release" == buster ] ; then
|
if [[ $(cat /proc/cpuinfo) != *"avx"* && "$mongo_version" != "4.4" ]]; then
|
||||||
ubuntu_version="bionic"
|
ynh_print_warn --message="Installing Mongo 4.4 as $mongo_version is not compatible with your CPU (see https://docs.mongodb.com/manual/administration/production-notes/#x86_64)."
|
||||||
elif [ "$mongo_debian_release" == bullseye ] ; then
|
mongo_version="4.4"
|
||||||
ubuntu_version="focal"
|
fi
|
||||||
elif [ "$mongo_debian_release" == bookworm ] ; then
|
if [[ "$mongo_version" == "4.4" && "$mongo_debian_release" != "buster" ]]; then
|
||||||
ubuntu_version="jammy"
|
ynh_print_warn --message="Switched to Buster install as Mongo 4.4 is not compatible with $mongo_debian_release."
|
||||||
|
mongo_debian_release=buster
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ynh_install_extra_app_dependencies \
|
ynh_install_extra_app_dependencies --repo="deb http://repo.mongodb.org/apt/debian $mongo_debian_release/mongodb-org/$mongo_version main" --package="mongodb-org-server mongodb-org-shell mongodb-database-tools" --key="https://www.mongodb.org/static/pgp/server-$mongo_version.asc"
|
||||||
--repo="deb https://repo.mongodb.org/apt/ubuntu $ubuntu_version/mongodb-org/$mongo_version multiverse" \
|
|
||||||
--package="mongodb-org mongodb-org-server mongodb-org-tools mongodb-mongosh" \
|
|
||||||
--key="https://www.mongodb.org/static/pgp/server-$mongo_version.asc"
|
|
||||||
mongodb_servicename=mongod
|
mongodb_servicename=mongod
|
||||||
|
|
||||||
# Make sure MongoDB is started and enabled
|
# Make sure MongoDB is started and enabled
|
||||||
|
@ -378,7 +374,6 @@ ynh_remove_mongo() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# FUTURE OFFICIAL HELPERS
|
# FUTURE OFFICIAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
Loading…
Reference in a new issue