build: add bbb-transcription-controller

Added as an optional package
This commit is contained in:
prlanzarin 2023-05-19 12:38:55 -03:00
parent 894bd3e126
commit cf4ff9453c
11 changed files with 106 additions and 2 deletions

View File

@ -44,6 +44,7 @@ jobs:
- run: ./build/setup.sh bbb-web
- run: ./build/setup.sh bbb-webrtc-sfu
- run: ./build/setup.sh bbb-webrtc-recorder
- run: ./build/setup.sh bbb-transcription-controller
- run: ./build/setup.sh bigbluebutton
- run: tar cvf artifacts.tar artifacts/
- name: Archive packages

View File

@ -51,6 +51,7 @@ get_external_dependencies:
- freeswitch
- bbb-pads
- bbb-playback
- bbb-transcription-controller
expire_in: 1h 30min
# template job for build step
@ -176,6 +177,11 @@ bbb-webrtc-recorder-build:
script:
- build/setup-inside-docker.sh bbb-webrtc-recorder
bbb-transcription-controller-build:
extends: .build_job
script:
- build/setup-inside-docker.sh bbb-transcription-controller
bigbluebutton-build:
extends: .build_job
script:

View File

@ -0,0 +1 @@
git clone --branch v0.1.0 --depth 1 https://github.com/bigbluebutton/bbb-transcription-controller bbb-transcription-controller

View File

@ -489,11 +489,15 @@ display_bigbluebutton_status () {
units="$units bbb-rap-starter"
fi
if [ -f /usr/lib/systemd/system/bbb-transcription-controller.service ]; then
units="$units bbb-transcription-controller"
fi
if systemctl list-units --full -all | grep -q $TOMCAT_USER.service; then
TOMCAT_SERVICE=$TOMCAT_USER
fi
line='——————————————————————►'
line='—————————————————————————————►'
for unit in $units; do
status=$(systemctl is-active "$unit")
if [ "$status" = "active" ]; then
@ -1724,7 +1728,9 @@ if [ -n "$HOST" ]; then
sudo yq w -i /usr/local/bigbluebutton/bbb-webrtc-sfu/config/default.yml freeswitch.esl_password "$ESL_PASSWORD"
sudo xmlstarlet edit --inplace --update 'configuration/settings//param[@name="password"]/@value' --value $ESL_PASSWORD /opt/freeswitch/etc/freeswitch/autoload_configs/event_socket.conf.xml
if [ -f /usr/local/bigbluebutton/bbb-transcription-controller/config/default.yml ]; then
sudo yq w -i /usr/local/bigbluebutton/bbb-transcription-controller/config/default.yml freeswitch.esl_password "$ESL_PASSWORD"
fi
echo "Restarting BigBlueButton $BIGBLUEBUTTON_RELEASE ..."
stop_bigbluebutton

View File

@ -25,6 +25,7 @@ DEBNAME_TO_SOURCEDIR[bbb-web]="bigbluebutton-web bbb-common-web bbb-common-messa
DEBNAME_TO_SOURCEDIR[bbb-webhooks]="bbb-webhooks"
DEBNAME_TO_SOURCEDIR[bbb-webrtc-sfu]="bbb-webrtc-sfu"
DEBNAME_TO_SOURCEDIR[bbb-webrtc-recorder]="bbb-webrtc-recorder"
DEBNAME_TO_SOURCEDIR[bbb-transcription-controller]="bbb-transcription-controller"
DEBNAME_TO_SOURCEDIR[bigbluebutton]="do_not_copy_anything"
export DEBNAME_TO_SOURCEDIR

View File

@ -0,0 +1,5 @@
after-install.sh
bbb-transcription-controller.service
before-remove.sh
build.sh
opts-focal.sh

View File

@ -0,0 +1,18 @@
#!/bin/bash -e
case "$1" in
configure|upgrade|1|2)
TARGET=/usr/local/bigbluebutton/bbb-transcription-controller/config/default.yml
cp /usr/local/bigbluebutton/bbb-transcription-controller/config/default.example.yml $TARGET
startService bbb-transcription-controller|| echo "bbb-transcription-controller could not be registered or started"
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac

View File

@ -0,0 +1,18 @@
[Unit]
Description=BigBlueButton Transcription Controller
Wants=redis-server.service
After=syslog.target network.target redis-server.service freeswitch.service bbb-apps-akka.service
PartOf=bigbluebutton.target
[Service]
WorkingDirectory=/usr/local/bigbluebutton/bbb-transcription-controller
ExecStart=/usr/bin/node app.js
Restart=always
SyslogIdentifier=bbb-transcription-controller
User=bigbluebutton
Group=bigbluebutton
Environment=NODE_ENV=production
Environment=NODE_CONFIG_DIR=/etc/bigbluebutton/bbb-transcription-controller/:/usr/local/bigbluebutton/bbb-transcription-controller/config/
[Install]
WantedBy=multi-user.target bigbluebutton.target

View File

@ -0,0 +1,3 @@
#!/bin/bash -e
stopService bbb-transcription-controller || echo "bbb-transcription-controller could not be unregistered or stopped"

View File

@ -0,0 +1,42 @@
#!/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)
#
# Clean up directories
rm -rf staging
#
# package
mkdir -p staging/usr/local/bigbluebutton/bbb-transcription-controller
find -maxdepth 1 ! -path . ! -name staging $(printf "! -name %s " $(cat .build-files)) -exec cp -r {} staging/usr/local/bigbluebutton/bbb-transcription-controller/ \;
pushd .
cd staging/usr/local/bigbluebutton/bbb-transcription-controller/
npm install --production
popd
mkdir -p staging/usr/lib/systemd/system
cp bbb-transcription-controller.service staging/usr/lib/systemd/system
##
. ./opts-$DISTRO.sh
#
# Build RPM package
fpm -s dir -C ./staging -n $PACKAGE \
--version $VERSION --epoch $EPOCH \
--after-install after-install.sh \
--before-remove before-remove.sh \
--description "BigBlueButton Transcription Controller" \
$DIRECTORIES \
$OPTS

View File

@ -0,0 +1,3 @@
. ./opts-global.sh
OPTS="$OPTS -d nodejs,npm,bbb-apps-akka,bbb-freeswitch-core -t deb"