pass MSSQL_SA_PASSWORD to mssql container, and add MSSQL_HOST

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2969
GitOrigin-RevId: 42e4cdf36306148ea34ea19fd42ce5048a38dbbc
This commit is contained in:
Gil Mizrahi 2021-11-25 12:22:55 +02:00 committed by hasura-bot
parent 3166010ac1
commit f1cbe4e72b
2 changed files with 5 additions and 3 deletions

View File

@ -14,9 +14,10 @@ else
MSSQL_PORT=21433
fi
MSSQL_HOST=127.0.0.1
MSSQL_PASSWORD=hasuraMSSQL1
MSSQL_CONTAINER_NAME="hasura-dev-mssql-$MSSQL_PORT"
MSSQL_CONN_STR="DRIVER={ODBC Driver 17 for SQL Server};SERVER=127.0.0.1,$MSSQL_PORT;Uid=sa;Pwd=$MSSQL_PASSWORD;"
MSSQL_CONN_STR="DRIVER={ODBC Driver 17 for SQL Server};SERVER=$MSSQL_HOST,$MSSQL_PORT;Uid=sa;Pwd=$MSSQL_PASSWORD;"
MSSQL_DOCKER="docker exec -it $MSSQL_CONTAINER_NAME sqlcmd -S localhost -U sa -P $MSSQL_PASSWORD"
if [[ `uname -m` == 'arm64' ]]; then
@ -36,7 +37,8 @@ function mssql_launch_container(){
docker run --name $MSSQL_CONTAINER_NAME \
--platform "$MSSQL_PLATFORM" \
-e ACCEPT_EULA=1 \
-p 127.0.0.1:"$MSSQL_PORT":1433 -d "$MSSQL_CONTAINER_IMAGE"
-e "MSSQL_SA_PASSWORD=$MSSQL_PASSWORD" \
-p $MSSQL_HOST:"$MSSQL_PORT":1433 -d "$MSSQL_CONTAINER_IMAGE"
}
function mssql_wait {

View File

@ -127,4 +127,4 @@ to it from `graphql-engine` which runs on a different computer. Currently, mssql
`scripts/dev.sh mssql` will only be exposed to the machine it is run on.
To change that and expose it to other machines as well, we need to edit `scripts/containers/mssql.sh` and change
all instances of `127.0.0.1` to the external IP of the machine.
the `MSSQL_HOST` variable to the external IP of the machine.