2021-08-13 18:53:18 +08:00
|
|
|
#!/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)
|
2022-08-19 00:39:47 +08:00
|
|
|
BUILD=$1
|
2021-08-13 18:53:18 +08:00
|
|
|
|
|
|
|
#
|
|
|
|
# Clean up directories
|
|
|
|
rm -rf staging
|
2024-08-10 01:58:44 +08:00
|
|
|
rm -rf dist
|
2021-08-13 18:53:18 +08:00
|
|
|
#
|
|
|
|
# package
|
2024-08-10 01:58:44 +08:00
|
|
|
#
|
|
|
|
# Create directory for fpm to process
|
2024-09-26 00:39:04 +08:00
|
|
|
DIRS="/usr/share/bigbluebutton/html5-client /usr/share/bigbluebutton/nginx"
|
2024-08-10 01:58:44 +08:00
|
|
|
for dir in $DIRS; do
|
|
|
|
mkdir -p staging$dir
|
|
|
|
DIRECTORIES="$DIRECTORIES --directories $dir"
|
|
|
|
done
|
|
|
|
|
|
|
|
cp bbb-html5.nginx staging/usr/share/bigbluebutton/nginx
|
|
|
|
cp bbb-html5.nginx.dev staging/usr/share/bigbluebutton/nginx
|
|
|
|
cp bbb-html5.nginx.static staging/usr/share/bigbluebutton/nginx
|
|
|
|
cp sip.nginx staging/usr/share/bigbluebutton/nginx
|
2021-08-13 18:53:18 +08:00
|
|
|
|
|
|
|
# New format
|
|
|
|
if [ -f private/config/settings.yml ]; then
|
2022-08-26 20:31:06 +08:00
|
|
|
sed -i "s/HTML5_CLIENT_VERSION/$(($BUILD))/g" private/config/settings.yml
|
2021-08-13 18:53:18 +08:00
|
|
|
fi
|
|
|
|
|
2024-08-10 01:58:44 +08:00
|
|
|
echo "Npm version:"
|
2021-10-30 03:30:59 +08:00
|
|
|
npm -v
|
2024-08-10 01:58:44 +08:00
|
|
|
echo "Node version:"
|
|
|
|
node -v
|
2021-08-13 18:53:18 +08:00
|
|
|
|
2024-08-10 01:58:44 +08:00
|
|
|
CI=true npm ci
|
|
|
|
DISABLE_ESLINT_PLUGIN=true npm run build
|
2021-10-30 03:30:59 +08:00
|
|
|
|
2024-08-14 20:48:13 +08:00
|
|
|
# Compress CSS, Javascript and tensorflow WASM binaries used for virtual backgrounds. Keep the
|
|
|
|
# uncompressed versions as well so it works with mismatched nginx location blocks
|
|
|
|
find dist -name '*.js' -exec gzip -k -f -9 '{}' \;
|
|
|
|
find dist -name '*.css' -exec gzip -k -f -9 '{}' \;
|
|
|
|
find dist -name '*.wasm' -exec gzip -k -f -9 '{}' \;
|
|
|
|
|
2024-09-26 00:39:04 +08:00
|
|
|
cp -r dist/* staging/usr/share/bigbluebutton/html5-client
|
2021-10-19 00:02:29 +08:00
|
|
|
|
2021-08-13 18:53:18 +08:00
|
|
|
mkdir -p staging/etc/nginx/sites-available
|
|
|
|
cp bigbluebutton.nginx staging/etc/nginx/sites-available/bigbluebutton
|
|
|
|
|
2024-08-10 01:58:44 +08:00
|
|
|
##
|
2021-08-13 18:53:18 +08:00
|
|
|
|
|
|
|
. ./opts-$DISTRO.sh
|
|
|
|
|
|
|
|
fpm -s dir -C ./staging -n $PACKAGE \
|
|
|
|
--version $VERSION --epoch $EPOCH \
|
|
|
|
--before-install before-install.sh \
|
2024-08-10 01:58:44 +08:00
|
|
|
--after-install after-install.sh \
|
|
|
|
--after-remove after-remove.sh \
|
2021-08-13 18:53:18 +08:00
|
|
|
--description "The HTML5 components for BigBlueButton" \
|
|
|
|
$DIRECTORIES \
|
2023-04-27 04:26:51 +08:00
|
|
|
$OPTS
|