2024-07-26 10:32:27 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
|
|
|
set -x
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Using the following env variables:"
|
|
|
|
echo "WALLET_CONNECT_ID: ${WALLET_CONNECT_ID}"
|
|
|
|
echo "CERC_DEFAULT_GAS_PRICE: ${CERC_DEFAULT_GAS_PRICE}"
|
|
|
|
echo "CERC_GAS_ADJUSTMENT: ${CERC_GAS_ADJUSTMENT}"
|
2024-07-29 12:55:23 +00:00
|
|
|
echo "CERC_LACONICD_RPC_URL: ${CERC_LACONICD_RPC_URL}"
|
2024-07-26 10:32:27 +00:00
|
|
|
|
|
|
|
# Build with required env
|
|
|
|
REACT_APP_WALLET_CONNECT_PROJECT_ID=$WALLET_CONNECT_ID \
|
2024-07-29 07:15:44 +00:00
|
|
|
REACT_APP_DEFAULT_GAS_PRICE=$CERC_DEFAULT_GAS_PRICE \
|
|
|
|
REACT_APP_GAS_ADJUSTMENT=$CERC_GAS_ADJUSTMENT \
|
2024-07-29 12:55:23 +00:00
|
|
|
REACT_APP_LACONICD_RPC_URL=$CERC_LACONICD_RPC_URL \
|
2024-07-26 10:32:27 +00:00
|
|
|
yarn build
|
|
|
|
|
2024-10-25 13:50:11 +00:00
|
|
|
# Define the directory and file path
|
|
|
|
FILE_PATH="/app/build/.well-known/walletconnect.txt"
|
|
|
|
|
|
|
|
# Create the directory if it doesn't exist
|
|
|
|
mkdir -p "$(dirname "$FILE_PATH")"
|
|
|
|
# Write verification code to the file
|
|
|
|
echo "$WALLET_CONNECT_VERIFY_CODE" > "$FILE_PATH"
|
|
|
|
|
|
|
|
# Serve build dir
|
2024-07-29 07:15:44 +00:00
|
|
|
http-server --proxy http://localhost:80? -p 80 /app/build
|