Ana içeriğe geç

CI/CD Pipeline

CI Workflow (ci.yml)

Her push ve PR'da otomatik çalışır:

1. backend-lint

  • ruff check app/ — Linting
  • ruff format --check app/ — Format kontrolü
  • mypy app/ --ignore-missing-imports — Type check

2. backend-test

  • PostgreSQL 15 + Redis 7 servisler başlatılır
  • alembic upgrade head — Migration'lar uygulanır
  • pytest tests/ -v --cov=app — Testler çalıştırılır

3. firmware-test

  • pio test -e native — PlatformIO unit testleri

4. frontend-lint

  • npm run lint — ESLint
  • npx tsc --noEmit — TypeScript kontrolü

5. frontend-build

  • npm run build — Production build

6. docker-build (sadece PR)

  • Docker Buildx ile multi-platform build (push yok)

Deploy Workflow (deploy.yml)

CI başarılı olunca otomatik tetiklenir:

  1. SSH setup — webfactory/ssh-agent
  2. rsync — Dosya senkronizasyonu (exclude: .git, node_modules, .env, certs)
  3. .env oluştur — GitHub Secrets'tan
  4. TLS kontrol — SSL sertifika varlığı
  5. Infrastructure start — postgres, redis, emqx, minio
  6. Migrationalembic upgrade head
  7. Image build — backend, frontend (15dk timeout), modbus-poller
  8. Container startdocker compose up -d
  9. Health check — Backend, frontend, nginx HTTPS
  10. Code audit — Claude CLI ile post-deploy analiz
  11. Monitoring cron — health-check, container-monitor kurulumu

Release Workflow (release.yml)

Git tag push (v*) ile tetiklenir:

  • GitHub release + changelog oluşturma
  • ghcr.io'ya Docker image push (tag + latest)