Files
peikarband/Makefile
Ehsan.Asadi 8a924f6091
Some checks failed
CD - Build & Deploy / build-and-push (push) Has been cancelled
CD - Build & Deploy / package-helm (push) Has been cancelled
CD - Build & Deploy / deploy-staging (push) Has been cancelled
CD - Build & Deploy / deploy-production (push) Has been cancelled
CD - Build & Deploy / release (push) Has been cancelled
CI / test (3.11) (push) Has been cancelled
CI / test (3.12) (push) Has been cancelled
CI / security (push) Has been cancelled
[INIT-001] Initial project setup with Clean Architecture (feat)
- Implemented Clean Architecture with Domain, Application, Infrastructure, Presentation layers
- Added comprehensive project structure following SOLID principles
- Created Kubernetes deployment with Helm charts (HPA, PDB, NetworkPolicy)
- Configured ArgoCD for automated deployment (production + staging)
- Implemented CI/CD pipeline with GitHub Actions
- Added comprehensive documentation (handbook, architecture, coding standards)
- Configured PostgreSQL, Redis, Celery for backend services
- Created modern landing page with Persian fonts (Vazirmatn)
- Added Docker multi-stage build for production
- Configured development tools (pytest, black, flake8, mypy, isort)
- Added pre-commit hooks for code quality
- Implemented Makefile for common operations
2025-12-26 15:52:50 +03:30

127 lines
3.3 KiB
Makefile

# Peikarband Platform - Makefile
REGISTRY ?= registry.example.com
IMAGE_NAME ?= peikarband/landing
VERSION ?= $(shell git describe --tags --always --dirty)
HELM_RELEASE ?= peikarband
NAMESPACE ?= production
.PHONY: help install dev test lint format clean docker-up docker-down migrate
help:
@echo "Available commands:"
@echo ""
@echo "Development:"
@echo " make install - Install dependencies"
@echo " make dev - Run development server"
@echo " make test - Run tests"
@echo " make lint - Run linters"
@echo " make format - Format code"
@echo " make clean - Clean temporary files"
@echo ""
@echo "Docker:"
@echo " make docker-build - Build Docker image"
@echo " make docker-push - Push Docker image"
@echo " make docker-up - Start Docker Compose"
@echo " make docker-down - Stop Docker Compose"
@echo ""
@echo "Kubernetes/Helm:"
@echo " make helm-lint - Lint Helm chart"
@echo " make helm-package - Package Helm chart"
@echo " make helm-install - Install Helm chart"
@echo " make helm-upgrade - Upgrade Helm chart"
@echo " make helm-uninstall - Uninstall Helm chart"
@echo " make k8s-deploy - Deploy to Kubernetes"
@echo ""
@echo "Database:"
@echo " make migrate - Run database migrations"
install:
pip install -r requirements.txt
pip install -r requirements-dev.txt
pre-commit install
dev:
python -m reflex run
test:
pytest tests/ -v --cov=src --cov-report=html
lint:
flake8 src/
mypy src/
black --check src/
isort --check-only src/
format:
black src/
isort src/
clean:
find . -type d -name "__pycache__" -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
find . -type f -name "*.pyo" -delete
find . -type d -name ".pytest_cache" -exec rm -rf {} +
find . -type d -name ".mypy_cache" -exec rm -rf {} +
find . -type d -name "*.egg-info" -exec rm -rf {} +
rm -rf .coverage htmlcov/
rm -rf dist/ build/
# Docker commands
docker-build:
docker build -t $(IMAGE_NAME):$(VERSION) .
docker tag $(IMAGE_NAME):$(VERSION) $(IMAGE_NAME):latest
docker-push:
docker tag $(IMAGE_NAME):$(VERSION) $(REGISTRY)/$(IMAGE_NAME):$(VERSION)
docker tag $(IMAGE_NAME):$(VERSION) $(REGISTRY)/$(IMAGE_NAME):latest
docker push $(REGISTRY)/$(IMAGE_NAME):$(VERSION)
docker push $(REGISTRY)/$(IMAGE_NAME):latest
docker-up:
docker-compose up -d
docker-down:
docker-compose down
# Helm commands
helm-lint:
helm lint helm/peikarband
helm-template:
helm template $(HELM_RELEASE) helm/peikarband --debug
helm-package:
helm package helm/peikarband --destination .
helm-install:
helm install $(HELM_RELEASE) helm/peikarband \
--namespace $(NAMESPACE) \
--create-namespace \
--set image.repository=$(REGISTRY)/$(IMAGE_NAME) \
--set image.tag=$(VERSION) \
--wait
helm-upgrade:
helm upgrade --install $(HELM_RELEASE) helm/peikarband \
--namespace $(NAMESPACE) \
--set image.repository=$(REGISTRY)/$(IMAGE_NAME) \
--set image.tag=$(VERSION) \
--wait
helm-uninstall:
helm uninstall $(HELM_RELEASE) --namespace $(NAMESPACE)
# Kubernetes deployment (full pipeline)
k8s-deploy: docker-build docker-push helm-upgrade
@echo "Deployment complete!"
@echo "Check status: kubectl get pods -n $(NAMESPACE)"
# Database
migrate:
alembic upgrade head
seed:
python scripts/seed_database.py