Build, release, run

Strictly separate build and run stages.

  • Three stages:
    • Build is a transform of source code into an executable bundle called a build. Using a specified commit, this stage fetches dependencies and compiles binaries/assets.
    • Release takes the build produced above and combines it with a deploy's Configuration. The release contains both the build and the config, ready for immediate execution.
    • Run runs the app in an execution environment by launching processes against a selected release.
  • Strict separation between the three stages make it impossible to make changes to the code during runtime, since changes can't be propagated back to the build stage.
  • Deployment tools enable easier rollback.
  • Releases should be uniquely identifiable from a timestamp or version identifier.
    • Releases are immutable: new releases can be created, but existing releases may not be modified.
  • Builds are initiated by developers when new code is deployed.
  • Runtime execution can be automatic, e.g. in case of scaling or recovery events.
    • Shift left: the run stage should be kept as simple as possible to ensure engineers aren't required for recovery during unsociable hours.