2023-09-30 07:08:38 +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)
|
|
|
|
|
|
|
|
#
|
|
|
|
# Clean up directories
|
|
|
|
rm -rf staging
|
|
|
|
|
|
|
|
#
|
|
|
|
# package
|
|
|
|
|
2023-12-14 23:59:10 +08:00
|
|
|
mkdir -p staging/usr/local/bigbluebutton/bbb-graphql-actions-temp
|
2023-09-30 07:08:38 +08:00
|
|
|
|
2023-12-14 23:59:10 +08:00
|
|
|
find -maxdepth 1 ! -path . ! -name staging $(printf "! -name %s " $(cat .build-files)) -exec cp -r {} staging/usr/local/bigbluebutton/bbb-graphql-actions-temp/ \;
|
2023-09-30 07:08:38 +08:00
|
|
|
|
|
|
|
pushd .
|
2023-12-14 23:59:10 +08:00
|
|
|
cd staging/usr/local/bigbluebutton/bbb-graphql-actions-temp/
|
2023-09-30 07:08:38 +08:00
|
|
|
npm -v
|
|
|
|
npm ci --no-progress
|
|
|
|
npm run build
|
|
|
|
popd
|
|
|
|
|
2023-12-14 23:59:10 +08:00
|
|
|
mkdir -p staging/usr/local/bigbluebutton/bbb-graphql-actions
|
2023-09-30 07:08:38 +08:00
|
|
|
pushd .
|
2023-12-14 23:59:10 +08:00
|
|
|
cd staging/usr/local/bigbluebutton/bbb-graphql-actions/
|
|
|
|
mv ../bbb-graphql-actions-temp/dist/* .
|
|
|
|
mv index.js bbb-graphql-actions.js
|
|
|
|
cp ../bbb-graphql-actions-temp/package.json .
|
|
|
|
cp ../bbb-graphql-actions-temp/package-lock.json .
|
2023-09-30 07:08:38 +08:00
|
|
|
npm ci --no-progress --omit=dev
|
2023-12-14 23:59:10 +08:00
|
|
|
rm -rf ../bbb-graphql-actions-temp/
|
2023-09-30 07:08:38 +08:00
|
|
|
popd
|
|
|
|
|
|
|
|
mkdir -p staging/usr/lib/systemd/system
|
2023-12-14 23:59:10 +08:00
|
|
|
cp bbb-graphql-actions.service staging/usr/lib/systemd/system
|
2023-09-30 07:08:38 +08:00
|
|
|
|
|
|
|
echo "List files"
|
|
|
|
find staging/
|
|
|
|
|
|
|
|
##
|
|
|
|
|
|
|
|
. ./opts-$DISTRO.sh
|
|
|
|
|
|
|
|
#
|
|
|
|
# Build package
|
|
|
|
fpm -s dir -C ./staging -n $PACKAGE \
|
|
|
|
--version $VERSION --epoch $EPOCH \
|
|
|
|
--after-install after-install.sh \
|
2023-12-14 23:59:10 +08:00
|
|
|
--before-install before-install.sh \
|
2023-09-30 07:08:38 +08:00
|
|
|
--before-remove before-remove.sh \
|
2023-12-14 23:59:10 +08:00
|
|
|
--description "BigBlueButton GraphQL Actions" \
|
2023-09-30 07:08:38 +08:00
|
|
|
$DIRECTORIES \
|
|
|
|
$OPTS \
|
|
|
|
-d 'nodejs (>= 18)' -d 'nodejs (<< 20)'
|
|
|
|
|