What is CI/CD? Explained with a factory assembly line
CI/CD automatically builds and tests every small software change as soon as it is added, so the product is always ready to release. Explained with an assembly line that checks every part.
- Author
Umair Mateen- Published
- Reading time
- 5 min
- Category
- DevOps
In one sentence: CI/CD (continuous integration and continuous delivery or deployment) is a way of building software where every small change is automatically built and tested as soon as it is added, so the product is always ready to release with little effort.
The everyday picture
Picture a factory that makes kitchen kettles. Many workers each make one part: a lid, a handle, a switch. In a badly run factory, everyone works alone for weeks. Then on one big day they try to fit all the parts together. Nothing fits, and nobody knows whose part is wrong.
A well-run factory works differently. Each part joins the assembly line as soon as it is made. At every station, a quality check tests it straight away. If a check fails, the line stops and the problem is fixed at once, while it is small and easy to find. At the end of the line, every kettle is boxed and ready for the shop.
In software, adding each part to the line early is continuous integration (CI). Keeping every finished product boxed and ready to ship is continuous delivery (CD). Sending boxes to the shop automatically, with no one signing them off, is continuous deployment.
Each small code change joins the shared line, is built and tested automatically, and is packed ready to release. A person, or the system itself, then sends it to customers.
How it works, step by step
- A developer adds a small change (a worker puts a new part on the line). Changes go into one shared copy of the code, called the main line. Software writer Martin Fowler describes everyone doing this at least daily, and often more.
- The CI service builds and tests it automatically (the quality check at each station). Every change triggers a fresh build and a set of automated tests. On GitHub, for example, the results of each test appear right next to the proposed change.
- A failed check stops the line (the line halts until the faulty part is fixed). The developer is told, and fixing it comes first. Because only a small change was added, finding the cause is usually quick.
- Passing changes are packed, ready to release (every kettle boxed for the shop). AWS describes continuous delivery as changes being automatically built, tested and prepared for release. Going live becomes a business decision, not a technical project.
- The release reaches customers (boxes go to the shop). With continuous delivery, a person chooses when. With continuous deployment, every change that passes all checks goes live automatically, without anyone approving it.
Try it · What would you do?
Every launch breaks something. What would CI/CD change?
Your team merges three months of work on one big launch weekend, and something always breaks. What do you change?
Pick what you would do. You can change your mind.
Where the picture stops
- Software has no physical parts. A "change" can be a single line of code, and the whole line of checks can run in minutes, many times a day.
- The checks are only as good as the people who wrote them. Fowler is clear that tests do not prove there are no bugs. A factory inspector can see a cracked lid; an automated test only catches problems someone thought to test for.
- Software can be taken back. A kettle sold is gone. A bad software release can often be rolled back to the previous version, which GOV.UK lists as a normal step if something goes wrong.
Why it matters for your business
- Problems are found sooner and cost less. GitHub notes that committing code more often detects errors sooner. A fault caught the same day is a small fix, not a crisis.
- Safer updates. GOV.UK advises teams to "deploy little and often". With fewer things changing at once, bugs and security issues are easier to spot.
- Customers get improvements faster. When the product is always ready, a fix or new feature does not wait for a big, risky release day.
- Less stress around releases. AWS describes releases under continuous delivery as a repeatable process rather than a disruptive event.
An example
Imagine a small online bookshop with two developers. One fixes the postcode check at checkout. The other adds a "gift wrap" option. Both add their changes to the shared code on the same morning.
Within minutes, the automated tests run. One fails: the gift wrap change broke the delivery price for overseas orders. The developer sees it straight away, fixes it before lunch, and the tests pass. The owner looks at the ready-to-release version and presses the button to make it live that afternoon.
Frequently asked questions
What does CI/CD stand for?
CI stands for continuous integration. CD stands for continuous delivery or continuous deployment, depending on whether a person approves each release or it goes live automatically.
What is the difference between continuous delivery and continuous deployment?
Both keep software always ready to release. In continuous delivery, a person decides when to go live. In continuous deployment, every change that passes all the automated checks is released automatically.
What is a CI/CD pipeline?
It is the automated series of steps every change passes through: build, test and prepare for release, sometimes followed by release itself. It is the assembly line in our picture.
Does CI/CD mean there will be no bugs?
No. It catches many problems early, but tests can only find what they were written to check. Monitoring and the ability to roll back are still needed.
Related explainers
- What is testing and staging? Explained with a trial dinner before opening night
- What is monitoring? Explained with smoke alarms
- What is cloud hosting? Explained with a serviced office
- What are backups? Explained with a spare key at a friend's house
The DevDrift sets up automated build, test and release pipelines for web and SaaS products: see how.
Sources
Could you explain this to a colleague now?
Mark it and posts that mention it will show a tick. Saved in this browser only.