Skip to main content

CI/CD & Automation

This document details the automation systems implemented to ensure deployment reliability and solution availability.

Overview

CI Pipelines by Repository

Control-Hub-Back

StepCommandTool
TypeCheckpnpm typecheckTypeScript
Lintpnpm lintESLint
Formatpnpm format --checkPrettier
Security Auditpnpm audit --prodnpm audit
Testspnpm test (Japa)Japa + MySQL + Redis
Coveragenpx c8 --reporter=lcovc8
Buildpnpm buildAdonisJS
SonarQubeScan + Quality GateSonarQube

CI Services: MySQL 8 and Redis started as GitHub Actions service containers for integration tests.

Control-Hub Frontend (my-app)

StepCommandTool
TypeChecktsc --noEmitTypeScript
Lintpnpm run lintESLint
Formatpnpm run format --checkPrettier
Security Auditpnpm auditnpm audit
Unit Testspnpm testVitest
E2E Testspnpm test:e2ePlaywright (headless)
Storybook Buildpnpm build-storybookStorybook
A11y TestsStorybook test runner@storybook/addon-a11y
Buildpnpm buildNext.js
SonarQubeScan + Quality GateSonarQube

Firstbreath Showcase

StepCommandTool
TypeChecktsc --noEmitTypeScript
Lintnext lintESLint
Formatpnpm run format --checkPrettier
Security Auditpnpm auditnpm audit
Prismaprisma generate + schema validationPrisma
Buildnext buildNext.js
StorybookBuild + A11y testsStorybook
Unit Testspnpm testVitest
SonarQubeScan + Quality GateSonarQube

Firstbreath Vision

StepCommandTool
Formatblack --checkBlack
Lintflake8 --select=E9,F63,F7,F82Flake8
Securitysafety check -r requirements.txtSafety
Testspytest --cov (per service)pytest + pytest-cov
SonarQubeScan + Quality GateSonarQube
Docker BuildBuild + push imagesDocker / GHCR

CPU-only tests: tests use CPU-only versions of PyTorch to avoid GPU dependency in CI.

Mobile App

StepCommandTool
LintESLintESLint
TestsjestJest (jest-expo)
SonarQubeScan + Quality GateSonarQube

SonarQube — Quality Gates

Our self-hosted SonarQube instance (sonar.firstbreath.fr) enforces the following rules:

RuleThreshold
Critical Bugs0
Duplication< 3%
MaintainabilityRating A
Minimum CoverageVaries per module
Security HotspotsMandatory review

Configuration per Repository

Each repository contains a sonar-project.properties defining:

  • sonar.sources — source directories to analyze
  • sonar.exclusions — excluded files (node_modules, build, tests, config)
  • sonar.coverage.exclusions — non-testable code (controllers, validators)
  • sonar.javascript.lcov.reportPaths — coverage report

Continuous Deployment (CD)

Deployment Mechanism

ComponentCD MechanismDetails
Control-Hub-BackDokploy webhookPush to main → Docker build → rolling restart
Firstbreath VisionDokploy webhookPush to main → Docker build → restart (GPU)
ShowcaseDokploy webhookPush to main → Docker build (Prisma migrate) → restart
DocumentationDokploy webhookPush to main → Docusaurus build → Nginx restart

Watchtower (legacy infrastructure)

The legacy infrastructure used Watchtower for CD:

  • Poll every 5 minutes (WATCHTOWER_POLL_INTERVAL=300)
  • Automatic pull of new Docker images from GHCR
  • Old image cleanup (WATCHTOWER_CLEANUP=true)
  • Label-based filtering (WATCHTOWER_LABEL_ENABLE=true)

This approach has been replaced by Dokploy for better deployment control.

System Interactions

Expected Performance

MetricTargetMonitoring
CI build time< 5 minGitHub Actions
Deployment time< 3 minDokploy logs
API availability> 99% (uptime)Grafana + healthchecks
Inference latency< 200ms/framePrometheus (batch-inference)
Restart time< 30sDocker healthcheck start_period