Formation CI/CD Pipelines

Fiche pédagogique

  • Objectifs SMART : concevoir un pipeline multi-plateforme (GitHub, GitLab, Jenkins), implémenter la promotion multi-environnements et instrumenter les métriques DORA en 12 jours.
  • Durée : 15 h (6 h théorie, 9 h labs)
  • Prérequis : Git, conteneurs, scripting.
  • Niveau : Intermédiaire → Avancé.

Sommaire

  1. Design pipeline & stratégies Git
  2. Implémentation GitHub Actions / GitLab CI / Jenkins
  3. Sécurité, compliance & DORA métriques
  4. Cas réel : pipeline produit SaaS
  5. Labs, quiz, checklist
  6. Ressources & synthèse

1. Design pipeline & stratégies Git

  • Trunk-based vs GitFlow, feature flags, environnements éphémères.
  • Stages : lint → tests → build → scan → package → déploiement.
  • Patterns : fan-out/fan-in, matrix builds, reusable workflows.

2. Implémentations multi-outils

GitHub Actions

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node: [18, 20]
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: ${{ matrix.node }} }
      - run: npm ci && npm test

GitLab CI

stages: [lint, test, deploy]
cache:
  paths: [node_modules/]
lint:
  script: npm run lint
deploy:
  stage: deploy
  script: ./scripts/deploy.sh
  environment:
    name: production
    url: https://app.example.com

Jenkins

pipeline {
  agent any
  stages {
    stage('Build') { steps { sh 'mvn package' } }
    stage('Deploy') { steps { sh './deploy.sh' } }
  }
}

3. Sécurité & DORA

  • Intégrer scans (Semgrep, Trivy), secrets management (Vault, OIDC).
  • Observabilité pipeline : Datadog CI Visibility, GitLab DORA.
  • Promotion via artefacts signés (Cosign), approvals, change management.

4. Cas réel

Produit SaaS multi-cloud : pipeline GitHub Actions → tests matrix → build image → scan → push ECR/GCR → déploiement Argo CD. Gains : Lead Time -70%, MTTR 45 min.

5. Labs, quiz, checklist

Lab Objectif Livrable
Lab Actions Workflow réutilisable + matrix Repo + documentation
Lab GitLab Pipeline multi-env + review apps .gitlab-ci.yml + captures
Lab Jenkins Pipeline declarative + shared libraries Jenkinsfile + tests

Quiz : pipeline vs workflow vs job, différence artifacts/caches, comment mesurer MTTR. Checklist : secrets chiffrés, timeouts définis, rollback automatisé.

6. Ressources & synthèse

À retenir : pipeline = produit. Versionnez tout, observez vos métriques et sécurisez la chaîne.