LogoLogo
HomeAPIBlog
3.0.0-SNAPSHOT
3.0.0-SNAPSHOT
  • INTRODUCTION
    • Getting Started
      • Running Local Development Servers
      • Beginner Tutorial: Hello World
      • Beginner Tutorial: Hello Database
      • Tutorial: Wheels, AJAX, and You
    • Frameworks and Wheels
    • Requirements
    • Manual Installation
    • Upgrading
    • Screencasts
  • Command Line Tools
    • CLI Overview
    • Quick Start Guide
    • Command Reference
      • Core Commands
        • wheels init
        • wheels info
        • wheels reload
        • wheels deps
        • wheels destroy
        • wheels watch
      • Code Generation
        • 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
      • Database Commands
        • 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 db schema
        • wheels db seed
      • Testing Commands
        • wheels test
        • wheels test run
        • wheels test coverage
        • wheels test debug
      • Configuration Commands
        • wheels config list
        • wheels config set
        • wheels config env
      • Environment Management
        • wheels env
        • wheels env setup
        • wheels env list
        • wheels env switch
      • Plugin Management
        • wheels plugins
        • wheels plugins list
        • wheels plugins install
        • wheels plugins remove
      • Code Analysis
        • wheels analyze
        • wheels analyze code
        • wheels analyze performance
        • wheels analyze security
      • Security Commands
        • wheels security
        • wheels security scan
      • Performance Commands
        • wheels optimize
        • wheels optimize performance
      • Documentation Commands
        • wheels docs
        • wheels docs generate
        • wheels docs serve
      • CI/CD Commands
        • wheels ci init
      • Docker Commands
        • wheels docker init
        • wheels docker deploy
      • Deployment Commands
        • 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
    • CLI Development Guides
      • Creating Commands
      • Service Architecture
      • Migrations Guide
      • Testing Guide
  • Working with Wheels
    • Conventions
    • Configuration and Defaults
    • Directory Structure
    • Switching Environments
    • Testing Your Application
    • Using the Test Environment
    • Contributing to Wheels
    • Submitting Pull Requests
    • Documenting your Code
  • Handling Requests with Controllers
    • Request Handling
    • Rendering Content
    • Redirecting Users
    • Sending Files
    • Sending Email
    • Responding with Multiple Formats
    • Using the Flash
    • Using Filters
    • Verification
    • Event Handlers
    • Routing
    • URL Rewriting
      • Apache
      • IIS
      • Tomcat
      • Nginx
    • Obfuscating URLs
    • Caching
    • Nesting Controllers
    • CORS Requests
  • Displaying Views to Users
    • Pages
    • Partials
    • Linking Pages
    • Layouts
    • Form Helpers and Showing Errors
    • Displaying Links for Pagination
    • Date, Media, and Text Helpers
    • Creating Custom View Helpers
    • Localization
  • Database Interaction Through Models
    • 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
    • Database Migrations
      • Migrations in Production
    • Using Multiple Data Sources
  • Plugins
    • Installing and Using Plugins
    • Developing Plugins
    • Publishing Plugins
  • Project Documentation
    • Overview
  • External Links
    • Source Code
    • Issue Tracker
    • Sponsor Us
    • Community
Powered by GitBook
LogoLogo
On this page
  • Synopsis
  • Description
  • Options
  • Examples
  • Stop active deployment
  • Emergency stop
  • Graceful shutdown
  • Stop specific service
  • Stop all services
  • Stop Types
  • Graceful stop
  • Force stop
  • Partial stop
  • Use Cases
  • Maintenance window
  • Emergency response
  • Rolling stop
  • Scheduled stop
  • Stop Process Details
  • Pre-stop actions
  • Stop sequence
  • Post-stop actions
  • Service-Specific Stops
  • Web servers
  • Database
  • Cache services
  • Queue workers
  • Best Practices
  • Error Handling
  • Stop failures
  • Hung processes
  • Rollback after stop
  • Integration
  • Monitoring integration
  • Load balancer integration
  • Recovery
  • Restart after stop
  • Verify recovery
  • See Also

Was this helpful?

Edit on GitHub
Export as PDF
  1. Command Line Tools
  2. Command Reference
  3. Deployment Commands

wheels deploy stop

Stop an active deployment or deployment services.

Synopsis

wheels deploy stop [options]

Description

The wheels deploy stop command halts active deployments, stops deployment services, or shuts down deployed applications. It provides controlled shutdown capabilities for maintenance, emergency stops, or cleanup operations.

Options

  • --deployment-id, -d - Specific deployment to stop

  • --environment, -e - Target environment (default: production)

  • --force - Force stop without graceful shutdown

  • --timeout - Graceful shutdown timeout in seconds (default: 300)

  • --service - Stop specific service only

  • --all - Stop all deployments and services

  • --reason - Reason for stopping (required for audit)

  • --notify - Send notifications about stop action

  • --backup - Create backup before stopping

