Commit 7e6f3933 authored by Liam Horne's avatar Liam Horne

build: add --fail and --show-error to usage of curl for awaing service readiness

parent f5c29ddd
...@@ -3,13 +3,15 @@ RETRIES=${RETRIES:-40} ...@@ -3,13 +3,15 @@ RETRIES=${RETRIES:-40}
if [[ ! -z "$URL" ]]; then if [[ ! -z "$URL" ]]; then
# get the addrs from the URL provided # get the addrs from the URL provided
ADDRESSES=$(curl --silent --retry-connrefused --retry $RETRIES --retry-delay 5 $URL) ADDRESSES=$(curl --fail --show-error --silent --retry-connrefused --retry $RETRIES --retry-delay 5 $URL)
# set the env # set the env
export ADDRESS_MANAGER_ADDRESS=$(echo $ADDRESSES | jq -r '.AddressManager') export ADDRESS_MANAGER_ADDRESS=$(echo $ADDRESSES | jq -r '.AddressManager')
fi fi
# waits for l2geth to be up # waits for l2geth to be up
curl --silent \ curl --fail \
--show-error \
--silent \
--retry-connrefused \ --retry-connrefused \
--retry $RETRIES \ --retry $RETRIES \
--retry-delay 1 \ --retry-delay 1 \
......
...@@ -6,6 +6,8 @@ JSON='{"jsonrpc":"2.0","id":0,"method":"net_version","params":[]}' ...@@ -6,6 +6,8 @@ JSON='{"jsonrpc":"2.0","id":0,"method":"net_version","params":[]}'
# wait for the base layer to be up # wait for the base layer to be up
curl \ curl \
--fail \
--show-error \
--silent \ --silent \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
--retry-connrefused \ --retry-connrefused \
......
...@@ -3,7 +3,7 @@ RETRIES=${RETRIES:-60} ...@@ -3,7 +3,7 @@ RETRIES=${RETRIES:-60}
if [[ ! -z "$URL" ]]; then if [[ ! -z "$URL" ]]; then
# get the addrs from the URL provided # get the addrs from the URL provided
ADDRESSES=$(curl --silent --retry-connrefused --retry $RETRIES --retry-delay 5 $URL) ADDRESSES=$(curl --fail --show-error --silent --retry-connrefused --retry $RETRIES --retry-delay 5 $URL)
# set the env # set the env
export DATA_TRANSPORT_LAYER__ADDRESS_MANAGER=$(echo $ADDRESSES | jq -r '.AddressManager') export DATA_TRANSPORT_LAYER__ADDRESS_MANAGER=$(echo $ADDRESSES | jq -r '.AddressManager')
fi fi
......
...@@ -4,7 +4,7 @@ VERBOSITY=${VERBOSITY:-6} ...@@ -4,7 +4,7 @@ VERBOSITY=${VERBOSITY:-6}
if [[ ! -z "$URL" ]]; then if [[ ! -z "$URL" ]]; then
# get the addrs from the URL provided # get the addrs from the URL provided
ADDRESSES=$(curl --silent --retry-connrefused --retry $RETRIES --retry-delay 5 $URL) ADDRESSES=$(curl --fail --show-error --silent --retry-connrefused --retry $RETRIES --retry-delay 5 $URL)
function envSet() { function envSet() {
VAR=$1 VAR=$1
...@@ -25,6 +25,8 @@ fi ...@@ -25,6 +25,8 @@ fi
# wait for the dtl to be up, else geth will crash if it cannot connect # wait for the dtl to be up, else geth will crash if it cannot connect
curl \ curl \
--fail \
--show-error \
--silent \ --silent \
--output /dev/null \ --output /dev/null \
--retry-connrefused \ --retry-connrefused \
......
...@@ -3,13 +3,15 @@ RETRIES=${RETRIES:-60} ...@@ -3,13 +3,15 @@ RETRIES=${RETRIES:-60}
if [[ ! -z "$URL" ]]; then if [[ ! -z "$URL" ]]; then
# get the addrs from the URL provided # get the addrs from the URL provided
ADDRESSES=$(curl --silent --retry-connrefused --retry $RETRIES --retry-delay 5 $URL) ADDRESSES=$(curl --fail --show-error --silent --retry-connrefused --retry $RETRIES --retry-delay 5 $URL)
# set the env # set the env
export ADDRESS_MANAGER_ADDRESS=$(echo $ADDRESSES | jq -r '.AddressManager') export ADDRESS_MANAGER_ADDRESS=$(echo $ADDRESSES | jq -r '.AddressManager')
fi fi
# waits for l2geth to be up # waits for l2geth to be up
curl \ curl \
--fail \
--show-error \
--silent \ --silent \
--output /dev/null \ --output /dev/null \
--retry-connrefused \ --retry-connrefused \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment