Skip to main content
DevOps // CI/CD

Deploys should be a button, not a ceremony.

Every change built, tested, scanned, and deployed the same way, with preview environments for review and a rollback that takes seconds.

~/anvexis/devops/ci-cd-automation

$ anvexis tldr

Merge to main, watch it ship, roll back with one command if needed.

$ anvexis facts

CI
GitHub Actions · GitLab CI
CD
GitOps · Argo CD
Safety
Previews · rollbacks

A pipeline that gates every merge

.github/workflows/ci.ymlyaml
name: ci
on: [pull_request]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: 22, cache: npm }
      - run: npm ci
      - run: npm run typecheck
      - run: npm test
      - run: npm run build

The delivery path

  1. Stage 01

    Pull request

    Lint, typecheck, tests, and security scans run automatically.

  2. Stage 02

    Preview

    A temporary environment for reviewers and stakeholders.

  3. Stage 03

    Merge

    Main builds a versioned, immutable artifact.

  4. Stage 04

    Deploy

    Rolling or blue/green release with health checks.

  5. Stage 05

    Verify

    Smoke tests and metrics confirm the release; rollback if not.

Why manual deployments hurt

When deployments are manual, they are rare, stressful, and risky. Someone logs into a server, pulls code, restarts services, and hopes nothing breaks. Changes pile up between releases, so each release carries more risk, which makes the next one even scarier.

Continuous integration and delivery break that cycle. Every change is built, tested, and scanned automatically. Releases become small and frequent, each one easy to understand and easy to roll back. The pipeline becomes the one way code reaches production, so the process is the same every time, whoever is on duty.

For Odoo projects, a good pipeline also runs module tests, checks that data migrations work on a copy of production, and catches upgrade-breaking changes before they reach users.

Pipeline stages and what they catch

StageChecksCatches
Lint and formatStyle, static analysis, type checksObvious mistakes before review
Unit and module testsAutomated tests, including Odoo module testsBroken logic
Security scanDependencies, images, secrets in codeKnown vulnerabilities and leaked keys
BuildVersioned, reproducible imageEnvironment drift
Staging deployMigrations on production-like dataUpgrade and data issues
Production deployGradual rollout with health checksProblems that only show under real traffic

What we set up

Branching and reviews

A simple branching model, required reviews, and protected main branches.

Pipelines as code

GitHub Actions, GitLab CI, or your existing tool, versioned with the application.

Preview environments

Temporary environments per pull request so changes can be tested before merging.

Zero-downtime deploys

Rolling or blue-green deployments with automatic health checks.

Fast rollback

One command or one click to return to the previous version.

Delivery metrics

Deployment frequency, lead time, change failure rate, and time to restore.

How we introduce CI/CD

  1. Stage 01

    Map the current release

    Week 1

    Document how code reaches production today, including the manual steps.

  2. Stage 02

    Automate the build

    Week 1–2

    Reproducible builds and tests on every pull request.

  3. Stage 03

    Automate staging

    Week 2–3

    Deploy every merge to staging automatically.

  4. Stage 04

    Automate production

    Week 3–4

    Add approvals where needed and deploy through the pipeline only.

  5. Stage 05

    Measure and improve

    Ongoing

    Track delivery metrics and remove the slowest steps.

CI/CD myths

Myth: Continuous delivery means deploying without control.

Reality: Pipelines can require approvals, run only in maintenance windows, and deploy to a subset first. Control is built in.

Myth: You need full test coverage before you start.

Reality: Start with the build and a few critical tests. Coverage grows as the pipeline proves its value.

Myth: CI/CD is only for big teams.

Reality: Small teams benefit most, because nobody has time for manual releases and late-night fixes.

Common pitfalls we help you avoid

The first pitfall is a pipeline that takes too long. When feedback arrives an hour after a push, developers stop waiting for it, so we cache dependencies, run tests in parallel, and keep the critical path short.

The second is a pipeline that's allowed to be bypassed. If urgent fixes still go straight to the server by hand, the pipeline loses its value, so we make the pipeline the fastest way to ship as well as the safest.

