-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathMakefile.toml
108 lines (92 loc) · 2.74 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
[tasks.install-native-pkgs.linux]
script = { file = "setup.sh" }
workspace = false
[tasks.create-env]
args = ["r", "--bin", "tct", "env", "create"]
command = "cargo"
workspace = false
[tasks.symlink-env]
script_runner = "@shell"
script = '''
if ! ls tchatchers_back/.env &>/dev/null ; then
ln .env tchatchers_back/
else
echo "The symlink for the back project already exists, run 'cargo-make make clear-symlink' if you want to delete them"
fi
if ! ls .env tchatchers_cli_tools/.env &>/dev/null ; then
ln .env tchatchers_cli_tools/
else
echo "The symlink for the cli project already exists, run 'cargo-make make clear-symlink' if you want to delete them"
fi
'''
workspace = false
[tasks.setup-env]
dependencies = [
"create-env",
"symlink-env"
]
workspace = false
[tasks.generate-self-signed-certificate]
script_runner="@shell"
script='''
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ./my_key.key -out ./my_cert.crt
openssl dhparam -out ./my_dhparam.pem 2048
echo "The following files have been generated"
ls -ltr my_cert.crt my_key.key my_dhparam.pem
'''
workspace=false
[tasks.clear-symlink]
script_runner="@shell"
script = '''
rm tchatchers_back/.env
rm tchatchers_cli_tools/.env
echo "Env links deleted"
'''
workspace=false
[tasks.start-db]
args = ["-f", "docker-compose_dev.yml", "up", "-d", "postgres", "redis"]
command = "docker-compose"
workspace = false
[tasks.stop-db]
args = ["-f", "docker-compose_dev.yml", "down"]
command = "docker-compose"
workspace = false
[tasks.dump-db]
args = ["-f", "docker-compose_dev.yml", "down", "-v"]
command = "docker-compose"
workspace = false
[tasks.start-dev-back]
args = ["-x", "r --bin tchatchers_back", "--watch", "tchatchers_back/src/"]
command = "cargo-watch"
workspace = false
dependencies = ["start-db"]
[tasks.start-dev-async]
args = ["-x", "r --bin tchatchers_async", "--watch", "tchatchers_async/src/"]
command = "cargo-watch"
workspace = false
dependencies = ["start-db"]
env = { "RUST_LOG" = "DEBUG" }
[tasks.start-dev-front]
cwd = "./tchatchers_front"
args = ["serve", "--port", "3000"]
command = "trunk"
workspace = false
[tasks.start-dev-style]
cwd = "./tchatchers_front"
args = ["tailwindcss@3.3.0", "-i", "main.css", "-o", "assets/tailwind.css", "-c", "tailwind.config.js", "--minify", "--watch", "src/"]
command = "npx"
workspace = false
[tasks.start-dev]
run_task = { name = ["start-dev-back", "start-dev-front", "start-dev-style", "start-dev-async"], fork = true, parallel = true }
workspace = false
[tasks.verify-fmt]
args = ["fmt", "--check"]
command = "cargo"
workspace = false
[tasks.verify-clippy]
args = ["clippy", "--all-features"]
command = "cargo"
workspace = false
[tasks.verify-before-commit]
run_task = { name = [ "verify-fmt", "verify-clippy"], parallel = true }
workspace = false