-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
58 lines (45 loc) · 1.57 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
default: build start create_db
.PHONY: build
build: create_requirements
docker-compose build
.PHONY: create_requirements
create_requirements:
poetry export --without-hashes --format=requirements.txt > requirements.txt
.PHONY: start
start:
docker-compose up -d
.PHONY: create_db
create_db:
@until docker-compose exec postgres psql -h localhost -U postgres -c '\l' postgres &>/dev/null; do \
echo "Postgres is unavailable - sleeping..."; \
sleep 1; \
done
@echo "Postgres is up"
docker-compose run --rm web alembic --config=./prijateli_tree/migrations/alembic.ini upgrade head
.PHONY: update_db
update_db:
docker-compose run --rm web alembic --config=./prijateli_tree/migrations/alembic.ini upgrade head
.PHONY: lint
lint:
pre-commit run --all-files
.PHONY: test
test: start
docker-compose run --rm web-test pytest -vsx ./prijateli_tree/tests/;
.PHONY: stop
stop:
docker-compose stop
.PHONY: clean
clean: stop ## Remove all containers
docker-compose rm -f
.PHONY: clean_all
clean_all: clean stop ## Wipe database link
docker-compose down -v
.PHONY: stamp_db
stamp_db: ## Runs the stamp command to set the base state of the db
docker-compose run web alembic --config=./prijateli_tree/migrations/alembic.ini stamp head
.PHONY: create_revision
create_revision: ## Runs the command that creates the Alembic revision
docker-compose run web alembic --config=./prijateli_tree/migrations/alembic.ini revision --autogenerate
.PHONY: process_translations
process_translations: ## Runs the command that creates the translation jsons
python3 ./prijateli_tree/app/utils/process_translations.py