BeginnerCoder

Lesson 25 — Ultimate: deploy pipeline

Boss level: deploy or roll back

A full deploy pipeline runs stages in order — build, test, deploy, smoke test. If a stage fails, it must roll back: undo the stages that already ran, in reverse order (the last thing done is undone first). [...done].reverse() makes a reversed copy without changing done.

Note: real DevOps tools (CI servers, load balancers, Docker, Kubernetes) cannot run in your browser, so this exercise is a small plain-JS simulation of the logic those tools use.

Why it matters: this is the core logic of every CI/CD system — and why a failed release leaves production as it was.

Want it another way?
Task

On failure, log "undo <name>" for each finished stage in reverse order, then return "rolled back".

Run your code — when the output matches the task, you will see a green check. Then mark the lesson complete.

Test your knowledge

A quick 3-question quiz on this lesson — instant feedback.

Enjoying this lesson? Share it.

Keep going with DevOps Foundations

Ready for more? Optional paid resources that pick up where this lesson leaves off.

Some links on this page are affiliate links: we may earn a commission at no extra cost to you. As an Amazon Associate I earn from qualifying purchases.