BeginnerCoder

Lesson 22 — Health-gated deploy (expert)

Promote only after checks pass

A health-gated deploy starts the new version (green) next to the old one (blue), runs its health check several times, and switches traffic only if every check passes. One failed check means traffic stays on blue. every() returns true only if the test is true for all items.

[true, true, false].every(Boolean)   // false

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 gate is what makes "zero-downtime deploy" actually zero-downtime.

Want it another way?
Task

In promote(), switch active to "green" only when every check in the list is true.

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

← Back
Next →
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.