bigbluebutton-Github/build/packages-template/bbb-graphql-server/build.sh
Gustavo Trott 1465d3dca3
refactor (gql-server): Set some configs for Max PG connections and Nginx max workers aiming to support more users (#20549)
* Set hasura max connections with pg to 100

* set nginx worker_connections from 4k to 10k

* Update bbb-graphql-server/metadata/databases/databases.yaml

* remove deprecated config

* set pg max connections up to 300

---------

Co-authored-by: Tiago Jacobs <tiago.jacobs@gmail.com>
2024-06-20 16:41:47 -03:00

59 lines
1.5 KiB
Bash
Executable File

#!/bin/bash -ex
TARGET=`basename $(pwd)`
PACKAGE=$(echo $TARGET | cut -d'_' -f1)
VERSION=$(echo $TARGET | cut -d'_' -f2)
DISTRO=$(echo $TARGET | cut -d'_' -f3)
TAG=$(echo $TARGET | cut -d'_' -f4)
BUILD=$1
#
# Clean up directories
rm -rf staging
#
# package
# Create directories for fpm to process
DIRS="/usr/local/bin /etc/default /usr/share/bbb-graphql-server /lib/systemd/system"
for dir in $DIRS; do
mkdir -p staging$dir
done
git clone --branch v2.40.0 https://github.com/iMDT/hasura-graphql-engine.git
cat hasura-graphql-engine/hasura-graphql.part-a* > hasura-graphql
rm -rf hasura-graphql-engine/
chmod +x hasura-graphql
cp -r hasura-graphql staging/usr/local/bin/hasura-graphql-engine
cp -r hasura-config.env staging/etc/default/bbb-graphql-server
cp -r bbb_schema.sql metadata config.yaml staging/usr/share/bbb-graphql-server
#Copy BBB configs for Postgres
mkdir -p staging/etc/postgresql/16/main/conf.d
cp bbb-pg.conf staging/etc/postgresql/16/main/conf.d
cp bbb-graphql-server.service staging/lib/systemd/system/bbb-graphql-server.service
mkdir -p hasura-cli
cd hasura-cli
npm install --save-dev hasura-cli@2.36.2
cp node_modules/hasura-cli/hasura ../staging/usr/local/bin/hasura
cd ..
rm -rf hasura-cli
. ./opts-$DISTRO.sh
#
# Build package
fpm -s dir -C ./staging -n $PACKAGE \
--version $VERSION --epoch $EPOCH \
--after-install after-install.sh \
--after-remove after-remove.sh \
--before-remove before-remove.sh \
--description "GraphQL server component for BigBlueButton" \
$DIRECTORIES \
$OPTS