Makefile Commands#
Complete reference for development Makefile commands.
Overview#
Construbot includes a Makefile with convenient development commands.
Location: /Makefile (project root)
Docker Commands#
Development#
make dev
Start development environment
make dev
# Starts: redis, postgres, mailhog, django
# Uses: local settings, DEBUG=True
make buildev
Build and start development environment
make buildev
# Builds images, starts services, runs migrations
make buildprod
Build production environment
make buildprod
# Uses: production settings, DEBUG=False
Container Management#
make down
Stop all containers
make down
make clean
Remove all containers
make clean
make cleandb
Remove database containers and volumes
make cleandb
# WARNING: Deletes all data!
make cleanhard
Remove everything (containers, volumes, images)
make cleanhard
# WARNING: Complete cleanup!
Database Commands#
make migrations
Create and apply migrations
make migrations
# Runs: makemigrations && migrate
make superuser
Create Django superuser
make superuser
# Prompts for email and password
make poblar
Populate database with test data
make poblar
# Runs: python manage.py poblar
Development Tools#
make shell
Open Django shell
make shell
# Runs: python manage.py shell
make runserver
Run server without Docker
make runserver
# Sets USE_DOCKER=no
# Runs: python manage.py runserver
Testing Commands#
make test
Run full test suite with coverage
make test
# Runs: pytest with coverage report
make localtest
Run tests locally (no Docker)
make localtest
make warningtest
Run tests with warnings enabled
make warningtest
make current
Run tests tagged as ‘current’
make current
# Runs: pytest -m current
Requirements Management#
make mkenv
Sync local requirements
make mkenv
# Uses: pip-sync requirements/local.txt
make pipcompile
Compile requirements files
make pipcompile
# Compiles: base.in, local.in, test.in
Documentation Commands#
These commands are in docs/Makefile:
make html
Build English documentation
cd docs
make html
# Output: _build/html/
make html-es
Build Spanish documentation
cd docs
make html-es
# Output: _build/html/es/
make html-all
Build both English and Spanish
cd docs
make html-all
make update-translations
Update translation files
cd docs
make update-translations
# Extracts strings, updates .po files
make livehtml
Auto-rebuild documentation
cd docs
make livehtml
# Starts server at http://127.0.0.1:8000
Common Workflows#
Fresh Start#
make buildev
make superuser
make poblar
Daily Development#
make dev # Start environment
make shell # Django shell
make test # Run tests
make down # Stop when done
Reset Database#
make cleandb
make buildev
make superuser
make poblar
Update Dependencies#
# Edit requirements/*.in files
make pipcompile
make buildev # Rebuild with new deps
Troubleshooting#
Command not found:
Ensure you’re in project root directory.
Permission denied:
Run with sudo or fix Docker permissions:
sudo usermod -aG docker $USER
newgrp docker
Port already in use:
Stop conflicting services:
lsof -ti:8000 | xargs kill -9
See Also#
Docker Setup - Docker setup guide
Local Setup - Local setup guide
Testing - Testing guide