diff --git a/scripts/_common.sh b/scripts/_common.sh index b71abe9..d531f63 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -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 #================================================= diff --git a/scripts/install b/scripts/install index d237541..a405fbe 100755 --- a/scripts/install +++ b/scripts/install @@ -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 diff --git a/scripts/restore b/scripts/restore index bd1eaff..58b69dd 100644 --- a/scripts/restore +++ b/scripts/restore @@ -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 diff --git a/scripts/upgrade b/scripts/upgrade index b69cc76..0e7a51c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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