-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.toml
40 lines (33 loc) 路 848 Bytes
/
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
[tasks.dev]
install_crate = "cargo-watch"
command = "cargo"
args = ["watch", "-x", "run"]
[tasks.dev-r]
install_crate = "cargo-watch"
command = "cargo"
args = ["watch", "-x", "run --release"]
[tasks.db-start]
script_runner = "@shell"
script = '''
docker run -d --name postgres -p 5432:5432 -e POSTGRES_PASSWORD=postgres -e POSTGRES_USER=postgres -e POSTGRES_DB=mi_api postgres
'''
[tasks.db-stop]
script_runner = "@shell"
script = '''
docker stop postgres
docker rm postgres
'''
[tasks.db-create]
install_crate = "sqlx-cli"
command = "sqlx"
args = ["database", "create"]
[tasks.db-migration-add]
install_crate = "sqlx-cli"
command = "sqlx"
args = ["migrate", "add", "${@}"]
[tasks.db-migration-run]
install_crate = "sqlx-cli"
command = "sqlx"
args = ["migrate", "run"]
[tasks.reset]
dependencies = ["db-stop", "db-start", "db-migration-run"]