graphql-engine/.envrc
Samir Talwar 2467e23ef6 docker: Always use the official SQL Server image for testing.
Now that Docker for macOS supports using Rosetta for x86/amd64 emulation, we no longer need to use the `azure-sql-edge` image. We can always use the official `mcr.microsoft.com/mssql/server` one.

This also means that we no longer need the separate healthcheck container, because the official image ships with `sqlcmd`.

When this is merged, you will need to ensure you have enabled Rosetta emulation in the Docker settings to test against SQL Server on macOS. This requires macOS 13 (Ventura).

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10139
GitOrigin-RevId: 2225bf5f4c6d3632da1f29b2229c9b04ead5e34c
2023-09-25 13:27:23 +00:00

54 lines
1.4 KiB
Bash

#!/usr/bin/env bash
# This file provides some tooling on an opt-in basis via `direnv`
# (https://direnv.net/)
# To use the functionality here, create an `.envrc.local` file in this folder
# that runs the functions you need.
# There is an example in `.envrc.local.example` you can start with
# `use nvm`
# if `nvm` is installed, use it to select the right node.js version
# as defined in the `.nvmrc` file
use_nvm() {
local NVM_DIR
if [[ -z "${XDG_CONFIG_HOME:-}" ]]; then
NVM_DIR="${HOME}/.nvm"
else
NVM_DIR="${XDG_CONFIG_HOME}/nvm"
fi
if ! [[ -d "$NVM_DIR" ]]; then
echo >&2 "ERROR: nvm not found. Could not set the node.js version."
return 1
fi
# shellcheck source=/dev/null
[[ -s "$NVM_DIR/nvm.sh" ]] && \. "$NVM_DIR/nvm.sh" # This loads nvm
nvm use
}
# `use ghcup`
# if `ghcup` is available, use it to install and set the GHC version
# as defined in the `.ghcversion` file
use_ghcup() {
local GHC_VERSION GHCUP_PATH
GHC_VERSION="$(<.ghcversion)"
GHCUP_PATH="$(which ghcup)"
if [[ -z "$GHC_VERSION" ]]; then
echo >&2 'ERROR: Required GHC version not found.'
return 1
fi
if [[ -z "$GHCUP_PATH" ]]; then
echo 'ERROR: ghcup not found. Could not set the GHC version.'
return 1
fi
if ! ghcup whereis ghc "$GHC_VERSION" &> /dev/null; then
ghcup install ghc "$GHC_VERSION"
fi
ghcup set ghc "$GHC_VERSION"
}
# this line sources your `.envrc.local` file
source_env_if_exists .envrc.local