diff --git a/README.md b/README.md index b06f6c5..91eb145 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in WeKan ® is an completely Open Source and Free software collaborative kanban board application with MIT license. -**Shipped version:** 6.28~ynh2 +**Shipped version:** 6.28~ynh4 **Demo:** https://demo.sandstorm.io/appdemo/m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h diff --git a/README_fr.md b/README_fr.md index 17f5049..a5003bb 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour WeKan ® est une application de tableau kanban collaborative entièrement libre et open source avec une licence MIT. -**Version incluse :** 6.28~ynh2 +**Version incluse :** 6.28~ynh4 **Démo :** https://demo.sandstorm.io/appdemo/m86q05rdvj14yvn78ghaxynqz7u2svw6rnttptxx49g1785cdv1h diff --git a/manifest.json b/manifest.json index 2ef9653..20d2994 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Trello-like kanban", "fr": "Un kanban similaire à Trello" }, - "version": "6.28~ynh2", + "version": "6.28~ynh4", "url": "https://wekan.github.io", "upstream": { "license": "MIT", diff --git a/scripts/ynh_mongo_db__2 b/scripts/ynh_mongo_db__2 index 879c9c1..c2ad66a 100644 --- a/scripts/ynh_mongo_db__2 +++ b/scripts/ynh_mongo_db__2 @@ -1,10 +1,9 @@ #!/bin/bash -MONGO_CE_SERVICENAME="mongod" -MONGO_CE_DEPENDENCIES="mongodb-org mongodb-org-server mongodb-org-tools mongodb-mongosh" -MONGO_CE_CONFIG="/etc/mongod.conf" -MONGO_CE_REPO="deb http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0 main" -MONGO_CE_KEY="https://www.mongodb.org/static/pgp/server-5.0.asc" +readonly YNH_DEFAULT_MONGO_VERSION=4.4 +# Declare the actual MongoDB version to use: 4.4 ; 5.0 +# A packager willing to use another version of MongoDB can override the variable into its _common.sh. +YNH_MONGO_VERSION=${YNH_MONGO_VERSION:-$YNH_DEFAULT_MONGO_VERSION} # Execute a mongo command # @@ -300,21 +299,33 @@ ynh_mongo_remove_db() { # Install MongoDB and integrate MongoDB service in YunoHost # -# usage: ynh_install_mongo +# usage: ynh_install_mongo [--mongo_version=mongo_version] +# | arg: -m, --mongo_version= - Version of MongoDB to install # # ynh_install_mongo() { + # Declare an array to define the options of this helper. + local legacy_args=m + local -A args_array=([m]=mongo_version=) + local mongo_version + # Manage arguments with getopts + ynh_handle_getopts_args "$@" + mongo_version="${mongo_version:-$YNH_MONGO_VERSION}" + ynh_print_info --message="Installing MongoDB Community Edition..." - ynh_install_extra_app_dependencies --repo="$MONGO_CE_REPO" --package="$MONGO_CE_DEPENDENCIES" --key="$MONGO_CE_KEY" - mongodb_servicename=$MONGO_CE_SERVICENAME - + ynh_install_extra_app_dependencies --repo="deb http://repo.mongodb.org/apt/debian buster/mongodb-org/$mongo_version main" --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 + # Make sure MongoDB is started and enabled systemctl enable $mongodb_servicename --quiet systemctl daemon-reload --quiet ynh_systemd_action --service_name=$mongodb_servicename --action=restart --line_match="aiting for connections" --log_path="/var/log/mongodb/$mongodb_servicename.log" - + # Integrate MongoDB service in YunoHost yunohost service add $mongodb_servicename --description="MongoDB daemon" --log="/var/log/mongodb/$mongodb_servicename.log" + + # Store mongo_version into the config of this app + ynh_app_setting_set --app=$app --key=mongo_version --value=$mongo_version } # Remove MongoDB @@ -329,7 +340,7 @@ ynh_remove_mongo() { if ! ynh_package_is_installed --package="mongodb*" then ynh_print_info --message="Removing MongoDB service..." - mongodb_servicename=$MONGO_CE_SERVICENAME + mongodb_servicename=mongod # Remove the mongodb service yunohost service remove $mongodb_servicename ynh_secure_remove --file="/var/lib/mongodb"