bigbluebutton-Github/build/packages-template/bbb-webrtc-sfu/build.sh
Tainan Felipe 4d6f4b3ded
Refactor: Make bundle using webpack (#20811)
* Refactor: Make bundle using webpack

* Fix: restore after install codes and a few settings

* Fix: build script folder permission

* Refactor: Remove support to async import on audio bridges

* Upgrade npm using nvm

* Avoid questions on npm ci execution

* Let npm ci install dev dependencies (as we need the build tools here)

* Fix: enconding

* Fix: old lock files

* Remove: bbb-config dependency to bbb-html5 service, bbb-html5 isn't a service anymore

* Fix: TS errors

* Fix: eslint

* Fix: chat styles

* npm install with "lockfileVersion": 3 (newer npm)

* build: allow nodejs 22

* node 22; drop meteor from CI and bbb-conf

* TEMP: use bbb-install without mongo but with node 22 and newer image

* build: relax nodejs condition to not trip 22.6

* build: ensure dir /usr/share/bigbluebutton/nginx exists

* init sites-available/bbb; drop disable-transparent-

* nginx complaining of missing file and ;

* TMP: print status of services

* WIP: tweak nginx location to debug

* Fix: webcam widgets alignments

* akka-apps -- update location of settings.yml

* build: add locales path for nginx

* docs and config changes for removal of meteor

* Fix: build encoding and locales enpoint folder path

* build: set wss url for media

* Add: Enable minimizer and modify to Terser

* Fix: TS errors

---------

Co-authored-by: Tiago Jacobs <tiago.jacobs@gmail.com>
Co-authored-by: Anton Georgiev <anto.georgiev@gmail.com>
Co-authored-by: Anton Georgiev <antobinary@users.noreply.github.com>
2024-08-09 13:58:44 -04:00

66 lines
2.1 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)
#
# Clean up directories
rm -rf staging
#
# Create directory for fpm to process
DIRS="/usr/share/bigbluebutton/nginx /usr/local/bigbluebutton/bbb-webrtc-sfu /etc/logrotate.d /usr/lib/systemd/system /etc/cron.hourly"
for dir in $DIRS; do
mkdir -p staging$dir
done
##
mkdir -p staging/usr/local/bigbluebutton/bbb-webrtc-sfu
find -maxdepth 1 ! -path . ! -name staging $(printf "! -name %s " $(cat .build-files)) -exec cp -r {} staging/usr/local/bigbluebutton/bbb-webrtc-sfu/ \;
pushd .
cd staging/usr/local/bigbluebutton/bbb-webrtc-sfu/
# this is required because it is referenced as a submodule here
rm -rf .git
# npm install expects this to be a git repository
git init
if [ "$DISTRO" == "focal" ]; then
# this is a workaround so that the post-install command will find the pegjs binary
export PATH=$PWD/node_modules/pegjs/bin:$PATH
npm install --unsafe-perm --production
else
npm install --unsafe-perm --production
fi
# clean out stuff that is not required in the final package. Most of this are object files from dependent libraries
rm -rf node_modules/mediasoup/worker/out/Release/subprojects
rm -rf node_modules/mediasoup/worker/out/Release/mediasoup-worker.p
rm -rf node_modules/mediasoup/worker/out/Release/deps
popd
cp webrtc-sfu.nginx staging/usr/share/bigbluebutton/nginx
cp bbb-webrtc-sfu.service staging/usr/lib/systemd/system
cp bbb-webrtc-sfu.logrotate staging/etc/logrotate.d
rm -rf staging/usr/local/bigbluebutton/bbb-webrtc-sfu/.git
. ./opts-$DISTRO.sh
fpm -s dir -C ./staging -n $PACKAGE \
--version $VERSION --epoch $EPOCH \
--after-install after-install.sh \
--before-install before-install.sh \
--before-remove before-remove.sh \
--description "BigBlueButton WebRTC SFU" \
$DIRECTORIES \
$OPTS \
-d 'nodejs (>= 18)' -d 'nodejs (<< 23)'