-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy_apps.sh
More file actions
executable file
·62 lines (50 loc) · 1.44 KB
/
deploy_apps.sh
File metadata and controls
executable file
·62 lines (50 loc) · 1.44 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
# Simple deployment script for PixeLAW example apps
wait_for_local_katana() {
while true; do
response=$(curl --write-out '%{http_code}' --silent --output /dev/null http://localhost:5050)
if [ "$response" -eq 200 ]; then
break
else
echo "Waiting for katana at http://localhost:5050"
sleep 2
fi
done
}
deploy_app() {
APP_NAME=$1
WORLD_ADDRESS=$2
PROFILE=dev
echo "Deploying $APP_NAME..."
pushd $APP_NAME
# Build and migrate
sozo --profile $PROFILE build
if [ -n "$WORLD_ADDRESS" ]; then
echo "Deploying to existing world: $WORLD_ADDRESS"
sozo --profile $PROFILE migrate --wait --world $WORLD_ADDRESS
else
echo "Deploying to new world"
sozo --profile $PROFILE migrate --wait
fi
# Modern Dojo handles initialization automatically via dojo_init function
# No manual init or permission setup needed!
echo "Deployment of $APP_NAME completed!"
popd
}
# Main script logic
if [ -z "$1" ]; then
echo "Usage: $0 <app_name> [vanilla]"
echo "Examples:"
echo " $0 chest # Deploy locally"
echo " $0 chest vanilla # Deploy to vanilla core"
exit 1
fi
APP_NAME=$1
DEPLOY_TYPE=$2
wait_for_local_katana
if [ "$DEPLOY_TYPE" = "vanilla" ]; then
VANILLA_WORLD="0x4101f5a29dc3e9dc48e2d8918e8121315757f2d2bc56fb6213dfc949344c071"
deploy_app $APP_NAME $VANILLA_WORLD
else
deploy_app $APP_NAME
fi