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:
commit
46cb50326a
3 changed files with 35 additions and 11 deletions
|
@ -4,11 +4,30 @@ ROCKETCHAT_VERSION=0.58.4
|
||||||
ROCKETCHAT_SHASUM=ed53712b37571b959b5c8c8947d6335c21fced316f2b3174bfe027fa25700c44
|
ROCKETCHAT_SHASUM=ed53712b37571b959b5c8c8947d6335c21fced316f2b3174bfe027fa25700c44
|
||||||
NODE_VERSION=4.8.4
|
NODE_VERSION=4.8.4
|
||||||
|
|
||||||
|
checkcmd() {
|
||||||
|
curl -m 1 -s localhost:$port$path/api/v1/info | \
|
||||||
|
python -c "import sys, json; print json.load(sys.stdin)['success']" 2>/dev/null | \
|
||||||
|
grep "True" >/dev/null 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
waitforservice() {
|
waitforservice() {
|
||||||
isup=false; x=90; while [ $x -gt 0 ];do echo "Waiting approx. $x seconds..."; \
|
isup=false
|
||||||
x=$(( $x - 1 )); sleep 1; if $(curl -m 1 -s localhost:$port${path:-/}/api/v1/info | \
|
x=90
|
||||||
grep -e "success.*true" >/dev/null 2>&1); then isup=true; break; fi; done && if $isup; \
|
while [ $x -gt 0 ]; do
|
||||||
then echo "service is up"; else {ynh_die "$app could not be started"; fi
|
echo "Waiting approx. $x seconds..."
|
||||||
|
x=$(( $x - 1 ))
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
if checkcmd; then
|
||||||
|
isup=true; break;
|
||||||
|
fi;
|
||||||
|
done
|
||||||
|
|
||||||
|
if $isup; then
|
||||||
|
echo "service is up"
|
||||||
|
else
|
||||||
|
ynh_die "$app could not be started"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
installdeps(){
|
installdeps(){
|
||||||
|
|
|
@ -39,9 +39,6 @@ if [[ ! $? -eq 0 ]]; then
|
||||||
ynh_die "domain not available"
|
ynh_die "domain not available"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Register/book a web path for an app
|
|
||||||
ynh_webpath_register $app $domain $path
|
|
||||||
|
|
||||||
# Check destination directory
|
# Check destination directory
|
||||||
[[ -d $final_path ]] && ynh_die \
|
[[ -d $final_path ]] && ynh_die \
|
||||||
"The destination directory '$final_path' already exists.\
|
"The destination directory '$final_path' already exists.\
|
||||||
|
|
|
@ -23,10 +23,18 @@ sudo systemctl stop rocketchat
|
||||||
sudo rm -rf $final_path
|
sudo rm -rf $final_path
|
||||||
sudo mkdir -p $final_path
|
sudo mkdir -p $final_path
|
||||||
|
|
||||||
# upgrade to the latest rocketchat
|
# download and extract rocketchat
|
||||||
sudo curl -s -L -o $final_path/rocket.chat-latest.gtar "https://download.rocket.chat/stable"
|
echo "Downloading rocket.chat-$ROCKETCHAT_VERSION.gtar from https://download.rocket.chat/build/rocket.chat-${ROCKETCHAT_VERSION}.tgz."
|
||||||
sudo tar -xzf $final_path/rocket.chat-latest.gtar -C $final_path --strip-components=1 bundle
|
sudo curl -s -L -o $final_path/rocket.chat-$ROCKETCHAT_VERSION.gtar "https://download.rocket.chat/build/rocket.chat-${ROCKETCHAT_VERSION}.tgz"
|
||||||
sudo rm $final_path/rocket.chat-latest.gtar
|
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/
|
cd $final_path/programs/server/
|
||||||
sudo npm install --production
|
sudo npm install --production
|
||||||
|
|
Loading…
Add table
Reference in a new issue