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