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
  • Arguments
  • Options
  • Examples
  • Deploy to production
  • Deploy specific tag
  • Deploy with dry run
  • Force deployment
  • Deploy without hooks
  • Verbose deployment
  • Deployment Process
  • Output Example
  • Deployment Strategies
  • Rolling Deployment
  • Blue-Green Deployment
  • Canary Deployment
  • Hook Execution
  • Pre-deployment Hooks
  • Post-deployment Hooks
  • Rollback Handling
  • Environment Variables
  • Dry Run Mode
  • Error Handling
  • Performance Optimization
  • Monitoring
  • Use Cases
  • Notes
  • See Also

Was this helpful?

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

wheels deploy exec

Execute a deployment to the specified target environment.

Synopsis

wheels deploy exec [target] [options]

Description

The wheels deploy exec command performs the actual deployment of your Wheels application to a configured target environment. It handles file synchronization, runs deployment hooks, and manages the deployment lifecycle.

Arguments

Argument
Description
Default

target

Deployment target (production, staging, etc.)

Required

Options

Option
Description
Default

--tag

Git tag or commit to deploy

Latest commit

--branch

Git branch to deploy

Configured branch

--force

Force deployment even with uncommitted changes

false

--skip-hooks

Skip pre/post deployment hooks

false

--skip-tests

Skip test execution

false

--skip-assets

Skip asset compilation

false

--dry-run

Preview deployment without executing

false

--verbose

Show detailed output

false

--timeout

Deployment timeout in seconds

300

--help

Show help information

Examples

Deploy to production

wheels deploy exec production

Deploy specific tag

wheels deploy exec production --tag=v1.2.3

Deploy with dry run

wheels deploy exec staging --dry-run

Force deployment

wheels deploy exec production --force

Deploy without hooks

wheels deploy exec staging --skip-hooks

Verbose deployment

wheels deploy exec production --verbose

Deployment Process

  1. Pre-flight Checks:

    • Verify target configuration

    • Check Git status

    • Validate dependencies

    • Test connectivity

  2. Preparation:

    • Create release directory

    • Export code from repository

    • Install dependencies

    • Compile assets

  3. Synchronization:

    • Upload files to target

    • Exclude ignored files

    • Preserve shared resources

  4. Activation:

    • Update symbolic links

    • Run database migrations

    • Clear caches

    • Reload application

  5. Cleanup:

    • Remove old releases

    • Clean temporary files

    • Update deployment log

Output Example

Deploying to production...
✓ Pre-flight checks passed
✓ Creating release 20240115120000
✓ Exporting code from main branch
✓ Installing dependencies
✓ Compiling assets
✓ Uploading files to prod.example.com
  → Transferred 1,234 files (45.6 MB)
✓ Running pre-deployment hooks
  → npm run build
  → box install --production
✓ Activating release
✓ Running post-deployment hooks
  → wheels dbmigrate latest
  → wheels reload production
✓ Cleaning up old releases
✓ Deployment completed successfully!

Deployment Summary:
- Target: production
- Release: 20240115120000
- Duration: 2m 34s
- Status: SUCCESS

Deployment Strategies

Rolling Deployment

wheels deploy exec production
  • Gradual rollout

  • Zero downtime

  • Automatic rollback on failure

Blue-Green Deployment

wheels deploy exec production --strategy=blue-green
  • Instant switching

  • Full rollback capability

  • Requires double resources

Canary Deployment

wheels deploy exec production --strategy=canary --percentage=10
  • Gradual traffic shift

  • Risk mitigation

  • Performance monitoring

Hook Execution

Pre-deployment Hooks

Executed before deployment:

"pre-deploy": [
  "npm test",
  "npm run build",
  "box install --production"
]

Post-deployment Hooks

Executed after activation:

"post-deploy": [
  "wheels dbmigrate latest",
  "wheels reload production",
  "npm run cache:clear",
  "curl -X POST https://api.example.com/deploy-notification"
]

Rollback Handling

If deployment fails:

  1. Automatic rollback triggered

  2. Previous release restored

  3. Rollback hooks executed

  4. Notifications sent

Manual rollback:

wheels deploy rollback production

Environment Variables

Available during deployment:

Variable
Description

WHEELS_DEPLOY_TARGET

Target environment name

WHEELS_DEPLOY_RELEASE

Release timestamp

WHEELS_DEPLOY_BRANCH

Git branch

WHEELS_DEPLOY_TAG

Git tag (if specified)

WHEELS_DEPLOY_USER

User executing deployment

Dry Run Mode

Preview deployment without changes:

wheels deploy exec production --dry-run

Shows:

  • Files to be transferred

  • Hooks to be executed

  • Resources to be created

  • Estimated deployment time

Error Handling

Common errors and solutions:

  1. Connection Failed

    • Check SSH keys/credentials

    • Verify network connectivity

    • Confirm server accessibility

  2. Permission Denied

    • Check user permissions

    • Verify directory ownership

    • Review deployment path

  3. Hook Failed

    • Check hook commands

    • Verify dependencies

    • Review error logs

  4. Disk Space

    • Check available space

    • Clean old releases

    • Review keep-releases setting

Performance Optimization

  • Use --skip-assets if assets pre-built

  • Enable compression for transfers

  • Parallelize hook execution

  • Use incremental deployments

Monitoring

Track deployment metrics:

  • Deployment duration

  • Transfer size

  • Success/failure rate

  • Rollback frequency

Use Cases

  1. Automated Deployment: CI/CD pipeline integration

  2. Scheduled Releases: Deploy during maintenance windows

  3. Emergency Hotfix: Quick production patches

  4. Feature Deployment: Deploy specific features

  5. A/B Testing: Deploy variants for testing

Notes

  • Always test in staging first

  • Monitor application after deployment

  • Keep deployment logs for auditing

  • Have rollback plan ready

  • Coordinate with team for production deployments

See Also

Previouswheels deploy auditNextwheels deploy hooks

Last updated 2 days ago

Was this helpful?

- Deployment overview

- Check deployment status

- Rollback deployment

- View deployment logs

wheels deploy
wheels deploy status
wheels deploy rollback
wheels deploy logs