1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/concrete5_ynh.git synced 2024-09-03 18:25:54 +02:00
concrete5_ynh/scripts/install
2023-10-04 10:11:03 +02:00

74 lines
2.4 KiB
Bash

#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Setting up source files..." --weight=1
ynh_setup_source --dest_dir="$install_dir"
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir"
#=================================================
# SYSTEM CONFIGURATIONS
#=================================================
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
ynh_add_nginx_config
ynh_add_fpm_config
#=================================================
# SPECIFIC SETUP
#=================================================
# INSTALL COMPOSER
#=================================================
ynh_script_progression --message="Installing Composer..." --weight=1
ynh_install_composer --phpversion="$phpversion" --workdir="$install_dir"
#================================================
# CONCRETE5 INSTALLATION
#=================================================
ynh_script_progression --message="Concrete5 Installation, the installation can take long. So be patient ! :)" --weight=1
admin_email=$(ynh_user_get_info --username="$admin" --key="mail")
ynh_app_setting_set --app="$app" --key=admin_email --value="$admin_email"
ynh_mysql_execute_as_root --sql="ALTER DATABASE $db_name CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
pushd "$install_dir"
./concrete/bin/concrete5 c5:install --db-server=localhost \
--db-username="$db_user" \
--db-database="$db_name" \
--db-password="$db_pwd" \
--site="$website_title" \
--admin-email="$admin_email" \
--admin-password="$password" \
--language="$language" \
--site-locale="$language" \
--verbose \
--no-interaction \
--allow-as-root
popd
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Installation of $app completed" --last