-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
67 lines (48 loc) · 1.92 KB
/
Copy pathMakefile
File metadata and controls
67 lines (48 loc) · 1.92 KB
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
# DevOps toolkit — common developer and operator tasks.
# Run `make help` for a description of each target.
SHELL := /bin/bash
APP_DIR := app
VENV := .venv
PY := $(VENV)/bin/python
PIP := $(VENV)/bin/pip
COMPOSE := docker compose
IMAGE := devops-toolkit-app:local
.DEFAULT_GOAL := help
.PHONY: help venv install lint test build up down deploy logs healthcheck backup tf-init tf-plan tf-validate clean
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-14s\033[0m %s\n", $$1, $$2}'
venv: ## Create the local virtual environment
python3 -m venv $(VENV)
install: venv ## Install dev dependencies into the venv
$(PIP) install --upgrade pip
$(PIP) install -r $(APP_DIR)/requirements-dev.txt
lint: ## Run ruff over the app package
cd $(APP_DIR) && ../$(VENV)/bin/ruff check .
test: ## Run the pytest suite
cd $(APP_DIR) && ../$(VENV)/bin/pytest
build: ## Build the app Docker image
$(COMPOSE) build
up: ## Start the full stack in the background
$(COMPOSE) up -d
down: ## Stop the stack and remove containers
$(COMPOSE) down
deploy: ## Build, start, and verify the stack
./scripts/deploy.sh
logs: ## Tail logs from all services
$(COMPOSE) logs -f
healthcheck: ## Probe the proxy health endpoint
./scripts/healthcheck.sh
backup: ## Snapshot the redis volume
./scripts/backup.sh
tf-init: ## Initialize Terraform (no backend)
terraform -chdir=terraform init -backend=false
tf-validate: ## Validate the Terraform configuration
terraform -chdir=terraform validate
tf-plan: ## Show the Terraform execution plan
terraform -chdir=terraform plan
clean: ## Remove venv, caches, and build artifacts
rm -rf $(VENV) backups terraform/generated terraform/.terraform terraform/*.tfstate*
find . -type d -name __pycache__ -prune -exec rm -rf {} +
find . -type d -name .pytest_cache -prune -exec rm -rf {} +
find . -type d -name .ruff_cache -prune -exec rm -rf {} +