HxHippy

Deployment Checklist

Pre and post deployment verification steps.

Last updated: 2025-01-15

Deployment Checklist

Pre and post deployment verification steps.

Pre-Deployment

Code Review

# Check branch
git branch
git log --oneline -5

# Verify changes
git diff main..HEAD --stat

# Run tests
npm test
pytest tests/

Environment Check

# Verify environment
echo $ENVIRONMENT

# Check config
cat .env | grep -v PASSWORD

# Verify secrets
aws secretsmanager get-secret-value --secret-id prod/app --query SecretString

Backup

# Database backup
pg_dump production > pre_deploy_backup.sql

# Application backup
tar -czf app_backup_$(date +%Y%m%d).tar.gz /var/www/app

# Verify backup
ls -la *backup*

Pre-flight Checks

# System health
uptime
free -h
df -h

# Services running
systemctl status nginx
systemctl status app

# Current version
curl -s localhost/api/version

Deployment

Docker/Compose

# Pull latest
docker-compose pull

# Deploy with zero downtime
docker-compose up -d --no-deps --build app

# Verify
docker-compose ps
docker-compose logs --tail 50 app

Kubernetes

# Apply manifests
kubectl apply -f k8s/

# Watch rollout
kubectl rollout status deployment/app

# Check pods
kubectl get pods -l app=myapp

# Verify
kubectl logs -l app=myapp --tail 50

Direct Deploy

# Pull changes
cd /var/www/app
git pull origin main

# Install dependencies
npm install --production

# Restart service
sudo systemctl restart app

# Verify
sudo systemctl status app

Post-Deployment

Immediate Checks

# Application responding
curl -s http://localhost/health | jq .
curl -I http://localhost/

# Error rate
tail -100 /var/log/nginx/error.log | wc -l

# Response time
curl -w "Time: %{time_total}s\n" -o /dev/null -s http://localhost/

Smoke Tests

# Critical endpoints
curl -s http://localhost/api/health
curl -s http://localhost/api/users | head -1
curl -s http://localhost/login -d "user=test&pass=test"

# Run smoke test suite
npm run test:smoke

Monitoring

# Check metrics
curl -s localhost:9090/api/v1/query?query=http_requests_total

# Check for alerts
curl -s localhost:9093/api/v1/alerts

# Watch logs
tail -f /var/log/app/app.log | grep -i error

Rollback Plan

Quick Rollback

# Docker
docker-compose down
docker-compose up -d --force-recreate

# Kubernetes
kubectl rollout undo deployment/app

# Git
git checkout HEAD~1
sudo systemctl restart app

Database Rollback

# Restore from backup
psql production < pre_deploy_backup.sql

# Rollback migration
python manage.py migrate app 0005  # Previous migration

Deployment Checklist

Pre-Deploy

  • Tests passing
  • Code reviewed
  • Changelog updated
  • Database backup taken
  • Rollback plan ready
  • Team notified

Deploy

  • Deploy to staging first
  • Verify staging
  • Deploy to production
  • Watch for errors

Post-Deploy

  • Health check passing
  • Smoke tests passing
  • No error spike
  • Performance normal
  • Update documentation
  • Close tickets

Verification Commands

Check Command Expected
Health curl /health 200 OK
Version curl /version New version
Errors tail error.log No new errors
Response curl -w time < 1 second
Metrics curl metrics Normal rates
intermediate Daily Operations Updated 2025-01-15
  • deployment
  • checklist
  • release
  • verification
  • rollback