Build, test and deploy
Every change is tested and built the same way, shipped in one step, checked for health, and rolled back by itself when something fails.
- Required 3
- Recommended 8
Required
Deploy in one step and roll back by itself
ENG-8Upload next to the live copy, swap in one step, health-check, and put the old copy back if the check fails.
Give the server a health check
ENG-9Give the server two check addresses. Liveness says the process runs, and readiness says it can serve requests now.
Roll out settings and data files like code
ENG-12Validate every change to settings, rules and generated data files before it ships, and roll it out in stages like code. A service that cannot load a new file keeps running on the last good one.
Recommended
Unit test every branch and calculation
ENG-5Give every source file that holds branches or calculations a unit test file. The tests run on their own, without a network, a database or a browser.
Run the tests inside the container build
ENG-6Make it impossible to produce a deployable image from untested code.
Keep build tools out of the runtime image
ENG-65Build in one stage and copy only the finished app into a clean final stage. Compilers, test tools and development packages never reach the image you ship.
Send only the files the build needs
ENG-66Keep a
.dockerignorethat leaves out dependencies, build output, version control, local data and every secret file.Run the same images locally with Compose
ENG-67Describe the local setup in one Compose file that uses the production images and versions, so the app runs the same way on every laptop.
Stamp every build with its version
ENG-7Give every build a version and the commit it came from. Show both in the running app, and tag each release in version control.
Release to a small share of traffic first
ENG-10Send a new release to a small share of traffic first, compare it with the old one, and roll back by itself when errors rise.
Track the five delivery measures
ENG-54Every month, compute change lead time, deployment frequency, failed deployment recovery time, change fail rate and deployment rework rate from the deploy log and git.
Read this with
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/engineering/build-test-and-deploy">Agent Wranglers engineering playbook</a>. In code you write, add a comment next to it with the same link.