forked from getsentry/integration-platform-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (39 loc) · 1.73 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
.DEFAULT_GOAL := help
help:
@echo 'Welcome to the Integration Platform Example a.k.a. ACME Kanban 🚀!'
@echo
@echo '>>> Quickstart'
@echo 'make serve-python -> Start the python backend + frontend'
@echo 'make serve-typescript -> Start the typescript backend + frontend'
@echo
@echo '>>> Debugging'
@echo 'make setup-python -> Rebuild the python backend with updated dependencies and environment variables'
@echo 'make setup-typescript -> Rebuild the typescript backend with updated dependencies and environment variables'
@echo 'make seed-db -> Initialize the database with test data (Note: requires "make teardown" execution beforehand)'
@echo 'make dump-db -> Replace the data in the seed file with the current database'
@echo 'make reset-db -> Empty out the current database'
@echo 'make teardown -> Stop all ongoing processes and remove their data (Note: erases the database)'
@echo
@echo '>>> Testing'
@echo 'make setup-tests -> Starts the test database'
# Quickstart
serve-python:
docker compose up --build frontend backend-py
serve-typescript:
docker compose up --build frontend backend-ts
# Debugging
setup-python:
docker compose build frontend backend-py
setup-typescript:
docker compose build frontend backend-ts
seed-db:
docker exec database bash -c 'cat scripts/schema.sql | psql $$POSTGRES_DB -U $$POSTGRES_USER'
dump-db:
docker exec database bash -c 'pg_dump $$POSTGRES_DB -U $$POSTGRES_USER > scripts/schema.sql'
reset-db:
docker exec database bash -c 'cat scripts/clear.sql | psql $$POSTGRES_DB -U $$POSTGRES_USER'
teardown:
docker compose down -v --remove-orphans --rmi all
# Testing
setup-tests:
docker compose up test-database --detach