- Home
- Skills
- DevOps & Cloud
- zero downtime deploy
zero downtime deploy
Automate blue-green, rolling, and canary deployments with atomic symlinks, Nginx swaps, and health-check rollbacks.
Free
Works with the AI tools you already use
zero downtime deploy
Example session with this skill installed
I need a bash script for my Node.js app that performs a blue-green swap using Nginx upstreams. It should health check the target port before switching and offer a rollback command.
- Read your context and instructions
- Compiled the zero downtime deploy
This script manages an atomic upstream swap for Nginx by verifying the target application is responsive before updating the active configuration.
Blue-Green Deployment Script
#!/bin/bash
# Blue-Green upstream swap for Nginx
set -euo pipefail
TARGET=${1:-}
ACTIVE_CONF="/etc/nginx/active_upstream.conf"
HEALTH_CHECK_TIMEOUT=30
log() { echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*"; }
# Determine current and target
current=$(grep -oP 'http://\K[a-z]+' "$ACTIVE_CONF" 2>/dev/null || echo "blue")
if [[ -z "$TARGET" ]]; then
TARGET=$([ "$current" = "blue" ] && echo "green" || echo "blue")
fi
TARGET_PORT=$([ "$TARGET" = "blue" ] && echo "3000" || echo "3001")
log "Health checking $TARGET on port $TARGET_PORT..."
deadline=$((SECONDS + HEALTH_CHECK_TIMEOUT))
while [[ $SECONDS -lt $deadline ]]; do
if curl -fsS --max-time 3 "http://127.0.0.1:${TARGET_PORT}/health" > /dev/null 2>&1; then
log "$TARGET is healthy"
break
fi
sleep 2
done
if ! curl -fsS --max-time 3 "http://127.0.0.1:${TARGET_PORT}/health" > /dev/null 2>&1; then
log "ERROR: Health check failed. Aborting swap."
exit 1
fi
# Atomic swap
TMP_CONF=$(mktemp)
echo "proxy_pass http://${TARGET};" > "$TMP_CONF"
sudo mv "$TMP_CONF" "$ACTIVE_CONF"
sudo nginx -s reload
log "Switched to $TARGET. To rollback: $0 $current"
Next steps
- Ensure
/etc/nginx/sites-enabled/includesactive_upstream.confin itslocationblock. - Grant the deploy user
NOPASSWDsudo rights fornginx -s reload. - Test the script in a staging environment by simulating a failed health check.
Connects securely to your tools. The creator never sees your data.
About this skill
The problem
Standard deployments cause service interruptions, broken connections, or data corruption during transitions. Manual SSH updates are error-prone, lack rollback mechanisms, and often fail to validate application health before exposing new code to users.
What it does
- Generates Nginx upstream configurations for blue-green and canary traffic splitting.
- Authors Bash scripts for atomic release management using Capistrano-style symlink swaps.
- Builds GitHub Actions workflows for SSH-based deployment with health check polling.
- Designs safe database migration strategies using the expand/contract pattern.
- Creates automated rollback runbooks to restore service in under 30 seconds.
Frameworks & tools
Nginx, GitHub Actions, Systemd, Rsync, Bash, SSH, and any backend capable of health check endpoints (Node.js, Python, Go, etc.).
Why this beats prompting it yourself
General LLMs often overlook the race conditions inherent in symlink swaps or the necessity of CREATE INDEX CONCURRENTLY in Postgres. This skill provides production-hardened scripts that include atomic file moves, pre-swap health validation, and automated cleanup of old releases.
Use cases
- Implementing zero-downtime blue-green environments on VPS or bare metal.
- Gradually rolling out features to 10% of users via canary traffic splitting.
- Setting up CI/CD pipelines that automatically roll back on failed health checks.
- Planning non-breaking database schema changes for high-traffic apps.
Known limitations
Does not support Kubernetes-native objects like Argo Rollouts or cloud-managed services like AWS CodeDeploy. Frontend CDN cache invalidation is out of scope.
How to install
Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.
- 1
Download the ZIP
Free skills download straight away. Paid skills unlock right after purchase.
- 2
Unzip into your skills folder
Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.
- 3
Ask your agent to use it
Restart the agent if it was already running. It picks the skill up automatically - no config needed.
Skills folder by agent
Click the path to copy it. Create the folder if it does not exist yet.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
1 install
Downloaded by developers to date
Free forever
No account required to browse
Trust & safety
Security scanned
Verified clean 12 days ago
- Free to download with an account
Needs access to