CD8: Delivery and rollback

Lesson 1 of 5 · reading 15–25 minutes; practice and project time is on the module page

Continuous delivery: build once, release many times

🎯You'll be able to

Explain continuous delivery and deployment, build one versioned artefact per change, and promote that same artefact through environments.

🏠The everyday picture

A publisher prints one edition of a book and sends copies of that same print run to every shop. They don't reprint it separately for each city, where a different printer might make a different mistake.

📘What it really is

📝A worked example

Input: in the finished kit, run node tools/pipeline.js 1.0.1 and then node tools/pipeline.js 1.0.2.

Expected output: each run tests, builds routerani:<version>, deploys and verifies it, then writes the live version to infra/release.auto.tfvars. docker images routerani lists both versions, so going back to 1.0.1 needs no rebuild. Running node tools/pipeline.js latest stops straight away with a usage message, because a moving tag can't identify a release (Project 2 test 5).

🌍Where it's used

📝Case scenario

An insurance company rebuilt its app separately for production after testing in staging. One Friday, a library had released a new version between the two builds; production got it, staging hadn't. Claims uploads broke for the weekend. Afterwards, the pipeline built once and promoted the same image digest, and the problem class disappeared.

🖱️Try it

Run the pipeline twice with different versions, then cat infra/release.auto.tfvars and docker images routerani. Success: you can say which version is live, where that's recorded, and which image a rollback would use.

⚠️Common mistakes

🛠️For your project

Project 2 builds each version once with its own tag, refuses latest, and records the live version for rollbacks and the autoscaler.

✅Quick check

What's the difference between continuous delivery and continuous deployment?

Show the answer

Delivery keeps every passing change ready to release with a button; deployment releases it automatically.

Why build an image only once?

Show the answer

So the image you tested is exactly the one that reaches production.

← BackCD8
ProLearners Assist