mirror of
https://github.com/YunoHost-Apps/rocketchat_ynh.git
synced 2024-09-03 20:16:25 +02:00
4acf69cd82
Occuring in linter 8c70d51c6b939c80117ce55cec4d2d7fd9a00a3b
37 lines
1,008 B
Bash
37 lines
1,008 B
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)
|
|
|
|
sudo systemctl stop rocketchat
|
|
|
|
sudo rm -rf $final_path
|
|
sudo mkdir -p $final_path
|
|
|
|
# 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
|
|
|
|
cd $final_path/programs/server/
|
|
sudo npm install --production
|
|
|
|
sudo chown -R $serviceuser: $final_path
|
|
|
|
sudo systemctl start rocketchat
|
|
waitforservice
|