mirror of
https://github.com/YunoHost-Apps/wekan_ynh.git
synced 2024-09-03 20:36:09 +02:00
70 lines
2 KiB
Bash
70 lines
2 KiB
Bash
#!/bin/bash
|
|
|
|
source _common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
main_domain=$(cat /etc/yunohost/current_host)
|
|
|
|
#=================================================
|
|
# INSTALL DEPENDENCIES
|
|
#=================================================
|
|
ynh_script_progression "Installing dependencies..."
|
|
|
|
ynh_nodejs_install
|
|
|
|
#=================================================
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
#=================================================
|
|
ynh_script_progression "Setting up source files..."
|
|
|
|
ynh_setup_source --dest_dir="$install_dir"
|
|
|
|
#=================================================
|
|
# CREATE A MONGODB DATABASE
|
|
#=================================================
|
|
ynh_script_progression "Creating a MongoDB database..."
|
|
|
|
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
|
db_user=$db_name
|
|
ynh_app_setting_set --key=db_name --value=$db_name
|
|
|
|
ynh_install_mongo
|
|
ynh_mongo_setup_db --db_user=$db_user --db_name=$db_name
|
|
|
|
#=================================================
|
|
# NGINX CONFIGURATION
|
|
#=================================================
|
|
ynh_script_progression "Configuring NGINX web server..."
|
|
|
|
ynh_config_add_nginx
|
|
|
|
ynh_config_add_systemd
|
|
|
|
yunohost service add $app --description="Wekan daemon" --log="/var/log/$app/$app.log"
|
|
|
|
#=================================================
|
|
# SPECIFIC SETUP
|
|
#=================================================
|
|
# ADD A CONFIGURATION
|
|
#=================================================
|
|
ynh_script_progression "Adding a config file..."
|
|
|
|
ynh_config_add --template=".env" --destination="$install_dir/.env"
|
|
|
|
#=================================================
|
|
# START SYSTEMD SERVICE
|
|
#=================================================
|
|
ynh_script_progression "Starting $app's systemd service..."
|
|
|
|
# Start a systemd service
|
|
ynh_systemctl --service=$app --action="start" --log_path=systemd --wait_until="Enabling LDAP Background Sync"
|
|
|
|
#if ynh_in_ci_tests; then
|
|
# sleep 60
|
|
#fi
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
|
|
ynh_script_progression "Installation of $app completed"
|