2021-08-13 18:53:18 +08:00
|
|
|
#!/bin/bash -ex
|
|
|
|
|
|
|
|
TARGET=`basename $(pwd)`
|
|
|
|
BUILD=$1
|
|
|
|
|
|
|
|
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=""
|
|
|
|
for dir in $DIRS; do
|
|
|
|
mkdir -p staging$dir
|
|
|
|
DIRECTORIES="$DIRECTORIES --directories $dir"
|
|
|
|
done
|
|
|
|
|
|
|
|
##
|
|
|
|
|
2021-08-31 05:50:06 +08:00
|
|
|
mkdir -p staging/var/bigbluebutton/learning-dashboard
|
2021-08-13 18:53:18 +08:00
|
|
|
|
2022-03-06 11:51:27 +08:00
|
|
|
mkdir -p staging/usr/share/bigbluebutton/nginx
|
|
|
|
cp learning-dashboard.nginx staging/usr/share/bigbluebutton/nginx
|
2021-08-13 18:53:18 +08:00
|
|
|
|
|
|
|
|
2021-08-31 05:50:06 +08:00
|
|
|
# install dependencies, create build, copy build over to destination
|
|
|
|
npm ci
|
2021-08-13 18:53:18 +08:00
|
|
|
npm run build
|
2021-08-31 05:50:06 +08:00
|
|
|
cp -r build/* staging/var/bigbluebutton/learning-dashboard
|
2021-08-13 18:53:18 +08:00
|
|
|
|
|
|
|
##
|
|
|
|
|
|
|
|
. ./opts-$DISTRO.sh
|
|
|
|
|
|
|
|
fpm -s dir -C ./staging -n $PACKAGE \
|
|
|
|
--version $VERSION --epoch $EPOCH \
|
2021-08-31 05:50:06 +08:00
|
|
|
--before-install before-install.sh \
|
2021-08-13 18:53:18 +08:00
|
|
|
--after-install after-install.sh \
|
|
|
|
--after-remove after-remove.sh \
|
|
|
|
--depends unzip \
|
2021-08-31 05:50:06 +08:00
|
|
|
--description "BigBlueButton bbb-learning-dashboard" \
|
2021-08-13 18:53:18 +08:00
|
|
|
$DIRECTORIES \
|
|
|
|
$OPTS
|
|
|
|
|