-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile.toml
More file actions
132 lines (109 loc) · 3.04 KB
/
Makefile.toml
File metadata and controls
132 lines (109 loc) · 3.04 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
[config]
default_to_workspace = false
[env]
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
RUST_LOG = "info,gotcha_server=debug,client=debug"
###################
# Main Tasks
###################
[tasks.default]
alias = "build"
[tasks.build]
description = "Build server and widgets"
dependencies = ["server-build", "widget-api-build", "bundle-widgets"]
[tasks.dev]
description = "Build server and widgets"
run_task = { name = [
"watch-server",
"watch-client",
"watch-widget_api",
"bundle-widgets",
], fork = true, parallel = true }
[tasks.bundle]
description = "Bundle for deployment"
run_task = { name = [
"server-bundle",
"widget-api-build",
"bundle-widgets",
], fork = true, parallel = true }
###################
# Server Tasks
###################
[tasks.server-build]
description = "Build server"
command = "cargo"
args = ["build", "${@}"]
[tasks.watch-server]
description = "Watch and run the server"
command = "cargo"
args = ["run", "-q", "-p", "gotcha-server"]
watch = { watch = ["./server"], ignore_pattern = "server/examples/*" }
[tasks.watch-client]
description = "Watch and run the client"
command = "cargo"
args = ["run", "-q", "--example", "client"]
watch = { watch = ["./server/examples/client/"], ignore_pattern = "assets/*" }
[tasks.server-bundle]
description = "Bundle server for aws lambda"
command = "cargo"
args = ["lambda", "build", "--release", "--arm64", "--features", "aws-lambda"]
###################
# Widget Tasks
###################
[tasks.widget-api-build]
description = "Build npm-based widgets"
cwd = "./widget-api"
script_runner = "@shell"
script = ["npm install --prefer-offline", "npm run build"]
[tasks.watch-widget_api]
description = "Watch and bundle widget-api"
cwd = "./widget-api"
command = "npm"
args = ["run", "build"]
watch = { watch = ["./widget-api"] }
[tasks.bundle-cup_stack]
description = "Bundle cup-stack to /dist"
cwd = "./widgets"
script = [
"bevy build --yes --bin=cup-stack --profile=wasm-release web --bundle",
"mkdir -p ../dist/cup-stack",
"cp -r target/bevy_web/wasm-release/cup-stack/* ../dist/cup-stack",
]
[tasks.bundle-widgets]
description = "Bundle npm-based widgets"
dependencies = ["bundle-cup_stack", "bundle-constellation"]
[tasks.bundle-constellation]
description = "Bundle constellation widget"
cwd = "./widgets/constellation"
script_runner = "@shell"
script = ["npm install --prefer-offline", "npm run build"]
###################
# Database Tasks
###################
[tasks.db-up]
description = "Start the database using Docker Compose"
command = "docker-compose"
args = ["up", "-d"]
[tasks.db-stop]
description = "Stop the database"
command = "docker-compose"
args = ["stop"]
[tasks.db-down]
description = "Stop and remove the database containers"
command = "docker-compose"
args = ["down"]
[tasks.db-migrate]
description = "Run database migrations"
command = "cargo"
args = ["sqlx", "migrate", "run"]
[tasks.db-prepare]
description = "Run database migrations"
command = "cargo"
args = [
"sqlx",
"prepare",
"--workspace",
"--",
"--all-targets",
"--all-features",
]