2023-06-05 17:27:49 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# APP "BUILD" (DEPLOYING SOURCES, VENV, COMPILING ETC)
|
|
|
|
#=================================================
|
|
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
|
|
#=================================================
|
2024-06-23 09:19:26 +02:00
|
|
|
ynh_script_progression "Setting up source files..."
|
2023-06-05 17:27:49 +02:00
|
|
|
|
|
|
|
ynh_setup_source --dest_dir="$install_dir"
|
|
|
|
|
2024-06-23 09:19:26 +02:00
|
|
|
ynh_replace --match="define('ENVIRONMENT', 'development');" --replace="define('ENVIRONMENT', 'production');" --file=$install_dir/index.php
|
2024-03-07 23:04:21 +01:00
|
|
|
|
2023-06-05 17:27:49 +02:00
|
|
|
chown -R $app:www-data "$install_dir"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SYSTEM CONFIGURATION
|
|
|
|
#=================================================
|
2024-06-23 09:19:26 +02:00
|
|
|
ynh_script_progression "Adding system configurations related to $app..."
|
2023-06-05 17:27:49 +02:00
|
|
|
|
2024-06-23 09:19:26 +02:00
|
|
|
ynh_config_add_phpfpm
|
2023-06-05 17:27:49 +02:00
|
|
|
|
2024-06-23 09:19:26 +02:00
|
|
|
ynh_config_add_nginx
|
2023-06-05 17:27:49 +02:00
|
|
|
|
2024-06-23 09:19:26 +02:00
|
|
|
ynh_config_add_logrotate
|
2023-06-05 17:27:49 +02:00
|
|
|
|
2024-06-23 09:19:26 +02:00
|
|
|
ynh_config_add --template="cron" --destination="/etc/cron.d/$app"
|
2023-06-05 17:27:49 +02:00
|
|
|
chown root: "/etc/cron.d/$app"
|
|
|
|
chmod 644 "/etc/cron.d/$app"
|
2024-06-23 09:19:26 +02:00
|
|
|
|
2024-08-03 09:23:43 +02:00
|
|
|
#=================================================
|
|
|
|
# SETUP APPLICATION WITH CURL
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression "Finalizing installation..."
|
|
|
|
|
|
|
|
ynh_local_curl "/install/index.php?submit" "username=$db_user" "password=$db_pwd" "database=$db_name"
|
|
|
|
|
2023-06-05 17:27:49 +02:00
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
2024-06-23 09:19:26 +02:00
|
|
|
ynh_script_progression "Installation of $app completed"
|