The third is ignoring the database. Application code rolls back easily; schema and data migrations need their own design so a release can be reverted without losing data.

What we measure

MeasureWhy it matters
Deployment frequencyHow often value reaches users
Lead time for changesFrom merge to running in production
Change failure rateShare of releases that need a fix or rollback
Time to restoreHow quickly a failed change is undone

Who does what

We handle

  • Pipeline design and implementation
  • Deployment and rollback automation
  • Documentation and training

Your team handles

  • Writing and maintaining tests
  • Code review and approvals
  • Release decisions

A worked example

Take a team of four developers maintaining custom Odoo modules, releasing once a month on a Saturday night. A pipeline now runs tests and linting on every pull request, deploys every merge to a staging environment with a recent copy of data, and promotes to production with one approval.

Releases become small and frequent, problems are caught in staging, and a bad release is rolled back in minutes. The team tracks deployment frequency and failure rate to see the improvement.

Before you start

  • Code in Git with a main branch
  • A staging environment, or budget for one
  • A few automated tests to start with
  • Agreement on who approves production releases

What success looks like

Success is a team that ships small changes several times a week without stress, catches problems in staging, and can undo a bad release in minutes. Delivery metrics show steady improvement, and nobody needs to remember the deployment steps.

Measuring and securing the pipeline

DORA measures software delivery with five metrics: change lead time, deployment frequency, failed deployment recovery time, change fail rate, and deployment rework rateSource [1]. We baseline them before introducing CI/CD and track them after, so improvement is visible rather than claimed.

Pipelines hold the keys to production, so they need hardening. GitHub's security guidance says sensitive data should never be stored as plain text in workflow files, the GITHUB_TOKEN should have the minimum required permissions, and actions should be pinned to a commit SHASource [2]. We apply the same rules on any CI platform.

Frequently asked questions

Can Odoo deployments be automated?
Yes, including module updates, database migrations, and smoke tests.
What is GitOps?
Desired infrastructure state lives in Git, and a controller keeps the environment matching it.
How do database migrations fit in?
As versioned steps with backward-compatible changes so rollbacks stay safe.
Do you set up preview environments?
Yes, per pull request where the stack allows.
What about mobile apps?
Mobile CI builds, signs, and uploads to app stores automatically.
Which CI tool do you recommend?
Usually whatever your code host provides, such as GitHub Actions or GitLab CI. Using what you already have keeps things simple.
Can you automate Odoo module upgrades?
Yes. Pipelines can run module upgrades on a restored copy of production first, then on production during a planned window.
How do you deploy without downtime?
By starting new instances, checking health, shifting traffic, then stopping the old ones. Database changes are designed to be compatible across versions.
How do we keep secrets out of pipelines?
Secrets are stored in the CI tool's vault or a secrets manager and injected at runtime, never written into code or logs.
Can you work with our existing repositories?
Yes. We add pipelines to the repositories and tools you already use.
How do you test Odoo upgrades in CI?
By restoring an anonymized copy of production data in a test environment and running the upgrade and module tests against it.
Do you set up feature flags?
Where useful, so features can be deployed safely and switched on separately from the release.
How long does it take to set up a pipeline?
A basic build-and-test pipeline can be in place quickly; full automation to production usually follows over a few weeks.
Can pipelines deploy to multiple environments?
Yes: development, staging, and production, each with its own configuration, approvals, and secrets.
What if our tests are slow or flaky?
We find the slowest and least reliable tests first, fix or quarantine them, and run the rest in parallel so the pipeline stays fast and trustworthy.
Can pipelines run database migrations safely?
Yes. Migrations run as a controlled step with a backup taken first, and are designed to work with both the old and new application versions during rollout.
How do we know CI/CD improved things?
Compare DORA metrics before and after, especially lead time and change fail rateSource [1].
Is our pipeline a security risk?
It can be. Secrets management, least-privilege tokens, and pinned actions reduce that riskSource [2].