1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/rocketchat_ynh.git synced 2024-09-03 20:16:25 +02:00
rocketchat_ynh/scripts/upgrade
2017-07-19 13:10:43 +02:00

33 lines
1,002 B
Bash

#!/bin/bash
set -eu
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source /usr/share/yunohost/helpers
ROCKETCHAT_VERSION=0.57.2
NODE_VERSION=4.7.1
app=$YNH_APP_INSTANCE_NAME
final_path="/var/www/$app"
# remove old things
sudo systemctl stop Rocketchat.service
sudo m -rf $final_path
sudo mkdir $final_path
# install newer node version
sudo n $NODE_VERSION
# download install newer rocketchat version
echo "Downloading rocket.chat-$ROCKETCHAT_VERSION.gtar from https://rocket.chat/releases/${ROCKETCHAT_VERSION}/download."
sudo curl -s -L -o $final_path/rocket.chat-$ROCKETCHAT_VERSION.gtar "https://rocket.chat/releases/${ROCKETCHAT_VERSION}/download"
sudo tar -xzf $final_path/rocket.chat-$ROCKETCHAT_VERSION.gtar -C $final_path --strip-components=1 bundle
cd $final_path/programs/server/
sudo npm install
sudo systemctl start Rocketchat.service