mirror of
https://github.com/YunoHost-Apps/koel_ynh.git
synced 2024-09-03 19:35:54 +02:00
64 lines
2.2 KiB
Bash
Executable file
64 lines
2.2 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC START
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source _common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# APP "BUILD" (DEPLOYING SOURCES, VENV, COMPILING ETC)
|
|
#=================================================
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
#=================================================
|
|
ynh_script_progression --message="Setting up source files..." --weight=1
|
|
|
|
ynh_setup_source --dest_dir="$install_dir"
|
|
|
|
chown -R $app:www-data "$install_dir"
|
|
|
|
#=================================================
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
#================================================
|
|
ynh_script_progression --message="Initializing multimedia directories..." --weight=1
|
|
|
|
ynh_multimedia_build_main_dir
|
|
ynh_multimedia_addfolder --source_dir="$data_dir" --dest_dir="$app"
|
|
ynh_multimedia_addaccess $app
|
|
|
|
#=================================================
|
|
# APP INITIAL CONFIGURATION
|
|
#=================================================
|
|
# ADD A CONFIGURATION
|
|
#=================================================
|
|
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
|
|
|
app_key=$(ynh_string_random --length=32)
|
|
ynh_app_setting_set --app="$app" --key="app_key" --value="$app_key"
|
|
ynh_add_config --template="env" --destination="$install_dir/.env"
|
|
|
|
#=================================================
|
|
# INITIALIZE THE APP
|
|
#=================================================
|
|
ynh_script_progression --message="Initializing $app..." --weight=1
|
|
|
|
pushd $install_dir
|
|
ynh_exec_as $app php$phpversion artisan koel:init --no-assets --no-interaction --quiet
|
|
popd
|
|
|
|
#=================================================
|
|
# SYSTEM CONFIGURATION
|
|
#=================================================
|
|
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
|
|
|
|
ynh_add_fpm_config
|
|
|
|
ynh_add_nginx_config
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
ynh_script_progression --message="Installation of $app completed" --last
|