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

Merge branch 'master' into improve/nodeversion484

This commit is contained in:
Felix Knecht 2017-11-02 09:49:50 +01:00 committed by GitHub
commit a2caa735ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 5 deletions

View file

@ -35,11 +35,14 @@ workdir=$(pwd)
port=$(ynh_find_port 3000)
# Check domain/path availability
sudo yunohost app checkurl $domain -a $app
ynh_webpath_available $domain $path
if [[ ! $? -eq 0 ]]; then
ynh_die "domain not available"
fi
# Register/book a web path for an app
ynh_webpath_register $app $domain $path
final_path="/var/lib/$app"
[[ -d $final_path ]] && ynh_die \
"The destination directory '$final_path' already exists.\
@ -82,8 +85,8 @@ sed -i "s@#DESTDIR#@$final_path@g" ../conf/nginx.conf
sudo cp ../conf/nginx.conf "$nginx_conf"
# download and extract rocketchat
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"
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"

View file

@ -34,7 +34,13 @@ serviceuser=$(ynh_app_setting_get $app serviceuser)
port=$(ynh_app_setting_get $app port)
# Check domain/path availability
sudo yunohost app checkurl "${domain}${path}" -a "$app" || ynh_die
ynh_webpath_available $domain $path
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 \

View file

@ -24,7 +24,7 @@ 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 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