wheels deploy rollback
Rollback to a previous deployment.
Synopsis
Description
The wheels deploy:rollback
command reverts your application to a previous deployment by switching to an earlier Docker image version. It provides quick recovery from failed deployments or problematic releases by pulling and running a previous known-good image.
Options
tag=<string>
- Specific tag to rollback to (if not provided, shows available versions)servers=<string>
- Rollback specific servers (comma-separated list)--force
- Skip confirmation prompt (default: false)
Examples
Interactive rollback (shows available versions)
Rollback to specific version
Rollback specific servers
Force rollback without confirmation
Rollback Process
The rollback follows these steps:
Image Discovery (if no tag specified):
Connect to first server
List available Docker images
Display versions with creation dates
Allow user to select version
Confirmation:
Display selected version
Show target servers
Request confirmation (unless --force)
Execution (for each server):
Check if image exists locally
Pull image from registry if needed
Update docker-compose.yml with selected image
Stop current container
Start container with rollback image
Wait for health check
Verification:
Perform health checks
Report success/failure for each server
Interactive Rollback Example
Configuration
The rollback uses the same configuration from config/deploy.yml
as the deployment:
Health Checks
The rollback performs health checks after switching images:
Uses the health check configuration from deploy.yml
Timeout is hardcoded to 60 seconds for rollbacks
If health check fails, the rollback is reported as failed
Docker Image Management
The rollback command:
Lists images matching the configured registry/username/image pattern
Shows creation timestamps to help identify versions
Pulls images from registry if not available locally
Uses the same docker-compose.yml generation as deployments
Emergency Rollback
For critical situations where interactive selection isn't feasible:
Manual Rollback (Last Resort)
If the rollback command fails:
Best Practices
Tag Releases Properly: Use semantic versioning for easy identification
Keep Images Available: Don't prune old images too aggressively
Test Rollbacks: Practice rollback procedures in staging
Monitor After Rollback: Verify application functionality
Document Issues: Record why rollback was needed
Limitations
Requires Docker images to be available (locally or in registry)
Database changes are not rolled back automatically
Environment file changes persist
Shared volumes (storage, logs) are not affected
See Also
wheels deploy:push - Deploy application
wheels deploy:status - Check deployment status
wheels deploy:logs - View deployment logs
wheels dbmigrate down - Rollback migrations
Last updated
Was this helpful?