1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/jellyseerr_ynh.git synced 2024-09-03 19:26:18 +02:00

fixes en refacto

This commit is contained in:
Thomas 2023-05-11 20:48:12 +02:00 committed by GitHub
parent 20878cdabd
commit eae5bac60a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 29 deletions

View file

@ -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"

View file

@ -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
#=================================================

View file

@ -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
#=================================================

View file

@ -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

View file

@ -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
#=================================================