mirror of
https://github.com/YunoHost-Apps/rocketchat_ynh.git
synced 2024-09-03 20:16:25 +02:00
46 lines
1 KiB
Bash
46 lines
1 KiB
Bash
#!/bin/bash
|
|
set -eu
|
|
|
|
#=================================================
|
|
# GENERIC START
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source ./_common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
ynh_abort_if_errors
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
final_path=$(ynh_app_setting_get $app final_path)
|
|
serviceuser=$(ynh_app_setting_get $app serviceuser)
|
|
path=$(ynh_app_setting_get $app path)
|
|
port=$(ynh_app_setting_get $app port)
|
|
|
|
#=================================================
|
|
# BACKUP THE APPLICATION
|
|
#=================================================
|
|
|
|
# Backup the current version of the app
|
|
ynh_backup_before_upgrade > >(tee "upgrade.log")
|
|
|
|
systemctl stop rocketchat
|
|
|
|
ynh_secure_remove $final_path
|
|
mkdir -p $final_path
|
|
|
|
# update to latest required node setup
|
|
installnode
|
|
|
|
ynh_setup_source "$final_path"
|
|
|
|
chown -R $serviceuser: $final_path
|
|
|
|
cd $final_path/programs/server/
|
|
npm install --production
|
|
|
|
chown -R $serviceuser: $final_path
|
|
|
|
systemctl start rocketchat
|
|
waitforservice
|