bigbluebutton-Github/bbb-graphql-middleware/install-graphql-middleware.sh
Gustavo Trott de514dcb75
Add new shell scripts useful for development (#18905)
* Create run-dev.sh and deploy.sh for more applications

* Remove wrong line
2023-10-06 15:12:16 -03:00

38 lines
985 B
Bash
Executable File

#!/bin/bash
if [ "$EUID" -ne 0 ]; then
echo "Please run this script as root ( or with sudo )" ;
exit 1;
fi;
cd "$(dirname "$0")"
#Install Go
#sudo apt install golang -y
GO_VERSION=1.20.8
wget --no-verbose https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz \
&& tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz \
&& rm go${GO_VERSION}.linux-amd64.tar.gz \
&& ln -sf /usr/local/go/bin/go /usr/bin/go
go version
# Build Graphql Middleware
./local-build.sh
mv bbb-graphql-middleware /usr/local/bin/bbb-graphql-middleware
# Create service bbb-graphql-middleware
cp ./bbb-graphql-middleware-config.env /etc/default/bbb-graphql-middleware
cp ./bbb-graphql-middleware.service /lib/systemd/system/bbb-graphql-middleware.service
systemctl enable bbb-graphql-middleware
systemctl start bbb-graphql-middleware
# Set nginx location
cp ./graphql.nginx /usr/share/bigbluebutton/nginx
systemctl restart nginx
echo ""
echo ""
echo "Bbb-graphql-middleware Installed!"