CLI Overview
Quick Start Guide
wheels info
wheels reload
wheels deps
wheels destroy
wheels watch
wheels generate app
wheels generate app-wizard
wheels generate controller
wheels generate model
wheels generate view
wheels generate property
wheels generate route
wheels generate resource
wheels generate api-resource
wheels generate frontend
wheels generate test
wheels generate snippets
wheels scaffold
wheels db create
wheels db drop
wheels db setup
wheels db reset
wheels db status
wheels db version
wheels db rollback
wheels db seed
wheels db dump
wheels db restore
wheels db shell
wheels db schema
wheels dbmigrate info
wheels dbmigrate latest
wheels dbmigrate up
wheels dbmigrate down
wheels dbmigrate reset
wheels dbmigrate exec
wheels dbmigrate create blank
wheels dbmigrate create table
wheels dbmigrate create column
wheels dbmigrate remove table
wheels test
wheels test run
wheels test coverage
wheels test debug
wheels config list
wheels config set
wheels config env
wheels env
wheels env setup
wheels env list
wheels env switch
wheels environment
wheels console
wheels runner
wheels server
wheels server start
wheels server stop
wheels server restart
wheels server status
wheels server log
wheels server open
wheels plugins
wheels plugins list
wheels plugins install
wheels plugins remove
wheels analyze
wheels analyze code
wheels analyze performance
wheels analyze security
wheels security
wheels security scan
wheels optimize
wheels optimize performance
wheels docs
wheels docs generate
wheels docs serve
wheels ci init
wheels docker init
wheels docker deploy
wheels deploy
wheels deploy audit
wheels deploy exec
wheels deploy hooks
wheels deploy init
wheels deploy lock
wheels deploy logs
wheels deploy proxy
wheels deploy push
wheels deploy rollback
wheels deploy secrets
wheels deploy setup
wheels deploy status
wheels deploy stop
Configuration Management
Creating Commands
Service Architecture
Migrations Guide
Testing Guide
Object Relational Mapping
Creating Records
Reading Records
Updating Records
Deleting Records
Column Statistics
Dynamic Finders
Getting Paginated Data
Associations
Nested Properties
Object Validation
Object Callbacks
Calculated Properties
Transactions
Dirty Records
Soft Delete
Automatic Time Stamps
Using Multiple Data Sources
deploy hooks (Coming Soon)
This command may not work as expected. A complete and stable version is coming soon.
Manage deployment hooks for custom actions during the deployment lifecycle.
Synopsis
wheels deploy hooks <action> [hook-name] [options]
Description
The wheels deploy hooks
command allows you to manage custom hooks that execute at specific points during the deployment process. These hooks enable you to run custom scripts, notifications, or integrations at key deployment stages.
Actions
list
- List all configured deployment hooksadd
- Add a new deployment hookremove
- Remove an existing hookenable
- Enable a disabled hookdisable
- Disable a hook without removing ittest
- Test a hook executionshow
- Show details about a specific hook
Options
--stage
- Deployment stage (pre-deploy, post-deploy, rollback, error)--script
- Path to hook script or command--timeout
- Hook execution timeout in seconds (default: 300)--retry
- Number of retry attempts on failure (default: 0)--async
- Run hook asynchronously--environment, -e
- Target environment (default: all)--priority
- Hook execution priority (1-100, lower runs first)
Hook Stages
pre-deploy
Executed before deployment starts:
- Backup creation
- Service notifications
- Resource validation
- Custom checks
post-deploy
Executed after successful deployment:
- Cache warming
- Health checks
- Monitoring updates
- Success notifications
rollback
Executed during rollback operations:
- Cleanup tasks
- State restoration
- Failure notifications
- Recovery actions
error
Executed when deployment fails:
- Error logging
- Alert notifications
- Cleanup operations
- Incident creation
Examples
List all hooks
wheels deploy hooks list
Add a pre-deploy hook
wheels deploy hooks add backup-database \
--stage pre-deploy \
--script ./scripts/backup-db.sh \
--timeout 600
Add notification hook
wheels deploy hooks add slack-notify \
--stage post-deploy \
--script "curl -X POST https://hooks.slack.com/services/..." \
--async
Test a hook
wheels deploy hooks test backup-database
Disable a hook temporarily
wheels deploy hooks disable backup-database
Show hook details
wheels deploy hooks show slack-notify
Hook Script Requirements
Hook scripts should:
- Return exit code 0 for success
- Return non-zero exit code for failure
- Output status messages to stdout
- Output errors to stderr
- Handle timeouts gracefully
Example hook script
#!/bin/bash
# pre-deploy-backup.sh
echo "Starting database backup..."
pg_dump myapp > backup-$(date +%Y%m%d-%H%M%S).sql
if [ $? -eq 0 ]; then
echo "Backup completed successfully"
exit 0
else
echo "Backup failed" >&2
exit 1
fi
Environment Variables
Hooks receive these environment variables:
DEPLOY_STAGE
- Current deployment stageDEPLOY_ENVIRONMENT
- Target environmentDEPLOY_VERSION
- Version being deployedDEPLOY_USER
- User initiating deploymentDEPLOY_TIMESTAMP
- Deployment start time
Use Cases
Database backup hook
wheels deploy hooks add db-backup \
--stage pre-deploy \
--script ./hooks/backup-database.sh \
--timeout 1800
Notification hooks
# Slack notification
wheels deploy hooks add notify-slack \
--stage post-deploy \
--script ./hooks/notify-slack.sh \
--async
# Email notification
wheels deploy hooks add notify-email \
--stage error \
--script ./hooks/send-error-email.sh
Health check hook
wheels deploy hooks add health-check \
--stage post-deploy \
--script ./hooks/verify-health.sh \
--retry 3
Best Practices
- Keep hooks simple: Each hook should do one thing well
- Handle failures: Always include error handling in hook scripts
- Set timeouts: Prevent hooks from blocking deployments
- Test thoroughly: Test hooks in staging before production
- Log output: Ensure hooks provide clear logging
- Use priorities: Order hooks appropriately with priorities
- Document hooks: Maintain documentation for all hooks
See Also
- deploy exec - Execute deployment
- deploy rollback - Rollback deployment
- deploy logs - View deployment logs
- Synopsis
- Actions
- Options
- Hook Stages
- pre-deploy
- post-deploy
- rollback
- error
- Examples
- List all hooks
- Add a pre-deploy hook
- Add notification hook
- Test a hook
- Disable a hook temporarily
- Show hook details
- Hook Script Requirements
- Example hook script
- Environment Variables
- Use Cases
- Database backup hook
- Notification hooks
- Health check hook
- Best Practices
- See Also