From eae5bac60aba51e814cb05441c6b1553b6678622 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Thu, 11 May 2023 20:48:12 +0200 Subject: [PATCH] fixes en refacto --- manifest.toml | 3 --- scripts/backup | 10 ---------- scripts/install | 9 +++++---- scripts/restore | 10 +--------- scripts/upgrade | 8 +++++--- 5 files changed, 11 insertions(+), 29 deletions(-) diff --git a/manifest.toml b/manifest.toml index fa61535..95848a3 100644 --- a/manifest.toml +++ b/manifest.toml @@ -10,7 +10,6 @@ version = "1.5.0~ynh1" maintainers = ["Thovi98"] [upstream] -# NB: Only the "license" key is mandatory. Remove entries for which there's no relevant data license = "MIT" code = "https://github.com/Fallenbagel/jellyseerr" @@ -56,7 +55,5 @@ ram.runtime = "50M" main.default = 5055 [resources.apt] - packages = "mariadb-server" [resources.database] - type = "mysql" diff --git a/scripts/backup b/scripts/backup index deb913a..a0b70e5 100755 --- a/scripts/backup +++ b/scripts/backup @@ -53,16 +53,6 @@ ynh_backup --src_path="/etc/logrotate.d/$app" ynh_backup --src_path="/etc/systemd/system/$app.service" -#================================================= -# BACKUP THE MYSQL DATABASE -#================================================= -ynh_print_info --message="Backing up the MySQL database..." - -### (However, things like MySQL dumps *do* take some time to run, though the -### copy of the generated dump to the archive still happens later) - -ynh_mysql_dump_db --database="$db_name" > db.sql - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/install b/scripts/install index 36c35db..4cffbb1 100755 --- a/scripts/install +++ b/scripts/install @@ -46,13 +46,16 @@ ynh_add_nginx_config #================================================= # BUILD APP #================================================= -ynh_script_progression --message="Building app... This may take quiete some time" --weight=30 pushd $install_dir ynh_use_nodejs + + ynh_script_progression --message="Fetching Yarn dev dependencies... This can be very long, be patient !" --weight=18 ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --network-timeout=30000 + + ynh_script_progression --message="Building Yarn dev dependencies... This can be very long, be patient !" --weight=25 ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn run build -#ynh_exec_warn_less yarn start + popd chmod 750 "$install_dir" @@ -105,8 +108,6 @@ ynh_script_progression --message="Starting a systemd service..." ynh_exec_warn_less ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="Starting Overseer version" - - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 36e0390..b29b501 100755 --- a/scripts/restore +++ b/scripts/restore @@ -25,7 +25,6 @@ ynh_npm install --global yarn #================================================= ynh_script_progression --message="Restoring the app main directory..." --weight=1 -ynh_use_nodejs ynh_restore_file --origin_path="$install_dir" # $install_dir will automatically be initialized with some decent @@ -43,12 +42,6 @@ ynh_restore_file --origin_path="$data_dir" --not_mandatory # (Same as for install dir) chown -R $app:www-data "$data_dir" -#================================================= -# RESTORE THE MYSQL DATABASE -#================================================= -ynh_script_progression --message="Restoring the MySQL database..." --weight=1 - -ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql #================================================= # RESTORE SYSTEM CONFIGURATIONS @@ -61,10 +54,9 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet -yunohost service add $app --log="/var/log/$app/$app.log" - ynh_restore_file --origin_path="/etc/logrotate.d/$app" +yunohost service add $app --log="/var/log/$app/$app.log" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index 7d534f6..2529719 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -39,9 +39,13 @@ ynh_script_progression --message="Building app... This may take quiete some time pushd $install_dir ynh_use_nodejs + + ynh_script_progression --message="Fetching Yarn dev dependencies... This can be very long, be patient !" --weight=18 ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --network-timeout=30000 + + ynh_script_progression --message="Building Yarn dev dependencies... This can be very long, be patient !" --weight=25 ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn run build -#ynh_exec_warn_less yarn start + popd chmod 750 "$install_dir" @@ -94,8 +98,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_exec_warn_less ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="Starting Overseer version" - - #================================================= # END OF SCRIPT #=================================================