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)
|
|
|
|
|
|
|
|
#
|
|
|
|
# Clean up directories
|
|
|
|
rm -rf staging
|
|
|
|
|
|
|
|
#
|
|
|
|
# Create directory for fpm to process
|
|
|
|
DIRS="/usr/share/bbb-lti"
|
|
|
|
for dir in $DIRS; do
|
|
|
|
mkdir -p staging$dir
|
|
|
|
DIRECTORIES="$DIRECTORIES --directories $dir"
|
|
|
|
done
|
|
|
|
|
|
|
|
##
|
|
|
|
|
2022-03-04 10:46:22 +08:00
|
|
|
# After extracting out bbb-lti into its own repository there is an additional directory level
|
|
|
|
if [ -d bbb-lti ]; then
|
|
|
|
cd bbb-lti/
|
|
|
|
fi
|
|
|
|
|
2021-08-13 18:53:18 +08:00
|
|
|
gradle clean
|
|
|
|
gradle resolveDeps
|
|
|
|
grails assemble
|
|
|
|
|
2022-03-04 10:46:22 +08:00
|
|
|
cd ..
|
|
|
|
|
2021-08-13 18:53:18 +08:00
|
|
|
mkdir -p staging/lib/systemd/system
|
|
|
|
cp bbb-lti.service staging/lib/systemd/system
|
|
|
|
|
|
|
|
mkdir -p staging/etc/bigbluebutton/nginx
|
2022-03-04 10:46:22 +08:00
|
|
|
cp bbb-lti/lti.nginx staging/etc/bigbluebutton/nginx
|
2021-08-13 18:53:18 +08:00
|
|
|
|
|
|
|
mkdir -p staging/usr/share/bbb-lti
|
2022-03-04 10:46:22 +08:00
|
|
|
cp bbb-lti/build/libs/bbb-lti-0.5.war staging/usr/share/bbb-lti
|
2021-08-13 18:53:18 +08:00
|
|
|
|
|
|
|
cd staging/usr/share/bbb-lti
|
|
|
|
jar -xvf bbb-lti-0.5.war
|
|
|
|
rm bbb-lti-0.5.war
|
|
|
|
cd ../../../..
|
|
|
|
|
|
|
|
cp run-prod.sh staging/usr/share/bbb-lti
|
|
|
|
chmod +x staging/usr/share/bbb-lti/run-prod.sh
|
|
|
|
|
|
|
|
##
|
|
|
|
|
|
|
|
. ./opts-$DISTRO.sh
|
|
|
|
|
|
|
|
fpm -s dir -C ./staging -n $PACKAGE \
|
|
|
|
--version $VERSION --epoch $EPOCH \
|
|
|
|
--after-install after-install.sh \
|
|
|
|
--after-remove after-remove.sh \
|
|
|
|
--depends unzip \
|
|
|
|
--description "BigBlueButton endpoint for LTI" \
|
|
|
|
$DIRECTORIES \
|
|
|
|
$OPTS
|
|
|
|
|