-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathMakefile
82 lines (63 loc) · 1.96 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
73
74
75
76
77
78
79
80
81
82
REQUIREMENTS_FILE = dev.txt
.PHONY: update-deps
update-deps:
pip install -U pip && pip install pip-tools
pip-compile requirements/base.in
pip-compile requirements/dev.in
.PHONY: build
build:
[ -f .env ] || cp example.env .env
docker compose build --build-arg="REQUIREMENTS_FILE=$(REQUIREMENTS_FILE)"
.PHONY: up
up:
make build
docker compose up
.PHONY: down
down:
docker compose down
.PHONY: attach
attach:
docker attach fasthtmx_app
.PHONY: db-migrate
db-migrations:
docker exec -it fasthtmx_app alembic -c app/models/alembic.ini revision --autogenerate
.PHONY: db-upgrade
db-migrate:
docker exec -it fasthtmx_app alembic -c app/models/alembic.ini upgrade head
.PHONY: db-downgrade
db-downgrade:
docker exec -it fasthtmx_app alembic -c app/models/alembic.ini downgrade -1
.PHONY: migration-history
migration-history:
docker exec -it fasthtmx_app alembic -c app/models/alembic.ini history
.PHONY: bash
bash:
docker exec -it fasthtmx_app bash
.PHONY: run-build
run-build:
docker build . -f docker/Dockerfile -t fasthtmx_app:latest --build-arg="REQUIREMENTS_FILE=$(REQUIREMENTS_FILE)"
.PHONY: run
run:
make run-build
docker run --name fasthtmx_app -p 8000:8000 --rm --env-file .env -it fasthtmx_app:latest
.PHONY: run-tests
run-tests:
make run-build
docker run --name fasthtmx_app -p 8000:8000 --rm --env-file .env -it fasthtmx_app:latest python -m pytest app -s --verbose
.PHONY: tests
tests:
docker exec -it fasthtmx_app python -m pytest app/tests -s --verbose
.PHONY: bootstrap
bootstrap:
docker exec -it fasthtmx_app python app/commands/bootstrap.py
.PHONY: e2e-tests-build
e2e-tests-build:
docker build . -f e2e_tests/Dockerfile -t tests_e2e:latest
.PHONY: e2e-tests-bash
e2e-tests-bash:
make e2e-tests-build
docker run --name tests_e2e --network="host" --rm -it tests_e2e:latest bash
.PHONY: e2e-tests
e2e-tests:
make e2e-tests-build
docker run --name tests_e2e --network="host" --rm -it tests_e2e:latest pytest tests -s --base-url http://localhost:8000