-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile.toml
102 lines (89 loc) · 2 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
# project tasks
[tasks.api-run]
workspace = false
env = { RUST_LOG = "info" }
install_crate = "cargo-shuttle"
command = "cargo"
args = ["shuttle", "run"]
[tasks.api-run-actix]
workspace = false
command = "cargo"
args = ["run", "--bin", "api-actix"]
[tasks.front-serve]
workspace = false
cwd = "./front"
install_crate = "dioxus-cli"
command = "dx"
args = ["serve", "--port", "8000"]
[tasks.front-build]
workspace = false
script_runner = "@shell"
script = '''
# shuttle issue with static files
# location is different depending on the environment
rm -rf api/shuttle/static static
mkdir api/shuttle/static
mkdir static
cd front
dx build --release
# local development
cp -r dist/* ../api/shuttle/static
# production
cp -r dist/* ../static
'''
# local db
[tasks.db-start]
workspace = false
script_runner = "@shell"
script = '''
docker run -d --name devbcn-workshop -p 5432:5432 -e POSTGRES_PASSWORD=postgres -e POSTGRES_USER=postgres -e POSTGRES_DB=devbcn postgres
'''
[tasks.db-stop]
workspace = false
script_runner = "@shell"
script = '''
docker stop postgres
docker rm postgres
'''
# general tasks
[tasks.clippy]
workspace = false
install_crate = "cargo-clippy"
command = "cargo"
args = ["clippy"]
[tasks.format]
clear = true
workspace = false
install_crate = "rustfmt"
command = "cargo"
args = ["fmt", "--all", "--", "--check"]
# book tasks
[tasks.book-preprocessors]
workspace = false
script_runner = "@shell"
script = '''
cargo install mdbook-mermaid
cargo install mdbook-admonish
cargo install mdbook-toc
'''
[tasks.book-build-ci]
workspace = false
run_task = { name = ["book-build-inner"] }
[tasks.book-build]
workspace = false
run_task = { name = ["book-preprocessors", "book-build-inner"] }
[tasks.book-serve]
workspace = false
run_task = { name = ["book-preprocessors", "book-serve-inner"] }
[tasks.book-build-inner]
workspace = false
cwd = "./docs"
install_crate = "mdbook"
command = "mdbook"
args = ["build"]
[tasks.book-serve-inner]
workspace = false
cwd = "./docs"
install_crate = "mdbook"
command = "mdbook"
args = ["serve"]