#!/bin/bash #https://docs.nodebb.org/configuring/upgrade/ source _common.sh source /usr/share/yunohost/helpers #================================================= # STOP SYSTEMD SERVICE #================================================= ynh_script_progression "Stopping $app's systemd service..." ynh_systemctl --service=$app --action="stop" --log_path="systemd" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression "Upgrading source files..." pushd $install_dir # Shut down your forum git config --system --add safe.directory $install_dir ynh_exec_as_app $install_dir/nodebb stop # Grab the latest and greatest code git fetch # Grab the latest code from the NodeBB Repository git reset --hard origin/$nodebb_version # Replace v1.12.x with the branch name! # Run the NodeBB upgrade script ynh_exec_as_app $install_dir/nodebb upgrade 2>/dev/null popd chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" #================================================= # NGINX CONFIGURATION #================================================= ynh_script_progression "Upgrading NGINX web server configuration..." ynh_config_add_nginx ynh_nodejs_install ynh_config_add_systemd yunohost service add $app --description="Forum software" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression "Starting $app's systemd service..." ynh_systemctl --service=$app --action="start" --log_path="systemd" #================================================= # END OF SCRIPT #================================================= ynh_script_progression "Upgrade of $app completed"