Module 096 min

Shipping safely

Deployment is a skill, not a ceremony. The goal is to make releasing boring — small, reversible, and observed.

After this module
  • You can describe a pipeline that catches problems before users do, and a rollback you'd trust at 2am.
  • You know the four security defaults that belong in every first deploy.

A deploy used to mean a ceremony: freeze the code, gather the team, copy files, hold your breath. Modern practice makes it a non-event: automated, small, reversible and observed. That change is not about tooling fashion — it's what allows you to ship on a Friday afternoon without gambling the weekend.

ONE PIPELINE, ONE ARTIFACT commitpush buildonce testunit + lint scandeps + secrets stagingprod-like productionsmall, watched the same artifact is promoted — never rebuilt per environment
Build once, promote everywhere. If staging builds its own artifact, you tested something that production will never run. The dashed line is rollback: redeploy the previous artifact, which is a thing you can do in seconds rather than a project.

9.1Walk the pipeline

Try it · what each gate buys6 stages

Every push runs the pipeline — no manual start button. The point is that "does it build" is answered by a machine within minutes, not by a colleague on Slack.

9.2Four ways to make a release boring

9.3Security defaults for a first deploy

DefaultBecause
Secrets in a secret store or env vars — never in the repo, never in logsA leaked key in git history is a leaked key, even after you delete the file
Authorisation checked server-side, on every requestClient-side checks are suggestions; anyone can call your API directly
Input validated at the boundaryMost injection bugs start with trusting a string from outside
Dependencies pinned and scannedLockfiles give reproducibility; scanning tells you when a dependency becomes a liability
The trap · deploying by hand

SSHing into a server and pulling the latest code works exactly until the day it doesn't: you can't tell what's deployed, you can't roll back cleanly, and the fix lives in one person's memory. If a deploy needs a human to remember steps, those steps are a bug in the process.

Check yourselfQuestion 1 of 1

Which practice most reduces the chance of "it worked in staging but broke in production"?

60-second recap

  • Build once, promote everywhere. Configuration is injected, never baked in.
  • Fail fast: lint and unit tests ahead of the slow suites.
  • Small blast radius: flags, canaries, one instance first — and know your rollback.
  • Migrations in steps, secrets out of the repo, auth on the server, inputs validated.