Andrew's Digital Garden

12 Factor: 5. Build, release, run

Strictly separate build and run stages

  • The build stage is a transform which converts a code repo into an executable bundle known as a build. Using a version of the code at a commit specified by the deployment process, the build stage fetches vendors dependencies and compiles binaries and assets.
  • The release stage takes the build produced by the build stage and combines it with the deploy’s current config. The resulting release contains both the build and the config and is ready for immediate execution in the execution environment.
  • The run stage (also known as “runtime”) runs the app in the execution environment, by launching some set of the app’s processes against a selected release.

The twelve-factor app uses strict separation between the build, release, and run stages.

Every release should have a unique release ID. Releases are append-only, and a release cannot be mutated once its created. Any change must be a new release.

Builds are initiated by developers for code changes. Runtime execution can happen automatically, e.g. server reboots. Try to keep the run stage as light and simple as possible to avoid errors at unfortunate times.

[[12factor]] [[architecture]] [[deployment]] [[infrastructure]] [[ops]]

12 Factor: 5. Build, release, run