1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/jellyfin-vue_ynh.git synced 2024-09-03 19:26:31 +02:00
jellyfin-vue_ynh/scripts/upgrade

49 lines
1.9 KiB
Bash
Executable file

#!/bin/bash
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...)
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression "Upgrading source files..."
ynh_setup_source --dest_dir="$install_dir/source" --full_replace
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir"
ynh_script_progression "Installing NodeJS..."
# Install Nodejs
ynh_nodejs_install
ynh_script_progression "Building Jellyfin Vue... (this will take some time and resources!)"
_patch_config_json "$install_dir/source"
_npm_build_install "$install_dir/source" "$install_dir/www" "$path/"
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir"
#=================================================
# REAPPLY SYSTEM CONFIGURATIONS
#=================================================
ynh_script_progression "Upgrading system configurations related to $app..."
ynh_config_add_nginx
#=================================================
# RECONFIGURE THE APP (UPDATE CONF, APPLY MIGRATIONS...)
#=================================================
# UPDATE A CONFIG FILE
#=================================================
ynh_script_progression "Updating configuration..."
# Check if Jellyfin is installed, and configure it as defaultServerURL.
for url in $(_list_jellyfin_urls); do
_append_to_server_urls "$install_dir/www/config.json" "$url"
done
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression "Upgrade of $app completed"