1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/wekan_ynh.git synced 2024-09-03 20:36:09 +02:00

Add info messages + add tempo to make sure wekan is started before finishing the install

This commit is contained in:
Alexandre Aubin 2018-12-13 22:50:15 +01:00
parent 016ff5bbe5
commit d2c3e666e9

View file

@ -48,13 +48,18 @@ ynh_app_setting_set $app port $port
#=================================================
# INSTALL DEPENDENCIES
#=================================================
ynh_print_info "Installing nodejs ..."
ynh_install_nodejs 8.9.3
ynh_print_info "Installing mongodb dependencies ..."
ynh_install_app_dependencies "mongodb mongodb-server"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_print_info "Setting up Wekan's sources ..."
ynh_app_setting_set $app final_path $final_path
# Download, check integrity, uncompress and patch the source from app.src
# For this app sources are in app subdirectory
@ -63,7 +68,9 @@ ynh_setup_source "$final_path"
#=================================================
# NGINX CONFIGURATION
#=================================================
# Create a dedicated nginx config
ynh_print_info "Configuring nginx ..."
ynh_add_nginx_config
#=================================================
@ -77,6 +84,7 @@ ynh_system_user_create $app "$final_path"
# SPECIFIC SETUP
#=================================================
# Install wekan dependencies
ynh_print_info "Installing npm dependencies ..."
chown -R $app $final_path
pushd $final_path/programs/server
ynh_use_nodejs
@ -84,6 +92,7 @@ npm install
popd
# Start mogodb
ynh_print_info "Starting mongodb ..."
systemctl enable mongodb
systemctl restart mongodb
@ -91,6 +100,7 @@ systemctl restart mongodb
# SETUP SYSTEMD
#=================================================
# Create a dedicated systemd config
ynh_print_info "Adding wekan systemd service ..."
ynh_replace_string "__NODEJS__" "$nodejs_use_version" "../conf/systemd.service"
ynh_replace_string "__ENV_PATH__" "$PATH" "../conf/systemd.service"
ynh_replace_string "__DB_NAME__" "$app" "../conf/systemd.service"
@ -104,6 +114,7 @@ ynh_add_systemd_config
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
ynh_print_info "Fixing permissions ..."
# Set strong right permissions to app files
chown -R $app: "$final_path"
chmod -R 640 "$final_path"
@ -129,5 +140,9 @@ fi
#=================================================
# RELOAD NGINX
#=================================================
ynh_print_info "Starting wekan ..."
systemctl restart $app
systemctl reload nginx
ynh_print_info "Waiting for wekan to be up ..."
sleep 10