2023-04-29 01:32:09 +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)
|
|
|
|
BUILD=$1
|
|
|
|
|
|
|
|
#
|
|
|
|
# Clean up directories
|
|
|
|
rm -rf staging
|
|
|
|
|
|
|
|
#
|
|
|
|
# package
|
|
|
|
|
2023-07-18 04:26:07 +08:00
|
|
|
# Create directories for fpm to process
|
2023-08-29 22:01:23 +08:00
|
|
|
DIRS="/usr/local/bin /etc/default /usr/share/bbb-graphql-server /lib/systemd/system"
|
2023-07-18 04:26:07 +08:00
|
|
|
for dir in $DIRS; do
|
|
|
|
mkdir -p staging$dir
|
|
|
|
done
|
|
|
|
|
2024-02-02 22:14:47 +08:00
|
|
|
git clone --branch v2.37.0 https://github.com/iMDT/hasura-graphql-engine.git
|
2023-04-29 01:32:09 +08:00
|
|
|
cat hasura-graphql-engine/hasura-graphql.part-a* > hasura-graphql
|
|
|
|
rm -rf hasura-graphql-engine/
|
|
|
|
chmod +x hasura-graphql
|
|
|
|
cp -r hasura-graphql staging/usr/local/bin/hasura-graphql-engine
|
|
|
|
|
2023-07-19 23:28:44 +08:00
|
|
|
cp -r hasura-config.env staging/etc/default/bbb-graphql-server
|
|
|
|
cp -r bbb_schema.sql metadata config.yaml staging/usr/share/bbb-graphql-server
|
2023-04-29 01:32:09 +08:00
|
|
|
|
|
|
|
cp ./bbb-graphql-server.service staging/lib/systemd/system/bbb-graphql-server.service
|
|
|
|
|
|
|
|
mkdir -p hasura-cli
|
|
|
|
cd hasura-cli
|
2024-03-25 21:36:52 +08:00
|
|
|
npm install --save-dev hasura-cli@2.36.2
|
2023-08-29 22:01:23 +08:00
|
|
|
cp node_modules/hasura-cli/hasura ../staging/usr/local/bin/hasura
|
2023-04-29 01:32:09 +08:00
|
|
|
cd ..
|
|
|
|
rm -rf hasura-cli
|
|
|
|
|
|
|
|
. ./opts-$DISTRO.sh
|
|
|
|
|
|
|
|
#
|
|
|
|
# Build package
|
|
|
|
fpm -s dir -C ./staging -n $PACKAGE \
|
|
|
|
--version $VERSION --epoch $EPOCH \
|
|
|
|
--after-install after-install.sh \
|
|
|
|
--after-remove after-remove.sh \
|
|
|
|
--before-remove before-remove.sh \
|
|
|
|
--description "GraphQL server component for BigBlueButton" \
|
|
|
|
$DIRECTORIES \
|
|
|
|
$OPTS
|