mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-11-10 18:50:52 +03:00
parent
4a76c7e89e
commit
57f9bfc478
@ -4,6 +4,18 @@ set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
CLI_ROOT="${BASH_SOURCE[0]%/*}/../cli"
|
||||
|
||||
wait_for_port() {
|
||||
local PORT=$1
|
||||
echo "waiting for $PORT"
|
||||
for i in `seq 1 60`;
|
||||
do
|
||||
nc -z localhost $PORT && echo "port $PORT is ready" && return
|
||||
echo -n .
|
||||
sleep 1
|
||||
done
|
||||
echo "Failed waiting for $PORT" && exit 1
|
||||
}
|
||||
|
||||
cd "$CLI_ROOT"
|
||||
mkdir -p /build/_cli_output
|
||||
touch /build/_cli_output/server.log
|
||||
@ -13,6 +25,8 @@ touch /build/_cli_output/server.log
|
||||
--database-url postgres://gql_test@localhost:5432/gql_test serve > /build/_cli_output/server.log 2>&1 &
|
||||
#PID=$!
|
||||
|
||||
wait_for_port 8080
|
||||
|
||||
# test cli
|
||||
HASURA_GRAPHQL_TEST_ENDPOINT="http://localhost:8080" make test
|
||||
#kill $PID
|
||||
#kill $PID
|
||||
|
@ -4,6 +4,18 @@ set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
CONSOLE_ROOT="${BASH_SOURCE[0]%/*}/../console"
|
||||
|
||||
wait_for_port() {
|
||||
local PORT=$1
|
||||
echo "waiting for $PORT"
|
||||
for i in `seq 1 60`;
|
||||
do
|
||||
nc -z localhost $PORT && echo "port $PORT is ready" && return
|
||||
echo -n .
|
||||
sleep 1
|
||||
done
|
||||
echo "Failed waiting for $PORT" && exit 1
|
||||
}
|
||||
|
||||
cd "$CONSOLE_ROOT"
|
||||
|
||||
mkdir -p /build/_console_output
|
||||
@ -14,12 +26,16 @@ touch /build/_console_output/cli.log
|
||||
/build/_server_output/graphql-engine \
|
||||
--database-url postgres://gql_test@localhost:5432/gql_test serve > /build/_console_output/server.log 2>&1 &
|
||||
|
||||
wait_for_port 8080
|
||||
|
||||
# start cli
|
||||
/build/_cli_output/hasura-linux-amd64 init --directory gql-test && cd gql-test
|
||||
/build/_cli_output/hasura-linux-amd64 console --no-browser > /build/_console_output/cli.log 2>&1 &
|
||||
|
||||
cd ..
|
||||
|
||||
wait_for_port 9693
|
||||
|
||||
export PORT=3000
|
||||
export NODE_ENV=development
|
||||
export DATA_API_URL=http://localhost:8080
|
||||
|
Loading…
Reference in New Issue
Block a user