hypersupers_ynh/scripts/install

68 lines
2.1 KiB
Text
Raw Normal View History

2023-06-07 15:03:49 +00:00
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
ynh_clean_setup () {
true
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
2023-06-09 13:06:13 +00:00
#=================================================
# Put password on system user
#=================================================
passwd $app $password
2023-06-07 15:03:49 +00:00
#=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
#=================================================
ynh_script_progression --message="Setting up source files..." --weight=1
ynh_setup_source --dest_dir="$install_dir"
chown -R $app:www-data "$install_dir"
#=================================================
# Get code from git
#=================================================
# ynh_script_progression --message="Clone from git..." --weight=1
# git clone https://git.distrilab.fr/HyperSupers/spip_hypersupers.git $install_dir
# git config pull.rebase false
#=================================================
# SYSTEM CONFIGURATION
#=================================================
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
# Create a dedicated PHP-FPM config using the conf/php-fpm.conf or conf/extra_php-fpm.conf
ynh_add_fpm_config
# Create a dedicated NGINX config using the conf/nginx.conf template
ynh_add_nginx_config
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload --log_path="/var/log/$app/$app.log"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Installation of $app completed" --last