1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/owncast-emojiwall_ynh.git synced 2024-09-03 19:56:19 +02:00
owncast-emojiwall_ynh/scripts/install
2023-10-05 21:56:32 +07:00

64 lines
1.9 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 -m "Setting up source files..." -w 1
ynh_setup_source -d "$install_dir"
chown -R $app:www-data "$install_dir"
if [ "$path" = "/" ]; then
conf_path=""
else
conf_path=$path
fi
ynh_install_nodejs --nodejs_version=$nodejs_version
ynh_use_nodejs
npm --prefix "$install_dir" install
ynh_add_config -t default.json -d "$install_dir/config/default.json"
#=================================================
# SYSTEM CONFIGURATION
#=================================================
ynh_script_progression -m "Adding system configurations related to $app..." -w 1
ynh_add_nginx_config
ynh_add_systemd_config
#=================================================
# APP INITIAL CONFIGURATION
#=================================================
# CONFIGURATION FOR SUBPATH
#=================================================
ynh_script_progression -m "Configuring the app..." -w 1
yunohost service add $app -d "Emojiwall for Owncast" -l "/var/log/$app/$app.log"
#=================================================
# GENERIC FINALIZATION
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression -m "Starting a systemd service..." -w 1
ynh_systemd_action -a start
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression -m "Installation of $app completed" -l