2023-05-14 12:16:28 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
upgrade_type=$(ynh_check_app_version_changed)
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...)
|
|
|
|
#=================================================
|
|
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
|
|
#=================================================
|
2024-06-14 22:03:34 +02:00
|
|
|
ynh_script_progression --message="Upgrading source files..." --weight=1
|
2023-05-14 12:16:28 +02:00
|
|
|
|
2024-06-14 22:03:34 +02:00
|
|
|
# Download, check integrity, uncompress and patch the source from app.src
|
|
|
|
ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep = ".env"
|
2023-05-14 12:16:28 +02:00
|
|
|
|
|
|
|
chown -R $app:www-data "$install_dir"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REAPPLY SYSTEM CONFIGURATIONS
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1
|
|
|
|
|
|
|
|
ynh_add_nginx_config
|
|
|
|
|
2023-05-14 12:27:42 +02:00
|
|
|
pushd "$install_dir"
|
|
|
|
ynh_use_nodejs
|
|
|
|
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH npm ci
|
2023-05-14 12:52:06 +02:00
|
|
|
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH npm run build
|
2023-05-14 12:27:42 +02:00
|
|
|
popd
|
2023-05-14 12:16:28 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_script_progression --message="Upgrade of $app completed" --last
|