mirror of
https://github.com/YunoHost-Apps/h5ai_ynh.git
synced 2024-09-03 20:36:25 +02:00
54 lines
1.5 KiB
Bash
54 lines
1.5 KiB
Bash
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC START
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source _common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# INSTALL NODEJS
|
|
#=================================================
|
|
ynh_script_progression --message="Install nodejs..."
|
|
|
|
ynh_install_nodejs --nodejs_version=$nodejs_version
|
|
ynh_use_nodejs
|
|
|
|
#=================================================
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
#=================================================
|
|
ynh_script_progression --message="Setting up source files..."
|
|
|
|
|
|
tmpdir=$(mktemp -d)
|
|
ynh_setup_source --dest_dir="$tmpdir"
|
|
pushd $tmpdir
|
|
npm ci
|
|
npm run build
|
|
mv build/_h5ai $install_dir/_h5ai
|
|
popd
|
|
ynh_secure_remove $tmpdir
|
|
|
|
chmod -R o-rwx "$install_dir"
|
|
chown -R $app:www-data "$install_dir"
|
|
chmod 700 "$install_dir/_h5ai/private/conf"
|
|
|
|
#=================================================
|
|
# SYSTEM CONFIGURATION
|
|
#=================================================
|
|
ynh_script_progression --message="Adding system configurations related to $app..."
|
|
|
|
# Create a dedicated PHP-FPM config
|
|
ynh_add_fpm_config
|
|
|
|
# Create a dedicated NGINX config
|
|
ynh_add_nginx_config
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Installation of $app completed" --last
|