-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
72 lines (56 loc) · 1.65 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# add descriptions for each command
.PHONY:
backend build install format lint \
restart start start_monopoly_cli \
stop reset_db new_game test
help:
@echo "Makefile commands:"
@echo " build: build docker containers"
@echo " install: install dependencies"
@echo " format: format code"
@echo " lint: lint code"
@echo " new_game: start new game"
@echo " reset_db: reset database"
@echo " restart: restart docker containers"
@echo " start: start docker containers"
@echo " start_monopoly_cli: start monopoly cli"
@echo " stop: stop docker containers"
@echo " test: run tests"
backend:
cd backend
build: backend
docker-compose build
install:
cd backend && pip install --upgrade pip &&\
pip install poetry &&\
poetry install
format:
cd backend && poetry run black *.py
lint:
cd backend && poetry run ruff check .
restart: backend
docker-compose restart
start: backend
docker-compose up -d --build
start_monopoly_cli:
cd backend && poetry run python monopoly.py
stop: backend
docker-compose down
reset_db: backend
docker exec -it app alembic downgrade base
docker exec -it app alembic upgrade head
new_game:
make reset_db
make start_monopoly_cli
test: backend
docker exec -it app alembic downgrade base
cd backend && poetry run pytest
test_cli: backend
make start
cd backend && poetry run pytest tests/schemas/
# deploy:
# # deploy commands
# aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 168495394202.dkr.ecr.us-east-1.amazonaws.com
# docker build -t micro .
# docker tag micro:latest 168495394202.dkr.ecr.us-east-1.amazonaws.com/micro:latest
# all: install lint format test deploy