Run build after setting Nitro addresses

This commit is contained in:
Prathamesh Musale 2023-09-18 11:57:59 +05:30
parent adc4607fd7
commit 3a533c42be
2 changed files with 16 additions and 9 deletions

View File

@ -1,4 +1,5 @@
#!/bin/sh
#!/bin/bash
set -e
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
set -x
@ -10,7 +11,7 @@ CERC_CA_ADDRESS="${CERC_CA_ADDRESS:-${DEFAULT_CERC_CA_ADDRESS}}"
NITRO_ADDRESSES_FILE_PATH="/nitro/nitro-addresses.json"
# Check if CERC_NITRO_CONTRACTS environment variable set to skip contract deployment
# Check if CERC_NA_ADDRESS environment variable set to skip contract deployment
if [ -n "$CERC_NA_ADDRESS" ]; then
echo "CERC_NA_ADDRESS is set to '$CERC_NA_ADDRESS'"
echo "CERC_VPA_ADDRESS is set to '$CERC_VPA_ADDRESS'"

View File

@ -1,4 +1,5 @@
#!/bin/sh
#!/bin/bash
set -e
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
set -x
@ -13,8 +14,10 @@ CERC_RELAY_ANNOUNCE_DOMAIN="${CERC_RELAY_ANNOUNCE_DOMAIN:-${DEFAULT_CERC_RELAY_A
CERC_ENABLE_PEER_L2_TXS="${CERC_ENABLE_PEER_L2_TXS:-${DEFAULT_CERC_ENABLE_PEER_L2_TXS}}"
CERC_DEPLOYED_CONTRACT="${CERC_DEPLOYED_CONTRACT:-${DEFAULT_CERC_DEPLOYED_CONTRACT}}"
NITRO_ADDRESSES_FILE_PATH="/nitro/nitro-addresses.json"
DESTINATION_FILE_PATH="./src/nitro-addresses.json"
nitro_addresses_file="/nitro/nitro-addresses.json"
nitro_addresses_destination_file="./src/nitro-addresses.json"
watcher_keys_dir="./keys"
echo "Using L2 RPC endpoint ${CERC_L2_GETH_RPC}"
@ -35,11 +38,14 @@ else
fi
# Copy the deployed Nitro addresses to the required path
if [ -f "$NITRO_ADDRESSES_FILE_PATH" ]; then
cat "$NITRO_ADDRESSES_FILE_PATH" > "$DESTINATION_FILE_PATH"
echo "Nitro addresses set to ${DESTINATION_FILE_PATH}"
if [ -f "$nitro_addresses_file" ]; then
cat "$nitro_addresses_file" > "$nitro_addresses_destination_file"
echo "Nitro addresses set to ${nitro_addresses_destination_file}"
# Build after setting the Nitro addresses
yarn build
else
echo "File ${NITRO_ADDRESSES_FILE_PATH} does not exist"
echo "File ${nitro_addresses_file} does not exist"
exit 1
fi