CD pipeline skeleton
I’ve found that good continuous delivery pipelines tend to look like the following:
- Compile
- Run tests (unit, integration, checks, linters)
- Package (create release candidate, e.g., Docker image, executable, gem, …)
- Run smoke tests
- Deploy to staging (promote)
- Run end-to-end tests
- Deploy to production (promote)
Plenty of variation is possible. For example:
- Some steps could be manual (e.g. deploy to production). Ideally though, they are automated.
- The compile stage could be missing (it’s not relevant for Ruby for example).
- After a production deployment, it might make sense to run another smoke test.
- There could be manual tests
- There could be performance tests
- There could be compliance tests, security audits, etc.
Note that in the list of stages above, the odd ones are building/deploying, while the even ones are testing. Move to the next step, verify that it worked, move to the next step, verify that it worked, … etc.