Shipping faster with CI/CD: a pragmatic pipeline

Shipping faster with CI/CD: a pragmatic pipeline

A good pipeline makes releasing unremarkable. If deploys need a person, a runbook and a held breath, that is the thing to fix first.

CI: fast feedback on every push

  • Install, lint, type-check, unit and integration tests, build — in that order, failing fast.
  • Keep it under ten minutes. Parallelise, cache dependencies, and split slow suites.
  • Run the same commands locally so "works on my machine" and "passes CI" are the same statement.

CD: one path to production

Every environment is deployed the same way from the same artifact. Promote a build from staging to production — do not rebuild. Database migrations run automatically and are backwards-compatible for one release, so a rollback never breaks.

Safety without ceremony

  • Preview deploy per pull request for review.
  • Health checks and automatic rollback on a failed deploy.
  • Feature flags so shipping code and releasing a feature are separate events.
  • Error tracking and a dashboard so you notice regressions in minutes, not from a support ticket.

The result: small changes, released often, each easy to reason about and cheap to undo.

A minimal pipeline for a small team

You don't need a platform team to get most of the benefit. A hosted CI service, a single pipeline file in the repository, a staging environment and a one-click (or automatic) production promote covers most small products. Start there and add complexity only when a real problem demands it.

Testing strategy that fits in ten minutes

  • Many fast unit tests for business rules and calculations.
  • Fewer integration tests against a real database for the critical paths: signup, checkout, payments.
  • A handful of end-to-end browser tests for the flows that make money.

Flaky tests are worse than no tests because people learn to ignore failures. Fix or delete them quickly.

Secrets and configuration

Keep credentials in the CI system's secret store or a secrets manager, never in the repository. Use separate keys for staging and production, and rotate them when people leave. The same build artifact should run everywhere, configured only through environment variables.

Database migrations in the pipeline

Run migrations automatically as part of the deploy, and design them to be backwards-compatible with the previous release so a rollback of the code doesn't require a rollback of the database.

Measuring improvement

Track deployment frequency, lead time from merge to production, change failure rate and time to restore service. If those numbers improve, the pipeline is doing its job.

Talk to us

Want a pipeline set up for your project? See hosting & deployment, or get a free quote — we reply within one business day.

Need a team to build it?