-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
104 lines (84 loc) · 2.56 KB
/
Makefile
File metadata and controls
104 lines (84 loc) · 2.56 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# sets the individual app to deploy with deploy_app
APP ?= paint
# To get all the subdirectories in this directory
SUBDIRS := $(wildcard */)
# Get all app directories (those with Scarb.toml files)
APPS := $(shell find . -maxdepth 2 -name 'Scarb.toml' -not -path './.devcontainer/*' | xargs dirname | sort)
### Deploys all the apps in this repository (this script assumes that every subdirectory is an app)
deploy_all:
@for dir in $(SUBDIRS); do \
app_name=$$(basename $$dir); \
echo "Deploying $$app_name"; \
./deploy_apps.sh $$app_name; \
done
### Deploys an individual app
# to use make deploy_app APP=<put_app_name_here>
deploy_app:
./deploy_apps.sh $(APP)
### Deploys an individual app to vanilla core
# to use make deploy_app_vanilla APP=<put_app_name_here>
deploy_app_vanilla:
./deploy_apps.sh $(APP) vanilla
### Deploys all apps to vanilla core
deploy_all_vanilla:
@for dir in $(SUBDIRS); do \
app_name=$$(basename $$dir); \
echo "Deploying $$app_name to vanilla core"; \
./deploy_apps.sh $$app_name vanilla; \
done
### Starts up the core
start_core:
docker compose up -d
### Shuts down the core
stop_core:
docker compose down
### Shuts down the core, removes the volumes attached, then starts it up again
reset:
docker compose down -v
docker compose up -d
### Starts up the core then deploys all the apps
start:
$(MAKE) start_core
$(MAKE) deploy_all
### Shuts down the core
stop: stop_core
### Allows you to go inside the core and execute bash scripts
shell:
docker compose exec pixelaw-core bash;
### Outputs katana logs
log_katana:
docker compose exec pixelaw-core tail -n 200 -f /keiko/log/katana.log.json
### Outputs torii logs
log_torii:
docker compose exec pixelaw-core tail -f /keiko/log/torii.log
### Outputs bot logs
log_bots:
docker compose exec pixelaw-core tail -f /keiko/log/bots.log
### Clean all Scarb.lock files
clean_locks:
@echo "Cleaning all Scarb.lock files..."
@find . -name "Scarb.lock" -not -path "./.devcontainer/*" -delete
### Build all apps
build_all: clean_locks
@for app in $(APPS); do \
echo "Building $$app..."; \
(cd $$app && sozo build) || exit 1; \
done
### Test all apps
test_all: clean_locks
@for app in $(APPS); do \
echo "Testing $$app..."; \
(cd $$app && sozo test) || exit 1; \
done
### Format all apps
fmt_all:
@for app in $(APPS); do \
echo "Formatting $$app..."; \
(cd $$app && scarb fmt) || exit 1; \
done
### Check the format of all apps
fmt_check:
@for app in $(APPS); do \
echo "Checking format of $$app..."; \
(cd $$app && scarb fmt --check) || exit 1; \
done