-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmigrate.sh
More file actions
executable file
·36 lines (29 loc) · 860 Bytes
/
migrate.sh
File metadata and controls
executable file
·36 lines (29 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Stop script on error
set -e
# Load environment variables from the appropriate file
ENV_FILE=".env.sepolia"
if [ -f "$ENV_FILE" ]; then
echo "Loading environment variables from $ENV_FILE..."
export $(grep -v '^#' "$ENV_FILE" | xargs)
else
echo "Environment file $ENV_FILE not found!"
exit 1
fi
# Define a cleanup function to clear environment variables
cleanup_env() {
echo "Cleaning up environment variables..."
unset STARKNET_RPC_URL
unset DOJO_ACCOUNT_ADDRESS
unset DOJO_PRIVATE_KEY
echo "Environment variables cleared."
}
# Set the trap to execute cleanup on script exit or error
trap cleanup_env EXIT
# Build the project
echo "Building the project..."
sozo -P sepolia build
# Deploy the project
echo "Deploying to Sepolia..."
sozo -P sepolia migrate
# Deployment succeeded message
echo "Deployment completed successfully."