-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (38 loc) · 1.46 KB
/
Makefile
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
#!/usr/bin/make
build: # build all containers
if [ -d "pgdata" ]; then sudo chmod -R 755 pgdata; fi
docker build -t management-discord-bot:latest .
run-bg: # run all containers in the background
docker compose up -d \
management-discord-bot \
postgres
run: # run all containers in the foreground
docker compose up \
management-discord-bot \
postgres
stop: # stop all containers
docker compose down
lint: # run pre-commit hooks
pre-commit run -a
logs: # attach to the containers live to view their logs
docker compose logs -f
shell:
docker compose exec -it management-discord-bot bash
test: # run the tests
docker compose exec management-discord-bot /scripts/run-tests.sh
test-dbg: # run the tests in debug mode
docker compose exec management-discord-bot /scripts/run-tests.sh --dbg
view-cov: # open the coverage report in the browser
if grep -q WSL2 /proc/sys/kernel/osrelease; then \
wslview tests/htmlcov/index.html; \
else \
xdg-open tests/htmlcov/index.html; \
fi
up-migrations: # apply up migrations from current state
docker compose exec management-discord-bot /scripts/migrate-db.sh up
down-migrations: # apply down migrations from current state
docker compose exec management-discord-bot /scripts/migrate-db.sh down
up-seeds: # apply up seeds from current state
docker compose exec management-discord-bot /scripts/seed-db.sh up
down-seeds: # apply down seeds from current state
docker compose exec management-discord-bot /scripts/seed-db.sh down