2016-04-29 17:52:21 +02:00
|
|
|
#!/bin/bash
|
2017-07-18 13:16:23 +02:00
|
|
|
set -eu
|
2017-07-18 13:03:45 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
2017-07-21 14:35:08 +02:00
|
|
|
source ./_common.sh
|
2017-09-05 20:28:27 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
ynh_abort_if_errors
|
2016-04-29 17:52:21 +02:00
|
|
|
|
2017-07-19 13:10:43 +02:00
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
2017-07-21 14:35:08 +02:00
|
|
|
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)
|
|
|
|
|
2019-02-03 00:35:37 +01:00
|
|
|
#=================================================
|
|
|
|
# BACKUP THE APPLICATION
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
# Backup the current version of the app
|
|
|
|
ynh_backup_before_upgrade > >(tee "upgrade.log")
|
2019-01-25 23:34:56 +01:00
|
|
|
|
2019-02-10 21:21:55 +01:00
|
|
|
systemctl stop rocketchat
|
2016-04-29 17:52:21 +02:00
|
|
|
|
2019-02-10 21:21:55 +01:00
|
|
|
ynh_secure_remove $final_path
|
|
|
|
mkdir -p $final_path
|
2017-07-18 11:48:53 +02:00
|
|
|
|
2018-01-10 17:21:46 +01:00
|
|
|
# update to latest required node setup
|
|
|
|
installnode
|
|
|
|
|
2019-02-03 00:35:37 +01:00
|
|
|
ynh_setup_source "$final_path"
|
2017-11-27 21:45:46 +01:00
|
|
|
|
2019-02-10 21:21:55 +01:00
|
|
|
chown -R $serviceuser: $final_path
|
2017-07-18 11:48:53 +02:00
|
|
|
|
2017-07-19 13:10:43 +02:00
|
|
|
cd $final_path/programs/server/
|
2019-02-10 21:21:55 +01:00
|
|
|
npm install --production
|
2017-07-21 14:35:08 +02:00
|
|
|
|
2019-02-10 21:21:55 +01:00
|
|
|
chown -R $serviceuser: $final_path
|
2017-07-18 11:48:53 +02:00
|
|
|
|
2019-02-10 21:21:55 +01:00
|
|
|
systemctl start rocketchat
|
2017-07-21 14:35:08 +02:00
|
|
|
waitforservice
|