This repository has been archived by the owner on Dec 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile.toml
207 lines (180 loc) · 5.97 KB
/
Makefile.toml
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
[config]
skip_core_tasks = true
[env]
LATEST_SERVER_TAG = { script = ["git -c 'versionsort.suffix=-' tag --list --sort=-v:refname 'automaat-server-*' | awk -F- '{print $NF}'"] }
LATEST_CLIENT_TAG = { script = ["git -c 'versionsort.suffix=-' tag --list --sort=-v:refname 'automaat-web-client-*' | awk -F- '{print $NF}'"] }
CONTAINER_RELEASE_IMG = "blendle/automaat:server-v${LATEST_SERVER_TAG}_web-client-v${LATEST_CLIENT_TAG}"
CONTAINER_DEVELOP_IMG = "blendle/automaat:latest"
SERVER_ROOT = "${CARGO_MAKE_WORKING_DIRECTORY}/src/web-client/static"
DATABASE_URL = "postgres://postgres@localhost"
ENCRYPTION_SECRET = "default secret"
[tasks.test]
description = "Run all tests."
category = "Development"
workspace = false
dependencies = [
"test::prettier-1",
"test::prettier-2",
"test::fmt",
"test::build",
"test::break-cache",
"test::clippy",
"test::unit",
"test::doc",
"web-client::test"
]
[tasks.watch]
description = "Watch for file changes, build the web client and run the server. The worker is not started."
category = "Development"
workspace = false
watch = { ignore_pattern = "{tmp/**/*,src/web-client/static/app/**/*,src/web-client/static/css/style.css,src/web-client/static/css/style.css.map}" }
script = [
'''
cargo make --cwd src/web-client debug && \
cargo make run-server
'''
]
[tasks.watch-server]
description = "Watch for file changes and run the server."
category = "Development"
workspace = false
watch = { ignore_pattern = "{tmp/**/*,src/web-client/static/app/**/*,src/web-client/static/css/style.css,src/web-client/static/css/style.css.map}" }
command = "cargo"
args = ["make", "run-server"]
[tasks.watch-worker]
description = "Watch for file changes and run the worker."
category = "Development"
workspace = false
watch = { ignore_pattern = "{tmp/**/*,src/web-client/static/app/**/*,src/web-client/static/css/style.css,src/web-client/static/css/style.css.map}" }
command = "cargo"
args = ["make", "run-worker"]
[tasks.run-server]
description = "Run the API server."
category = "Development"
workspace = false
command = "cargo"
args = ["run", "--all-features", "--", "server"]
[tasks.run-worker]
description = "Run the API worker."
category = "Development"
workspace = false
command = "cargo"
args = ["run", "--all-features", "--", "worker"]
[tasks.build-container-latest]
description = "Build a release Docker container (using the `latest` tag), including the server and web-client dependencies."
category = "Build"
workspace = false
dependencies = [
"web-client::release",
"docker::build-server",
"docker::build-image-latest"
]
[tasks.build-container-release]
description = "Build a release Docker container (using the tag `v${LATEST_SERVER_TAG}_web-client-v${LATEST_CLIENT_TAG}`), including the server and web-client dependencies."
category = "Build"
workspace = false
dependencies = [
"web-client::release",
"docker::build-server",
"docker::build-image-release"
]
[tasks.push-container-latest]
description = "Push an untagged release Docker container."
category = "Release"
workspace = false
command = "docker"
args = ["push", "${CONTAINER_DEVELOP_IMG}"]
dependencies = ["build-container-latest"]
[tasks.push-container-release]
description = "Push a tagged release Docker."
category = "Release"
workspace = false
command = "docker"
args = ["push", "${CONTAINER_RELEASE_IMG}"]
dependencies = ["build-container-release"]
[tasks."web-client::test"]
description = "Run all tests."
category = "Web Client"
workspace = false
command = "cargo"
args = ["make", "--cwd", "src/web-client", "test"]
[tasks."web-client::watch"]
description = "Watch for file changes and run the debug build task."
category = "Web Client"
workspace = false
command = "cargo"
args = ["make", "--cwd", "src/web-client", "watch"]
[tasks."web-client::release"]
description = "Create a production release build of the static files (Wasm + CSS)."
category = "Web Client"
workspace = false
command = "cargo"
args = ["make", "--cwd", "src/web-client", "release"]
[tasks."test::prettier-1"]
private = true
workspace = false
command = "prettier"
args = ["--check", "*.{graphql,toml,yml,yaml,md}", "!Makefile.toml"]
[tasks."test::prettier-2"]
private = true
workspace = false
command = "prettier"
args = ["--check", "./!(target)/**/*.{graphql,toml,yml,yaml,md}", "!./src/web-client/{target/**/*,Makefile.toml}"]
[tasks."test::fmt"]
private = true
workspace = false
command = "cargo"
args = ["fmt", "--all", "--", "--check"]
[tasks."test::build"]
private = true
workspace = false
command = "cargo"
args = ["build", "--all", "--bins", "--examples", "--tests", "--benches", "--all-targets", "--all-features"]
[tasks."test::clippy"]
private = true
workspace = false
command = "cargo"
args = ["clippy", "--all", "--bins", "--examples", "--tests", "--benches", "--all-targets", "--all-features"]
[tasks."test::unit"]
private = true
workspace = false
command = "cargo"
args = ["test", "--all", "--bins", "--examples", "--tests", "--benches", "--all-targets", "--all-features"]
[tasks."test::doc"]
private = true
workspace = false
command = "cargo"
args = ["doc", "--all", "--bins", "--all-features", "--no-deps", "--document-private-items"]
[tasks."test::break-cache"]
private = true
workspace = false
command = "find"
args = [".", "(", "-name", "lib.rs", "-o", "-name", "main.rs", ")", "-exec", "touch", "{}", ";"]
[tasks."docker::build-server"]
private = true
workspace = false
command = "docker"
args = [
"run",
"--rm",
"--volume", "cargo-cache:/root/.cargo/registry",
"--volume", "${CARGO_MAKE_WORKING_DIRECTORY}:/volume",
"clux/muslrust:stable",
"cargo", "build", "--bin", "automaat-server", "--release",
]
[tasks."docker::build-image-latest"]
private = true
workspace = false
command = "docker"
args = ["build", "--tag", "${CONTAINER_DEVELOP_IMG}", "${CARGO_MAKE_WORKING_DIRECTORY}"]
[tasks."docker::build-image-release"]
private = true
workspace = false
command = "docker"
args = ["build", "--tag", "${CONTAINER_RELEASE_IMG}", "${CARGO_MAKE_WORKING_DIRECTORY}"]
[tasks.default]
private = true
disabled = true
[tasks.empty]
private = true
disabled = true