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

Upgrade to newer versions (#68)

- Update to rocket chat 0.73.2
- Update install routine based on https://rocket.chat/docs/installation/manual-installation/debian/
- Conditional service init for mongodb on armhf. Addresses #64.
- Minor improvements to upgrade and restore
This commit is contained in:
Selamanse 2019-01-25 23:34:56 +01:00 committed by GitHub
parent 1952823a98
commit dfc1bb75f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 40 additions and 34 deletions

View file

@ -7,7 +7,7 @@
},
"url": "https://github.com/YunoHost-Apps/rocketchat_ynh",
"license": "GPL-3.0",
"version": "0.70.4",
"version": "0.73.2",
"maintainer": {
"name": "selamanse",
"email": "selamanse@scheinfrei.info",
@ -40,13 +40,13 @@
"default": "/rocketchat"
},
{
"name": "is_public",
"name": "is_public",
"ask": {
"en": "Is it a public application?"
},
"choices": ["Yes", "No"],
"default": "No"
},
"default": "Yes"
},
{
"name": "lang",
"ask": {

View file

@ -1,8 +1,9 @@
# common.sh
ROCKETCHAT_VERSION=0.70.4
ROCKETCHAT_SHASUM=62be1d3be0c12f37c69b24c7b898030a43550afcb9d4fac24c8f301b939b7dc1
NODE_VERSION=8.11.3
ROCKETCHAT_VERSION=0.73.2
ROCKETCHAT_SHASUM=3dc3eb11f383f7b72b0f23fedb305b6a566fa536a1e5087a4398255deeb864d8
ROCKETCHAT_DOWNLOAD_URI=https://releases.rocket.chat/${ROCKETCHAT_VERSION}/download
NODE_VERSION=8.11.4
DEBIAN_ISSUE=$(grep 9 /etc/debian_version >/dev/null && echo stretch || echo jessie)
checkcmd() {
@ -38,8 +39,8 @@ installnode(){
sudo apt-get install -y nodejs
else
sudo apt-get install -y npm
# Meteor needs at least this version of node to work.
sudo npm install -g n
# Using npm install inherits and n, and the node version required by Rocket.Chat:
sudo npm install -g inherits n
sudo n $NODE_VERSION
fi
echo "node version is now: "
@ -52,23 +53,30 @@ installdeps(){
#Install mongodb for debian armhf
sudo apt-get update
sudo apt-get install -y mongodb-server
# start mongodb service
sudo systemctl enable mongodb.service
sudo systemctl start mongodb.service
# add mongodb to services
sudo yunohost service add mongodb -l /var/log/mongodb/mongodb.log
else
#Install mongodb for debian x86/x64
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
sudo apt-get install dirmngr && sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
echo "deb http://repo.mongodb.org/apt/debian ${DEBIAN_ISSUE}/mongodb-org/4.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org
# start mongodb service
sudo systemctl enable mongod.service
sudo systemctl start mongod.service
# add mongodb to services
sudo yunohost service add mongod -l /var/log/mongodb/mongod.log
fi
# start mongodb service
sudo systemctl enable mongod.service
sudo systemctl start mongod.service
# add mongodb to services
sudo yunohost service add mongod -l /var/log/mongodb/mongod.log
#Install other dependencies
sudo apt-get install -y gzip curl graphicsmagick
sudo apt-get install -y build-essential gzip curl graphicsmagick
installnode
}

View file

@ -103,8 +103,8 @@ sed -i "s@#DBNAME#@$dbname@g" ../conf/rocketchat_ldap.js
sudo cp ../conf/nginx.conf "$nginx_conf"
# download and extract rocketchat
echo "Downloading rocket.chat-$ROCKETCHAT_VERSION.gtar from https://s3.amazonaws.com/download.rocket.chat/build/rocket.chat-${ROCKETCHAT_VERSION}.tgz."
sudo curl -s -L -o $final_path/rocket.chat-$ROCKETCHAT_VERSION.gtar "https://s3.amazonaws.com/download.rocket.chat/build/rocket.chat-${ROCKETCHAT_VERSION}.tgz"
echo "Downloading rocket.chat-$ROCKETCHAT_VERSION.gtar from ${ROCKETCHAT_DOWNLOAD_URI}."
sudo curl -s -L -o $final_path/rocket.chat-$ROCKETCHAT_VERSION.gtar "${ROCKETCHAT_DOWNLOAD_URI}"
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"

View file

@ -1,16 +1,14 @@
#!/bin/bash
set -eu
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
if [ ! -e _common.sh ]; then
# Fetch helpers file if not in current directory
sudo cp ../settings/scripts/_common.sh ./_common.sh
sudo chmod a+rx _common.sh
fi
source ./_common.sh
source /usr/share/yunohost/helpers
source _common.sh
#=================================================
# GENERIC START

View file

@ -18,6 +18,14 @@ serviceuser=$(ynh_app_setting_get $app serviceuser)
path=$(ynh_app_setting_get $app path)
port=$(ynh_app_setting_get $app port)
# download and extract rocketchat
echo "Downloading rocket.chat-$ROCKETCHAT_VERSION.gtar from ${ROCKETCHAT_DOWNLOAD_URI}."
sudo curl -s -L -o $final_path/rocket.chat-$ROCKETCHAT_VERSION.gtar "${ROCKETCHAT_DOWNLOAD_URI}"
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 systemctl stop rocketchat
sudo rm -rf $final_path
@ -26,14 +34,6 @@ sudo mkdir -p $final_path
# update to latest required node setup
installnode
# download and extract rocketchat
echo "Downloading rocket.chat-$ROCKETCHAT_VERSION.gtar from https://s3.amazonaws.com/download.rocket.chat/build/rocket.chat-${ROCKETCHAT_VERSION}.tgz."
sudo curl -s -L -o $final_path/rocket.chat-$ROCKETCHAT_VERSION.gtar "https://s3.amazonaws.com/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