Jenkins Blue-Green & Canary Deploy Pipeline Prompt
Build a Jenkins pipeline that ships with blue-green or canary rollout — deploy alongside the current version, verify, shift traffic gradually or cut over, and roll back on failed health checks.
- Target user
- SREs building safe-release pipelines in Jenkins
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are an SRE who builds Jenkins deployment pipelines that release without downtime and revert automatically when a new version misbehaves. I will provide: - My deploy target (Kubernetes/Helm, load balancer + VMs, serverless) and traffic-shifting mechanism - Whether I want blue-green (instant cutover) or canary (gradual) - My health signals (HTTP probe, smoke tests, error-rate/latency query) and what "good" means Your job: 1. **Choose the pattern** — confirm blue-green vs canary fits my traffic mechanism, and state the tradeoffs (blue-green = fast rollback, double capacity; canary = gradual, needs traffic weighting + metrics). 2. **Stages** — design the pipeline stages: deploy new (green/canary) alongside old, warm/verify, shift traffic (cutover or step weights 5→25→50→100), and decommission old. 3. **Verification gate** — add a stage that runs smoke tests and queries error-rate/latency with a bounded timeout between each canary step; make failure trigger rollback. 4. **Rollback** — on failed verification, revert traffic to the stable version (keep it running until fully promoted) and mark the build failed/red. Make rollback idempotent. 5. **Approval** — optionally gate the final 100% cutover behind an `input` step for production. 6. **Concurrency & state** — use `lock`/resource control so two deploys don't fight over the same environment, and record which version is currently live. Output: (a) the chosen-pattern rationale, (b) the pipeline stages (deploy/verify/shift/rollback/cleanup), (c) the health-gate and rollback logic, (d) a forced-failure test to prove rollback fires. Bias toward: keeping the stable version alive until full promotion, metric-gated traffic shifts, and automatic revert.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Jenkins Declarative Pipeline Design Prompt
Design a clean, maintainable declarative Jenkinsfile from scratch — stages, agents, environment, post conditions, and options — instead of a sprawling freestyle or scripted mess.
-
Jenkins Kubernetes Agents Prompt
Run Jenkins builds on ephemeral Kubernetes pod agents — pod templates, container-per-tool, resource requests, and workspace handling — so build capacity scales on demand and every build starts clean.
-
Jenkins Pipeline Observability Prompt
Make Jenkins pipelines observable — build duration and stage-level metrics, failure-rate and queue-time tracking, log aggregation, and dashboards — so you can see where builds are slow, flaky, or queued.
-
Jenkins Agent & Executor Label Strategy Prompt
Design a Jenkins agent and label scheme so jobs land on the right node — build tools, OS, GPU, network zone — without pinning to a single machine, overloading executors, or leaving capacity idle.
More Jenkins prompts & error guides
Browse every Jenkins prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.