a mini social media app for small communities
1plugins = [ 'v' ]
2
3task:db.init = {
4 description = 'Initialize and start a local Postgres database via Docker'
5 category = 'db'
6 run = 'docker run -it \
7 --name beep-database \
8 -e POSTGRES_DB=beep \
9 -e POSTGRES_USER=beep \
10 -e POSTGRES_PASSWORD=beep \
11 --mount source=beep-data,target=/var/lib/postgresql/data \
12 -p 127.0.0.1:5432:5432 \
13 postgres:17'
14}
15
16task:db.start = {
17 description = 'Start the docker image for the local database'
18 category = 'db'
19 run = 'docker start beep-database'
20}
21
22task:db.stop = {
23 description = 'Stop the docker image for the local database'
24 category = 'db'
25 run = 'docker stop beep-database'
26}
27
28task:db.login = {
29 description = 'Log into and modify the local database'
30 category = 'db'
31 run = 'docker exec -it beep-database psql -h localhost -p 5432 -d beep -U beep -W'
32}
33
34task:db.shell = {
35 description = 'Open a shell in the local database'
36 category = 'db'
37 run = 'docker exec -it beep-database sh'
38}
39
40task:db.dangerous.nuke = {
41 description = 'Delete the docker image AND ITS DATA. This will delete **EVERYTHING** in the database.'
42 category = 'db'
43 run = 'docker rm beep-database && docker volume rm beep-data'
44}
45
46task:ngrok = {
47 description = 'Open an ngrok tunnel for testing.'
48 category = 'misc'
49 run = 'ngrok http http://localhost:8008'
50}
51
52task:ngrok.url = {
53 description = 'Open an ngrok tunnel for testing. Requires you to pass the ngrok URL as an argument.'
54 category = 'misc'
55 run = 'ngrok http --url=${args} http://localhost:8008'
56}
57
58task:run.watch = {
59 description = 'Watch/run beep'
60 category = 'run'
61 run = '${v} -d veb_livereload watch run ${v_main} config.maple'
62}
63
64task:run.watch.real = {
65 description = 'Watch/run beep using config.real.maple'
66 category = 'run'
67 run = '${v} watch run ${v_main} config.real.maple'
68}
69
70task:run = {
71 description = 'Run beep'
72 category = 'run'
73 run = '${v} run ${v_main} config.maple'
74}
75
76task:run.real = {
77 description = 'Run beep using config.real.maple'
78 category = 'run'
79 run = '${v} run ${v_main} config.real.maple'
80}
81
82task:cloc = {
83 description = 'Get the lines of code for beep!'
84 category = 'misc'
85 //todo: contribute vlang support to cloc and use that here instead of it seeing all of our v code as verilog code
86 run = 'cloc ./src/'
87}