Standardize deployment env and deployer handling
This commit is contained in:
@@ -29,16 +29,6 @@ fi
|
||||
DEPLOYMENT_LOG="${PROJECT_ROOT}/deployment.log"
|
||||
CONTRACT_ADDRESSES_FILE="${PROJECT_ROOT}/contracts-deployed.json"
|
||||
|
||||
# Load environment variables
|
||||
if [ -f "${PROJECT_ROOT}/.env" ]; then
|
||||
set -a
|
||||
source "${PROJECT_ROOT}/.env"
|
||||
set +a
|
||||
else
|
||||
log_error "Error: .env file not found. Please create .env file from .env.example"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Logging function
|
||||
log() {
|
||||
log_success "[$(date +'%Y-%m-%d %H:%M:%S')] $1" | tee -a "$DEPLOYMENT_LOG"
|
||||
@@ -132,6 +122,12 @@ check_prerequisites() {
|
||||
error "Required environment variable $var is not set"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$SKIP_CONTRACTS" != "true" ]; then
|
||||
export RPC_URL="${RPC_URL:-${RPC_URL_138:-${CHAIN138_RPC_URL:-}}}"
|
||||
require_private_key_env || exit 1
|
||||
[[ -n "${RPC_URL:-}" ]] || error "Required environment variable RPC_URL is not set"
|
||||
fi
|
||||
|
||||
if [ $missing -eq 0 ]; then
|
||||
log "All prerequisites met"
|
||||
|
||||
Reference in New Issue
Block a user