chore: improved and fixed Justfile

This commit is contained in:
ITQ
2025-11-20 16:38:02 +03:00
parent 5fb325f3c7
commit faad52d422
+20 -37
View File
@@ -1,4 +1,4 @@
[doc("Все команды")]
[doc("All commands")]
default:
just --list --unsorted --list-heading $'Commands…\n'
@@ -8,37 +8,15 @@ default:
[no-cd]
[group("Docker")]
[doc("Билд основного контейнера")]
docker-build-main:
docker build -t template_project_deploy .
[doc("Rebuild all images")]
build:
docker compose --profile migrations --profile tests --profile observability build
[no-cd]
[group("Docker")]
[doc("Билд тестового контейнера")]
docker-build-tests:
docker build -t template_project_tests .
[no-cd]
[group("Docker")]
[doc("Билд миграционного контейнера")]
docker-build-migrations:
docker build -t template_project_migrations .
[no-cd]
[group("Docker")]
[doc("Билд всех контейнеров")]
docker-build-all:
just docker-build-main
just docker-build-tests
just docker-build-migrations
[no-cd]
[group("Docker")]
[doc("Запуск композа")]
docker-up:
just docker-build-all
docker compose up web_api -d
[doc("Compose start")]
up:
docker compose --profile migrations --profile observability up -d --remove-orphans --quiet-pull
# =========
# > Tests
@@ -46,11 +24,11 @@ docker-up:
[no-cd]
[group("Tests")]
[doc("Запуск тестов")]
tests-run:
just docker-up
[doc("Tests run")]
tests:
just up
docker compose up tests --abort-on-container-exit --remove-orphans
docker compose --profile migrations --profile tests up tests --remove-orphans --abort-on-container-exit
coverage report
# =========
@@ -59,25 +37,30 @@ tests-run:
[no-cd]
[group("Lints")]
[doc("Запуск всех линтов")]
lints-run:
[doc("Linters run")]
lint:
ruff check
mypy
codespell src tests
bandit src tests
[no-cd]
[group("Formatters run")]
format:
ruff format
# =========
# > Migrations
# =========
[no-cd]
[group("Migrations")]
[doc("Запуск миграции")]
[doc("Run alembic upgrade")]
migrations-run tag="head":
CONFIGURATION_PATH=config.toml alembic upgrade {{tag}}
[no-cd]
[group("Migrations")]
[doc('Создание миграции')]
[doc("Create new alembic revision")]
migrations-make message="":
CONFIGURATION_PATH=config.toml alembic revision --autogenerate -m "{{message}}"