2020-07-08 09:49:14 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-03-31 19:39:38 +02:00
|
|
|
source _common.sh
|
2020-07-08 09:49:14 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
2024-05-12 20:36:20 +02:00
|
|
|
# INSTALL NODEJS
|
2020-07-08 09:49:14 +02:00
|
|
|
#=================================================
|
2024-05-12 20:36:20 +02:00
|
|
|
ynh_script_progression --message="Install nodejs..."
|
2020-07-08 09:49:14 +02:00
|
|
|
|
2024-05-12 20:36:20 +02:00
|
|
|
ynh_install_nodejs --nodejs_version=$nodejs_version
|
|
|
|
ynh_use_nodejs
|
2020-07-08 09:49:14 +02:00
|
|
|
|
2024-05-12 20:36:20 +02:00
|
|
|
#=================================================
|
|
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Setting up source files..."
|
|
|
|
|
|
|
|
tmpdir=$(mktemp -d)
|
|
|
|
ynh_setup_source --dest_dir="$tmpdir"
|
|
|
|
pushd $tmpdir
|
|
|
|
cp $install_dir/_h5ai/private/conf/options.json ./options.json.bkp
|
|
|
|
npm ci
|
|
|
|
npm run build
|
|
|
|
ynh_secure_remove $install_dir/_h5ai
|
|
|
|
mv build/_h5ai $install_dir/_h5ai
|
|
|
|
cp ./options.json.bkp $install_dir/_h5ai/private/conf/options.json
|
|
|
|
popd
|
|
|
|
ynh_secure_remove $tmpdir
|
2020-07-08 09:49:14 +02:00
|
|
|
|
2023-12-27 21:25:44 +01:00
|
|
|
chmod o-rwx "$install_dir"
|
|
|
|
chown $app:www-data "$install_dir"
|
|
|
|
chown -R $app:www-data "$install_dir/_h5ai"
|
2024-01-22 23:26:52 +01:00
|
|
|
chmod 700 "$install_dir/_h5ai/private/conf"
|
2021-05-26 12:16:06 +02:00
|
|
|
|
2022-03-31 19:39:38 +02:00
|
|
|
#=================================================
|
2023-02-17 22:45:03 +01:00
|
|
|
# REAPPLY SYSTEM CONFIGURATIONS
|
2022-03-31 19:39:38 +02:00
|
|
|
#=================================================
|
2023-12-27 21:25:44 +01:00
|
|
|
ynh_script_progression --message="Upgrading system configurations related to $app..."
|
2022-03-31 19:39:38 +02:00
|
|
|
|
|
|
|
# Create a dedicated PHP-FPM config
|
2023-12-27 20:58:45 +01:00
|
|
|
ynh_add_fpm_config
|
2022-10-16 20:26:47 +02:00
|
|
|
|
|
|
|
# Create a dedicated NGINX config
|
|
|
|
ynh_add_nginx_config
|
|
|
|
|
2020-07-08 09:49:14 +02:00
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2022-04-04 20:12:41 +02:00
|
|
|
ynh_script_progression --message="Upgrade of $app completed" --last
|