From f5da82f804d7406ff065e02a2285fa2a2ba38cfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 27 Jun 2022 14:22:15 +0200 Subject: [PATCH] Fix --- scripts/install | 5 ++--- scripts/remove | 4 ++-- scripts/restore | 12 +++++------- scripts/upgrade | 4 ++++ 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/scripts/install b/scripts/install index 9fc1369..16aea8e 100755 --- a/scripts/install +++ b/scripts/install @@ -84,9 +84,9 @@ ynh_script_progression --message="Configuring system user..." --weight=1 ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= -# CREATE A POSTGRESQL DATABASE +# CREATE A DATABASE #================================================= -ynh_script_progression --message="Creating a PostgreSQL database..." --weight=2 +ynh_script_progression --message="Creating a database..." --weight=2 db_name=$(ynh_sanitize_dbid --db_name=$app) db_user=$db_name @@ -136,7 +136,6 @@ pushd $final_path ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn update-db popd - #================================================= # SETUP SYSTEMD #================================================= diff --git a/scripts/remove b/scripts/remove index b337ab2..5490de6 100755 --- a/scripts/remove +++ b/scripts/remove @@ -52,9 +52,9 @@ ynh_script_progression --message="Removing logrotate configuration..." --weight= ynh_remove_logrotate #================================================= -# REMOVE THE POSTGRESQL DATABASE +# REMOVE THE DATABASE #================================================= -ynh_script_progression --message="Removing the PostgreSQL database..." --weight=2 +ynh_script_progression --message="Removing the database..." --weight=2 # Remove a database if it exists, along with the associated user ynh_psql_remove_db --db_user=$db_user --db_name=$db_name diff --git a/scripts/restore b/scripts/restore index b6834eb..ec542e4 100755 --- a/scripts/restore +++ b/scripts/restore @@ -76,6 +76,9 @@ ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies # Install Nodejs ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version +# Install Yarn +ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" + #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= @@ -84,14 +87,9 @@ ynh_script_progression --message="Restoring the NGINX web server configuration.. ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= -# RESTORE THE MYSQL DATABASE +# RESTORE THE DATABASE #================================================= -ynh_script_progression --message="Restoring the MySQL database..." --time --weight=1 - -#================================================= -# RESTORE THE POSTGRESQL DATABASE -#================================================= -ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=6 +ynh_script_progression --message="Restoring the database..." --weight=6 ynh_psql_test_if_first_run ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd diff --git a/scripts/upgrade b/scripts/upgrade index 62a67ac..1464a37 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -81,10 +81,14 @@ chown -R $app:www-data "$final_path" ynh_script_progression --message="Upgrading dependencies..." --weight=10 ynh_install_app_dependencies $pkg_dependencies + # Install Nodejs ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_use_nodejs +# Install Yarn +ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" + #================================================= # NGINX CONFIGURATION #=================================================