# Your Environment Is Part of Your Program

- Published: 2026-10-02
- Updated: 2026-11-26
- Tags: Continuous Delivery, Books
- URL: https://devtrillo.com/writing/continuous-delivery-4-config-and-environments/

> Part 4 of a series reading _Continuous Delivery_, by Jez Humble and David Farley. Part 1: [Continuous Delivery Is a State, Not a Pipeline](/writing/continuous-delivery-1-a-state-not-a-pipeline/).

So far this series has treated "the software" as the code. The commits, the tests, the pipeline that proves them.

But the code does not run in a vacuum. It runs on a machine, with a runtime, against a database, holding a fistful of config values. And most teams treat that half of the system as someone else's job — ops' problem, handled later, by hand, after the interesting part is done.

That is the gap where releasable software quietly stops being releasable.

The book's position is blunt: **your environment is part of your program.** The config, the infrastructure, the OS packages — all of it is input your code depends on, so all of it belongs in version control, right next to the code.

## Configuration is code

Start with the smallest version of the problem: configuration.

The default way config happens is that someone SSHes into a box and types values in. A connection string here. A pool size tuned at 2am there. It works — until the box dies, or a second box needs the same treatment, or six months pass and nobody remembers why the timeout is five seconds.

**Configuration as code: move settings out of a server's memory and into version control**

Before:

```ts
// config hand-edited on the server, gone when the box dies
const db = connect({
  host: "10.0.0.42",   // typed in over SSH
  poolSize: 5,          // someone tuned this at 2am
  timeoutMs: 5000,
});
```

After:

```ts
// config read from a versioned, per-environment source
import { config } from "./config";

const db = connect({
  host: config.db.host,
  poolSize: config.db.poolSize,
  timeoutMs: config.db.timeoutMs,
});
```

Nothing clever changed. The values are the same. What changed is _where they live_: in a file, in the repo, reviewed like any other change, and identical every time it deploys. Configuration is code — so it gets the same treatment as code. Version controlled, diffable, and reproducible.[^configmgmt]

## Environments are versioned artifacts

Now scale the same idea up from a config value to a whole machine.

If a value hand-typed into a box is fragile, an entire environment hand-assembled over years is a time bomb. It has a name. Everyone calls it "the prod box," and everyone is a little afraid of it, because nobody could recreate it if it burned down. That is a **snowflake** — unique, delicate, and impossible to reproduce.

The book's answer is infrastructure as code: the environment is described in files you can version, review, and run to produce the machine from scratch.[^iac] The test is simple and ruthless — could you stand up an identical environment tomorrow from what's in the repo? If yes, it is an artifact. If it lives only in one server's accumulated history, it is a liability.

> **Note:** The tell that you have a snowflake is fear. If deploying, patching, or
> rebooting a specific machine makes the team nervous, it is because no file
> describes it — the machine _is_ the documentation, and you can't diff a
> machine.

## Parity is what makes green mean something

Here is why all of this connects back to Continuous Delivery.

The whole point of the pipeline (Part 2) was that a green run is _evidence_ the software is releasable. But that evidence is only as good as the environment it was gathered in. If your tests pass in an environment that looks nothing like production, green tells you almost nothing.

Watch what drift does to that promise.

**A hand-managed environment drifting from dev, versus config as code**

| Setting | dev | prod (hand-managed) | prod (config as code) |
| --- | --- | --- | --- |
| openssl | 3.0.1 | 3.0.9, hand-patched | 3.0.1 |
| pool.timeout | 30s | 5s, edited live | 30s |
| node | 20.11 | 20.4, never upgraded | 20.11 |
| FEATURE_X | off | off | off |

- hand-managed: dev and prod differ. deploy: works in dev, breaks in prod. **Nobody chose this.** Prod drifted one live edit at a time — a patched library here, a tuned value there — until it is a machine no file describes. The pipeline was green against dev, so the break is a surprise.
- config as code: dev and prod match. deploy: parity — green means green. **Both environments are the same artifact.** Provisioned from the same versioned source, so what passed in one passes in the other. A green pipeline now actually predicts production.

The failure in the hand-managed case is not a bug in the code. The code is fine. The bug is that production drifted away from the environment the pipeline tested, one live edit at a time, until "passed in dev" stopped predicting "works in prod." Environment parity is what keeps the pipeline honest. The closer your environments are — same OS, same runtime, same config source — the more a green bar actually means.

## "Works on my machine" is an environment bug

Which reframes the oldest excuse in software.

"Works on my machine" is usually said as a shrug, as if the difference between machines were an act of God. It is not. It is a defect — a difference between two environments that should have been identical and weren't. Under CD, that sentence is not an excuse. It is a bug report about your environment management.

> **Tip:** When someone says "works on my machine," resist the urge to debug the code
> first. Debug the _difference_: what does their environment have, or lack, that
> the failing one doesn't? Nine times out of ten the fix is parity, not a code
> change.

**Deep dive: Isn't full infra-as-code overkill for a small project?**

The principle scales down further than people expect. You don't need Terraform and a platform team to version your environment — for a small app, "infrastructure as code" can be a Dockerfile, a `compose` file, and a checked-in config, which together let anyone recreate the setup with one command. The point isn't the tooling tier; it's that _no part of your running system exists only in a machine's memory_. A single well-chosen config file already buys you most of the parity. The overkill is not versioning your environment — it's the weekend you lose rebuilding a box nobody could describe.

## So, where does the environment fit?

It is not ops' problem for after the code is written. It is part of the program.

Configuration is code, kept in version control. Environments are artifacts you can reproduce from files, not snowflakes you're afraid to touch. Parity between them is what lets a green pipeline predict production instead of merely hoping for it. And "works on my machine" is a bug in that parity, not a fact of life.

Get this right and the environment stops being the wildcard that turns a proven build into a surprise outage.

Next in the series: Part 5, data and migrations — the one place a rollback can't save you, and the pattern that makes zero-downtime schema changes possible anyway.

[^configmgmt]: Jez Humble and David Farley, [_Continuous Delivery_](https://continuousdelivery.com/) — configuration is treated as a first-class input to the system, kept under version control and managed like code.

[^iac]: The modern name for the practice is infrastructure as code. See Martin Fowler, [InfrastructureAsCode](https://martinfowler.com/bliki/InfrastructureAsCode.html) — provisioning environments from versioned definitions so they are reproducible rather than hand-built.
