Files
driving-academy/Makefile
2025-10-26 23:39:49 -05:00

84 lines
2.2 KiB
Makefile

# Makefile for Flask Balotario Application
# Provides convenient commands for development and deployment
.PHONY: help install install-dev install-test clean test lint format run docker-build docker-run
# Default target
help:
@echo "Available commands:"
@echo " install - Install production dependencies"
@echo " install-dev - Install development dependencies"
@echo " clean - Clean up cache and temporary files"
@echo " test - Run tests with coverage"
@echo " lint - Run linting checks"
@echo " format - Format code with black and isort"
@echo " security - Run security checks"
@echo " run - Run development server"
@echo " run-prod - Run production server with gunicorn"
@echo " docker-build - Build Docker image"
@echo " docker-run - Run Docker container"
@echo " download-images - Download all images locally"
@echo " verify-images - Verify all images are available"
# Installation targets
install:
pip install -r requirements.txt
install-dev:
pip install -r requirements-dev.txt
# Development targets
clean:
find . -type f -name "*.pyc" -delete
find . -type d -name "__pycache__" -delete
find . -type d -name "*.egg-info" -exec rm -rf {} +
rm -rf .pytest_cache
rm -rf .coverage
rm -rf htmlcov/
test:
pytest --cov=. --cov-report=html --cov-report=term-missing
lint:
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
format:
black .
isort .
security:
bandit -r . -x tests/
safety check
# Server targets
run:
python app.py
run-prod:
gunicorn --bind 0.0.0.0:5000 --workers 4 app:app
# Docker targets
docker-build:
docker build -t driving-academy .
docker-run:
docker run -p 5000:5000 driving-academy
# Image management
download-images:
python scripts/download_images.py
verify-images:
python scripts/verify_images.py
# Development setup (complete environment)
setup-dev: install-dev download-images
@echo "Development environment ready!"
@echo "Run 'make run' to start the development server"
# Production setup
setup-prod: install
@echo "Production environment ready!"
@echo "Run 'make run-prod' to start the production server"