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

Merge pull request #6 from YunoHost-Apps/fix-upgrade

Fix upgrade
This commit is contained in:
Thomas 2023-09-07 13:17:08 +02:00 committed by GitHub
commit 800a75f419
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 3 deletions

View file

@ -26,7 +26,6 @@ ram.runtime = "50M"
[install]
[install.domain]
type = "domain"
full_domain = true
[install.init_main_permission]
type = "group"

View file

@ -16,6 +16,9 @@ ynh_script_progression --message="Installing dependencies..." --weight=5
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
# Upgrade NPM
ynh_npm install --global npm@latest
# Install Yarn
ynh_npm install --global yarn
@ -51,7 +54,7 @@ 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_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --network-timeout=100000
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

View file

@ -18,6 +18,19 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
#=================================================
# INSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Installing dependencies..." --weight=5
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
# Upgrade NPM
ynh_npm install --global npm@latest
# Install Yarn
ynh_npm install --global yarn
#=================================================
# "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...)
#=================================================
@ -25,9 +38,22 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app
#=================================================
ynh_script_progression --message="Setting up source files..." --weight=1
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading source files..."
# Move old app dir
mv ${install_dir} ${install_dir}.old
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir"
# restore data
cp -a ${install_dir}.old/config ${install_dir}
# delete temp directory
ynh_secure_remove --file=${install_dir}.old
fi
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
@ -41,7 +67,7 @@ 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_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --network-timeout=100000
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