Skip to content

Commit

Permalink
build: download Hasura CLI in build.sh instead of calling an external…
Browse files Browse the repository at this point in the history
… script
  • Loading branch information
gustavotrott committed Dec 9, 2024
1 parent 8c97a36 commit 1358b38
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions build/packages-template/bbb-graphql-server/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,39 @@ cp bbb-pg.conf staging/etc/postgresql/$POSTGRES_MAJOR_VERSION/main/conf.d

cp bbb-graphql-server.service staging/lib/systemd/system/bbb-graphql-server.service

# Install Hasura CLI
curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | INSTALL_PATH=staging/usr/bin VERSION=$HASURA_VERSION bash
# ============= Begin: Install Hasura CLI =============
# The logic bellow is based on https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh

platform='unknown'
unamestr=`uname`
if [ "$unamestr" == 'Linux' ]; then
platform='linux'
elif [ "$unamestr" == 'Darwin' ]; then
platform='darwin'
else
echo "Unknown OS platform"
exit 1
fi

arch='unknown'
archstr=`uname -m`
if [ "$archstr" == 'x86_64' ]; then
arch='amd64'
elif [ "$archstr" == 'arm64' ] || [ "$archstr" == 'aarch64' ]; then
arch='arm64'
else
echo "prebuilt binaries for $(arch) architecture not available"
exit 1
fi

url="https://github.com/hasura/graphql-engine/releases/download/${HASURA_VERSION}/cli-hasura-${platform}-${arch}"

echo "Downloading Hasura CLI from $url"

curl -L -f -o staging/usr/bin/hasura "$url"
chmod +x staging/usr/bin/hasura
staging/usr/bin/hasura version --skip-update-check
# ============= End: Install Hasura CLI =============


. ./opts-$DISTRO.sh
Expand Down

0 comments on commit 1358b38

Please sign in to comment.