1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pico_ynh.git synced 2024-09-03 19:56:41 +02:00
pico_ynh/scripts/install

70 lines
2.2 KiB
Text
Raw Normal View History

2022-05-14 15:20:24 +02:00
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# RETRIEVE ARGUMENTS FROM THE MANIFEST
#=================================================
2022-05-14 21:02:18 +02:00
theme="default"
2022-05-14 15:20:24 +02:00
#=================================================
# STORE SETTINGS FROM MANIFEST
#=================================================
2023-03-31 13:23:50 +02:00
ynh_script_progression --message="Storing installation settings..." --weight=1
2022-05-14 15:20:24 +02:00
2022-05-14 20:05:58 +02:00
ynh_app_setting_set --app=$app --key=theme --value=$theme
2022-05-14 15:20:24 +02:00
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
2022-05-14 15:46:04 +02:00
ynh_script_progression --message="Setting up source files..." --weight=4
2022-05-14 15:20:24 +02:00
# Download, check integrity, uncompress and patch the source from app.src
2023-03-31 13:16:59 +02:00
ynh_setup_source --dest_dir="$install_dir"
2022-05-14 15:20:24 +02:00
2023-03-31 13:16:59 +02:00
#cp -r ../sources/plugins $install_dir
#cp -r ../sources/themes $install_dir
2022-05-14 20:05:58 +02:00
2023-03-31 13:16:59 +02:00
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
2022-05-14 15:20:24 +02:00
#=================================================
# NGINX CONFIGURATION
#=================================================
2022-05-14 15:46:04 +02:00
ynh_script_progression --message="Configuring NGINX web server..." --weight=2
2022-05-14 15:20:24 +02:00
# Create a dedicated NGINX config
ynh_add_nginx_config
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
2022-05-14 15:46:04 +02:00
ynh_script_progression --message="Configuring PHP-FPM..." --weight=1
2022-05-14 15:20:24 +02:00
# Create a dedicated PHP-FPM config
2023-03-31 13:23:50 +02:00
ynh_add_fpm_config --usage=low --footprint=low
2022-05-14 15:20:24 +02:00
#=================================================
# ADD A CONFIGURATION
#=================================================
2022-05-14 15:46:04 +02:00
ynh_script_progression --message="Adding a configuration file..." --weight=1
2022-05-14 15:20:24 +02:00
2023-03-31 13:16:59 +02:00
ynh_add_config --template="../conf/config.yml.template" --destination="$install_dir/config/config.yml"
2022-05-14 15:20:24 +02:00
2023-03-31 13:16:59 +02:00
chmod 400 "$install_dir/config/config.yml"
chown $app:$app "$install_dir/config/config.yml"
2022-05-14 15:20:24 +02:00
#=================================================
# END OF SCRIPT
#=================================================
2022-05-14 15:46:04 +02:00
ynh_script_progression --message="Installation of $app completed" --last