Skip to content

Commit

Permalink
build: add --fail and --show-error to usage of curl for awaing servic…
Browse files Browse the repository at this point in the history
…e readiness
  • Loading branch information
snario committed Apr 30, 2021
1 parent f5c29dd commit 7e6f393
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
6 changes: 4 additions & 2 deletions ops/scripts/batches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ RETRIES=${RETRIES:-40}

This comment has been minimized.

Copy link
@tynes

tynes Apr 30, 2021

Contributor

Without set -e adding --fail won't do anything

if [[ ! -z "$URL" ]]; then
# 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
export ADDRESS_MANAGER_ADDRESS=$(echo $ADDRESSES | jq -r '.AddressManager')
fi

# waits for l2geth to be up
curl --silent \
curl --fail \
--show-error \
--silent \
--retry-connrefused \
--retry $RETRIES \
--retry-delay 1 \
Expand Down
2 changes: 2 additions & 0 deletions ops/scripts/deployer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ JSON='{"jsonrpc":"2.0","id":0,"method":"net_version","params":[]}'

# wait for the base layer to be up
curl \
--fail \
--show-error \
--silent \
-H "Content-Type: application/json" \
--retry-connrefused \
Expand Down
2 changes: 1 addition & 1 deletion ops/scripts/dtl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ RETRIES=${RETRIES:-60}

if [[ ! -z "$URL" ]]; then
# 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
export DATA_TRANSPORT_LAYER__ADDRESS_MANAGER=$(echo $ADDRESSES | jq -r '.AddressManager')
fi
Expand Down
4 changes: 3 additions & 1 deletion ops/scripts/geth.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ VERBOSITY=${VERBOSITY:-6}

if [[ ! -z "$URL" ]]; then
# 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() {
VAR=$1
Expand All @@ -25,6 +25,8 @@ fi

# wait for the dtl to be up, else geth will crash if it cannot connect
curl \
--fail \
--show-error \
--silent \
--output /dev/null \
--retry-connrefused \
Expand Down
4 changes: 3 additions & 1 deletion ops/scripts/relayer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ RETRIES=${RETRIES:-60}

if [[ ! -z "$URL" ]]; then
# 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
export ADDRESS_MANAGER_ADDRESS=$(echo $ADDRESSES | jq -r '.AddressManager')
fi

# waits for l2geth to be up
curl \
--fail \
--show-error \
--silent \
--output /dev/null \
--retry-connrefused \
Expand Down

0 comments on commit 7e6f393

Please sign in to comment.