51 lines
1.3 KiB
Makefile
51 lines
1.3 KiB
Makefile
.PHONY: help install run test lint clean docker-build docker-run docker-stop docker-logs
|
|
|
|
help:
|
|
@echo "Available commands:"
|
|
@echo " make install - Install dependencies"
|
|
@echo " make run - Run worker locally"
|
|
@echo " make test - Run tests (TODO)"
|
|
@echo " make lint - Run linting"
|
|
@echo " make clean - Clean up files"
|
|
@echo " make docker-build - Build Docker image"
|
|
@echo " make docker-run - Run with docker-compose"
|
|
@echo " make docker-stop - Stop docker-compose"
|
|
@echo " make docker-logs - Show docker logs"
|
|
|
|
install:
|
|
pip install -r requirements.txt
|
|
|
|
run:
|
|
python3 main.py
|
|
|
|
test:
|
|
@echo "TODO: Add tests"
|
|
# python3 -m pytest tests/
|
|
|
|
lint:
|
|
@echo "Running pylint..."
|
|
-pylint --rcfile=.pylintrc *.py **/*.py 2>/dev/null || echo "pylint not installed"
|
|
@echo "Running flake8..."
|
|
-flake8 --max-line-length=120 . 2>/dev/null || echo "flake8 not installed"
|
|
|
|
clean:
|
|
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
|
|
find . -type f -name "*.pyc" -delete
|
|
find . -type f -name "*.pyo" -delete
|
|
find . -type f -name "*.log" -delete
|
|
|
|
docker-build:
|
|
docker build -t unified-email-worker:latest .
|
|
|
|
docker-run:
|
|
docker-compose up -d
|
|
|
|
docker-stop:
|
|
docker-compose down
|
|
|
|
docker-logs:
|
|
docker-compose logs -f email-worker
|
|
|
|
docker-restart: docker-stop docker-build docker-run
|
|
@echo "Worker restarted"
|