feat: moved code from lab3
This commit is contained in:
@@ -2,13 +2,58 @@ PYTHON ?= python3
|
||||
BASE_URL ?= http://localhost:8080
|
||||
CA_FILE ?=
|
||||
ACTION_SCRIPT ?=
|
||||
COMPOSE = docker compose --project-name highload-lab4 --env-file .env -f compose.yml
|
||||
TLS_ARGS = $(if $(CA_FILE),--ca-file "$(CA_FILE)",)
|
||||
|
||||
.PHONY: help check validate test load test-persistence test-failover
|
||||
.PHONY: app-init app-build app-up app-start app-stop app-down app-restart app-logs app-status test-backend test-baseline test-baseline-persistence
|
||||
|
||||
help:
|
||||
@echo "app-build: build application images; app-up: build and start the full stack"
|
||||
@echo "app-start: start without rebuilding; app-stop: stop and keep containers"
|
||||
@echo "app-down: remove containers and networks, keeping data volumes"
|
||||
@echo "app-restart: restart the stack; app-logs / app-status: inspect services"
|
||||
@echo "test-backend: Go race tests; test-baseline: transferred API checks"
|
||||
@echo "test-baseline-persistence: transferred API checks across a restart"
|
||||
@echo "check: offline structure; validate: full OpenAPI (requirements-dev.txt); test: running API; load: synthetic writes"
|
||||
|
||||
app-init:
|
||||
$(PYTHON) scripts/init_env.py
|
||||
chmod +x scripts/restart.sh scripts/stop-one.sh
|
||||
|
||||
app-build: app-init
|
||||
$(COMPOSE) build
|
||||
|
||||
app-up: app-init
|
||||
$(COMPOSE) up -d --build --wait
|
||||
|
||||
app-start: app-init
|
||||
$(COMPOSE) up -d --no-build --wait
|
||||
|
||||
app-stop:
|
||||
$(COMPOSE) stop
|
||||
|
||||
app-down:
|
||||
$(COMPOSE) down
|
||||
|
||||
app-restart: app-init
|
||||
./scripts/restart.sh
|
||||
|
||||
app-logs:
|
||||
$(COMPOSE) logs -f --tail=100
|
||||
|
||||
app-status:
|
||||
$(COMPOSE) ps --all
|
||||
|
||||
test-backend: app-init
|
||||
$(COMPOSE) --profile test run --build --rm backend-tests
|
||||
|
||||
test-baseline:
|
||||
$(PYTHON) scripts/check_baseline.py --base-url "$(BASE_URL)"
|
||||
|
||||
test-baseline-persistence:
|
||||
$(PYTHON) scripts/check_baseline.py --base-url "$(BASE_URL)" --restart
|
||||
|
||||
check:
|
||||
$(PYTHON) scripts/check_contract.py
|
||||
|
||||
|
||||
Reference in New Issue
Block a user