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
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source /usr/share/yunohost/helpers
|
2017-07-21 14:35:08 +02:00
|
|
|
# Source common variables and helpers
|
|
|
|
source ./_common.sh
|
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)
|
|
|
|
|
|
|
|
sudo systemctl stop rocketchat
|
2016-04-29 17:52:21 +02:00
|
|
|
|
2017-07-21 14:35:08 +02:00
|
|
|
sudo rm -rf $final_path
|
|
|
|
sudo mkdir -p $final_path
|
2017-07-18 11:48:53 +02:00
|
|
|
|
2017-07-21 14:35:08 +02:00
|
|
|
# upgrade to the latest rocketchat
|
|
|
|
sudo curl -s -L -o $final_path/rocket.chat-latest.gtar "https://rocket.chat/releases/latest/download"
|
|
|
|
sudo tar -xzf $final_path/rocket.chat-latest.gtar -C $final_path --strip-components=1 bundle
|
|
|
|
sudo rm $final_path/rocket.chat-latest.gtar
|
2017-07-18 11:48:53 +02:00
|
|
|
|
2017-07-19 13:10:43 +02:00
|
|
|
cd $final_path/programs/server/
|
2017-07-21 14:35:08 +02:00
|
|
|
sudo npm install --production
|
|
|
|
|
|
|
|
sudo chown -R $serviceuser: $final_path
|
2017-07-18 11:48:53 +02:00
|
|
|
|
2017-07-21 14:35:08 +02:00
|
|
|
sudo systemctl start rocketchat
|
|
|
|
waitforservice
|