From faad52d422ce137866efffe6e0019040b1929d34 Mon Sep 17 00:00:00 2001 From: ITQ Date: Thu, 20 Nov 2025 16:38:02 +0300 Subject: [PATCH] chore: improved and fixed Justfile --- .justfile | 57 +++++++++++++++++++------------------------------------ 1 file changed, 20 insertions(+), 37 deletions(-) diff --git a/.justfile b/.justfile index 167df9b..dfad4ad 100644 --- a/.justfile +++ b/.justfile @@ -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}}"