graphql-engine/scripts/cabal-run.sh
Robert 5df40cc65b multitenant tests: reduce reliance on env vars, use fake cabal run
There's two major parts to this change:

1. cut down on environment variables needed to run the tests:
  - lux parameters that don't change are now in code
  - most remaining parameters have reasonable defaults
  - the only variable that is still required to be set is HASURA_MULTITENANT_SPEC_DB_URL
  - env.sh is no longer needed
2. find a better work-around for the problems running graphql-engine-multitenant
  via cabal run (https://github.com/haskell/cabal/issues/7914), by adding a shell
  script that implements a more correct version of cabal run.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3461
GitOrigin-RevId: 0939a79cc45cd3c1c103719552b12099678850dd
2022-01-24 18:15:25 +00:00

24 lines
364 B
Bash
Executable File

#!/usr/bin/env bash
# cabal-run.sh target args
#
# is equivalent to
#
# cabal run target --args
#
# except that killing it will also kill the target.
#
# https://github.com/haskell/cabal/issues/7914
set -euo pipefail
target="$1"
shift
echo "building target: ${target}"
cabal build "$target"
executable=$(cabal list-bin "$target")
exec "$executable" "$@"