---
title: "Build, test and deploy · Agent Wranglers"
url: https://agentwranglers.se/playbook/engineering/build-test-and-deploy
updated: 2026-10-20
licence: "All rights reserved"
---

# Build, test and deploy

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

> Every change is tested and built the same way, shipped in one step, checked for health, and rolled back by itself when something fails.

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers engineering playbook: https://agentwranglers.se/playbook/engineering/build-test-and-deploy`.

## Required

- [Unit test the tricky parts](https://agentwranglers.se/playbook/engineering/build-test-and-deploy/unit-tests-for-the-tricky-parts): Test logic that can break silently on its own, without a network, a database or a browser.
- [Stamp every build with its version](https://agentwranglers.se/playbook/engineering/build-test-and-deploy/version-every-release): Give every build a version and the commit it came from. Show both in the running app, and tag each release in version control.
- [Deploy in one step and roll back by itself](https://agentwranglers.se/playbook/engineering/build-test-and-deploy/atomic-deploys-with-rollback): Upload 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](https://agentwranglers.se/playbook/engineering/build-test-and-deploy/health-check-and-rollback): Give the server a health check address that tests its dependencies, so deploys and monitors know when it is broken.

## Recommended

- [Run the tests inside the container build](https://agentwranglers.se/playbook/engineering/build-test-and-deploy/container-build-gated-by-tests): Make it impossible to produce a deployable image from untested code.
- [Release to a small share first](https://agentwranglers.se/playbook/engineering/build-test-and-deploy/staged-rollouts): Send a new release to a small share of traffic first, compare it with the old one, and roll back by itself when errors rise.

- Previous: [Rules as code](https://agentwranglers.se/playbook/engineering/rules-as-code)
- Next: [Version control and review](https://agentwranglers.se/playbook/engineering/version-control-and-review)
- [All chapters](https://agentwranglers.se/playbook/engineering)
