1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/abantecart_ynh.git synced 2024-09-03 18:06:16 +02:00
abantecart_ynh/scripts/install

83 lines
2.6 KiB
Text
Raw Normal View History

2017-01-29 01:05:11 +01:00
#!/bin/bash
2017-03-02 13:22:31 +01:00
#=================================================
2018-06-30 15:52:45 +02:00
# GENERIC START
2017-03-02 13:22:31 +01:00
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
2018-06-30 15:52:45 +02:00
source _common.sh
2017-02-24 13:31:00 +01:00
source /usr/share/yunohost/helpers
2017-03-02 13:22:31 +01:00
#=================================================
# RETRIEVE ARGUMENTS FROM THE MANIFEST
#=================================================
2017-02-22 15:41:28 +01:00
2022-09-18 04:58:08 +02:00
email=$(ynh_user_get_info --username=$admin --key=mail)
2022-01-18 11:23:55 +01:00
src_version=$(ynh_app_upstream_version)
2017-01-29 01:05:11 +01:00
2017-03-02 13:22:31 +01:00
#=================================================
# STORE SETTINGS FROM MANIFEST
#=================================================
2022-01-18 11:23:55 +01:00
ynh_app_setting_set --app=$app --key=src_version --value=$src_version
2018-09-29 01:07:51 +02:00
2017-03-02 13:22:31 +01:00
#=================================================
2022-09-18 04:58:08 +02:00
# DOWNLOAD, CHECK AND UNPACK SOURCE
2017-03-02 13:22:31 +01:00
#=================================================
2022-09-18 04:58:08 +02:00
ynh_script_progression --message="Setting up source files..." --weight=3
2022-01-14 15:05:54 +01:00
2022-09-18 04:58:08 +02:00
# Download, check integrity, uncompress and patch the source from app.src
2023-04-21 15:08:46 +02:00
ynh_setup_source --dest_dir="$install_dir/git_src"
ln -s $install_dir/git_src/public_html $install_dir/www
2023-04-21 15:08:46 +02:00
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
find $install_dir/www -type d -exec chmod 755 {} \;
find $install_dir/www -type f -exec chmod 644 {} \;
2017-02-24 20:27:09 +01:00
2017-03-02 13:22:31 +01:00
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring PHP-FPM..." --weight=2
2017-03-02 13:22:31 +01:00
# Create a dedicated PHP-FPM config
2024-06-01 16:08:01 +02:00
ynh_add_fpm_config
2022-09-18 04:58:08 +02:00
# Create a dedicated NGINX config
ynh_add_nginx_config
#=================================================
# SPECIFIC SETUP
#=================================================
# INSTALL APP
#=================================================
ynh_script_progression --message="Installing app..." --weight=2
2023-04-21 15:08:46 +02:00
php$phpversion $install_dir/www/install/cli_install.php install \
2022-09-18 04:58:08 +02:00
--db_host=localhost \
--db_user=$db_name \
--db_password=$db_pwd \
--db_name=$db_name \
--db_driver=amysqli \
--db_prefix=ac_ \
--username=$admin \
--admin_path=admin \
--password=$password \
--email=$email \
--http_server=https://$domain
2023-04-21 15:19:55 +02:00
ynh_secure_remove $install_dir/www/install
2022-09-18 04:58:08 +02:00
2023-04-21 15:08:46 +02:00
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
find $install_dir/www -type d -exec chmod 755 {} \;
find $install_dir/www -type f -exec chmod 644 {} \;
2018-06-30 15:52:45 +02:00
2020-11-03 11:35:21 +01:00
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Installation of $app completed" --last