mirror of
https://github.com/YunoHost-Apps/wekan_ynh.git
synced 2024-09-03 20:36:09 +02:00
fix ynh_mongo_db
This commit is contained in:
parent
3b7535a79d
commit
5c93cb6583
4 changed files with 5 additions and 11 deletions
|
@ -5,10 +5,8 @@
|
|||
#=================================================
|
||||
|
||||
# dependencies used by the app
|
||||
pkg_dependencies="mongodb mongodb-server mongo-tools"
|
||||
pkg_dependencies_buster="mongodb-org mongodb-org-server mongodb-org-tools"
|
||||
mongodb_stretch="mongodb"
|
||||
mongodb_buster="mongod"
|
||||
pkg_dependencies=""
|
||||
|
||||
nodejsversion=12.16.3
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -76,6 +76,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port
|
|||
#=================================================
|
||||
ynh_script_progression --message="Installing dependencies..."
|
||||
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
ynh_install_nodejs --nodejs_version=$nodejsversion
|
||||
ynh_use_nodejs
|
||||
|
||||
|
@ -86,10 +87,6 @@ ynh_mongo_install
|
|||
#=================================================
|
||||
ynh_script_progression --message="Creating a MongoDB database..."
|
||||
|
||||
# Start mongodb
|
||||
systemctl enable $mongodb_servicename
|
||||
systemctl start $mongodb_servicename
|
||||
|
||||
# Registering db name
|
||||
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
||||
db_user=$db_name
|
||||
|
|
|
@ -86,6 +86,7 @@ find "$final_path" -type d -print0 | xargs -0 chmod 750
|
|||
ynh_script_progression --message="Reinstalling dependencies..."
|
||||
|
||||
# Define and install dependencies
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
ynh_install_nodejs --nodejs_version=$nodejsversion
|
||||
ynh_use_nodejs
|
||||
|
||||
|
@ -96,9 +97,6 @@ ynh_mongo_install
|
|||
#=================================================
|
||||
ynh_script_progression --message="Restoring the MongoDB database..."
|
||||
|
||||
# Start mongodb
|
||||
systemctl enable $mongodb_servicename
|
||||
systemctl start $mongodb_servicename
|
||||
db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
|
||||
ynh_mongo_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
|
||||
ynh_mongo_restore_db --database="$db_name" < ./dump.bson
|
||||
|
|
|
@ -176,6 +176,7 @@ ynh_add_nginx_config
|
|||
#=================================================
|
||||
ynh_script_progression --message="Upgrading dependencies..."
|
||||
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
ynh_remove_nodejs
|
||||
ynh_install_nodejs --nodejs_version=$nodejsversion
|
||||
ynh_use_nodejs
|
||||
|
|
Loading…
Reference in a new issue