Examples

Stop active deployment

wheels deploy stop --deployment-id dep-123456 --reason "User requested"

Emergency stop

wheels deploy stop --force --reason "Critical error detected"

Graceful shutdown

wheels deploy stop --timeout 600 --reason "Scheduled maintenance"

Stop specific service

wheels deploy stop --service web --environment staging

Stop all services

wheels deploy stop --all --environment development

Stop Types

Graceful stop

Default behavior that ensures clean shutdown:

wheels deploy stop --reason "Maintenance window"

Process:

  1. Stop accepting new requests

  2. Complete active requests

  3. Flush caches and buffers

  4. Close database connections

  5. Terminate processes

Force stop

Immediate termination for emergencies:

wheels deploy stop --force --reason "Security incident"

Process:

  1. Send SIGTERM to all processes

  2. Wait 10 seconds

  3. Send SIGKILL if needed

  4. Force close connections

Partial stop

Stop specific components:

# Stop web servers only
wheels deploy stop --service web

# Stop background workers
wheels deploy stop --service workers

# Stop specific instance
wheels deploy stop --instance i-1234567890

Use Cases

Maintenance window

# Stop for maintenance
wheels deploy stop \
  --environment production \
  --reason "Database maintenance" \
  --notify \
  --backup

# Perform maintenance...

# Restart services
wheels deploy exec

Emergency response

# Immediate stop for security issue
wheels deploy stop \
  --force \
  --all \
  --reason "Security breach detected" \
  --notify

Rolling stop

# Stop instances one by one
for instance in $(wheels deploy status --format json | jq -r '.instances[]'); do
  wheels deploy stop --instance $instance --timeout 300
  sleep 30
done

Scheduled stop

# Stop at specific time
echo "wheels deploy stop --reason 'Scheduled shutdown'" | at 02:00

Stop Process Details

Pre-stop actions

  1. Validate stop request

  2. Check for active operations

  3. Create backup if requested

  4. Send notifications

  5. Update deployment status

Stop sequence

  1. Mark deployment as stopping

  2. Stop load balancer traffic

  3. Drain active connections

  4. Stop application services

  5. Stop background jobs

  6. Release resources

  7. Update status to stopped

Post-stop actions

  1. Verify all services stopped

  2. Log stop completion

  3. Send completion notifications

  4. Update monitoring systems

  5. Release deployment locks

Service-Specific Stops

Web servers

wheels deploy stop --service web --drain-timeout 300
  • Stops accepting new connections

  • Completes active requests

  • Removes from load balancer

Database

wheels deploy stop --service database --backup
  • Creates final backup

  • Closes all connections

  • Flushes buffers

  • Stops database service

Cache services

wheels deploy stop --service cache --persist
  • Persists cache to disk

  • Stops cache service

  • Preserves cache data

Queue workers

wheels deploy stop --service workers --complete-jobs
  • Stops accepting new jobs

  • Completes current jobs

  • Gracefully shuts down

Best Practices

  1. Always provide reasons: Document why services were stopped

  2. Use graceful stops: Allow services to shut down cleanly

  3. Create backups: Backup before stopping production services

  4. Notify stakeholders: Inform team about stop actions

  5. Monitor stop process: Ensure services stop correctly

  6. Plan restarts: Have restart procedures ready

  7. Test stop procedures: Practice emergency stops

Error Handling

Stop failures

# If graceful stop fails, force stop
wheels deploy stop --reason "Maintenance"
if [ $? -ne 0 ]; then
  wheels deploy stop --force --reason "Graceful stop failed"
fi

Hung processes

# Check for processes that won't stop
wheels deploy status --detailed

# Force stop specific process
wheels deploy stop --force --process-id 12345

Rollback after stop

# If stop causes issues, quickly restart
wheels deploy stop --reason "Configuration change"
# ... issues detected ...
wheels deploy exec --emergency

Integration

Stop operations integrate with:

  • Monitoring systems for stop alerts

  • Load balancers for traffic management

  • Backup systems for pre-stop backups

  • Notification systems for team alerts

Monitoring integration

# Stop with monitoring notification
wheels deploy stop \
  --reason "Planned maintenance" \
  --notify-monitoring \
  --expected-downtime 3600

Load balancer integration

# Remove from load balancer before stop
wheels deploy proxy route --backend app-01 --weight 0
sleep 300  # Allow connections to drain
wheels deploy stop --instance app-01

Recovery

Restart after stop

# Normal restart
wheels deploy exec

# Quick restart with previous config
wheels deploy exec --quick-start

# Restart specific services
wheels deploy start --service web

Verify recovery

# Check services are running
wheels deploy status --health

# Monitor logs
wheels deploy logs --tail --since "stop completed"

See Also

Previouswheels deploy statusNextCLI Development Guides

Last updated 2 days ago

Was this helpful?

- Start deployment

- Check deployment status

- Rollback deployment

deploy exec
deploy status
deploy rollback