1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/rocketchat_ynh.git synced 2024-09-03 20:16:25 +02:00

Fix restore and upgrade

This commit is contained in:
Selamanse 2017-11-13 16:35:15 +01:00
parent af03f48317
commit bc3fb8f669
2 changed files with 12 additions and 7 deletions

View file

@ -39,9 +39,6 @@ if [[ ! $? -eq 0 ]]; then
ynh_die "domain not available"
fi
# Register/book a web path for an app
ynh_webpath_register $app $domain $path
# Check destination directory
[[ -d $final_path ]] && ynh_die \
"The destination directory '$final_path' already exists.\

View file

@ -23,10 +23,18 @@ 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://download.rocket.chat/stable"
sudo tar -xzf $final_path/rocket.chat-latest.gtar -C $final_path --strip-components=1 bundle
sudo rm $final_path/rocket.chat-latest.gtar
# download and extract rocketchat
echo "Downloading rocket.chat-$ROCKETCHAT_VERSION.gtar from https://download.rocket.chat/build/rocket.chat-${ROCKETCHAT_VERSION}.tgz."
sudo curl -s -L -o $final_path/rocket.chat-$ROCKETCHAT_VERSION.gtar "https://download.rocket.chat/build/rocket.chat-${ROCKETCHAT_VERSION}.tgz"
SHA_DOWNLOAD=$(sha256sum $final_path/rocket.chat-$ROCKETCHAT_VERSION.gtar | grep -o "^[a-f0-9]*")
if [[ ! "$SHA_DOWNLOAD" == "$ROCKETCHAT_SHASUM" ]]; then
ynh_die "The sha256sum does not match the configured one"
fi
sudo tar -xzf $final_path/rocket.chat-$ROCKETCHAT_VERSION.gtar -C $final_path --strip-components=1 bundle
sudo rm $final_path/rocket.chat-$ROCKETCHAT_VERSION.gtar
sudo chown -R $serviceuser: $final_path
cd $final_path/programs/server/
sudo npm install --production