Loading...

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 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

Ask or search...
Ctrl K
Loading...

deploy push (Coming Soon)

This command may not work as expected. A complete and stable version is coming soon.

Deploy your Wheels application to configured servers.

Synopsis

wheels deploy:push [options]

Description

The wheels deploy:push command builds and deploys your Wheels application to configured servers using Docker. It handles Docker image building, pushing to registry, and deploying to target servers with optional rolling deployments for zero-downtime updates.

Options

  • tag=<string> - Docker image tag (defaults to timestamp format: yyyymmddHHmmss)
  • --build - Build Docker image locally (default: true, use --no-build to skip)
  • --push - Push image to registry (default: true, use --no-push to skip)
  • --rolling - Use rolling deployment for zero-downtime updates (default: true, use --no-rolling to disable)
  • servers=<string> - Deploy to specific servers (comma-separated list)
  • destination=<string> - Deployment destination/environment
  • timeout=<number> - Deployment timeout in seconds (default: 600)
  • health-timeout=<number> - Health check timeout in seconds (default: 300)

Examples

Basic deployment

wheels deploy:push

Deploy with specific tag

wheels deploy:push tag=v1.0.0

Skip building and just deploy existing image

wheels deploy:push tag=v1.0.0 --no-build

Deploy to specific servers

wheels deploy:push servers=web1.example.com,web2.example.com

Deploy without rolling updates (with downtime)

wheels deploy:push --no-rolling

Deploy with custom timeouts

wheels deploy:push timeout=900 health-timeout=600

Deployment Process

The deployment follows these steps:

  1. Lock Acquisition: Acquire deployment lock to prevent concurrent deployments
  2. Pre-connect Hook: Execute pre-connect lifecycle hook
  3. Tag Generation: Generate timestamp-based tag if not provided
  4. Pre-build Hook: Execute pre-build lifecycle hook
  5. Docker Build: Build Docker image (if --build is enabled)
  6. Registry Push: Push image to configured registry (if --push is enabled)
  7. Pre-deploy Hook: Execute pre-deploy lifecycle hook
  8. Server Deployment: Deploy to each target server
    • Copy environment configuration
    • Generate docker-compose.yml
    • Pull new image
    • Perform rolling deployment or restart
    • Clean up old images
  9. Post-deploy Hook: Execute post-deploy lifecycle hook
  10. Lock Release: Release deployment lock

Rolling Deployment

When --rolling is enabled (default), the deployment:

  • Scales up the service to run old and new containers simultaneously
  • Waits for health checks to pass on new containers
  • Removes old containers only after successful health checks
  • Rolls back automatically if health checks fail

Health Checks

The deployment uses health checks defined in your deploy.yml configuration:

healthcheck:
  path: /health
  port: 3000
  interval: 30
  timeout: 10
  retries: 3

Deployment Hooks

Lifecycle hooks are executed at various stages:

  • pre-connect: Before connecting to servers
  • pre-build: Before building Docker image
  • pre-deploy: Before deploying to servers
  • post-deploy: After successful deployment

Configuration

The deployment uses configuration from config/deploy.yml:

service: myapp
image: myapp

registry:
  server: registry.example.com
  username: myuser

servers:
  web:
    - web1.example.com
    - web2.example.com

ssh:
  user: deploy

env:
  clear:
    WHEELS_ENV: production
    PORT: 3000

healthcheck:
  path: /health
  port: 3000
  interval: 30

traefik:
  enabled: true
  labels:
    traefik.http.routers.myapp.rule: Host(`myapp.example.com`)

Environment Variables

Environment variables are loaded from .env.deploy file and copied to target servers.

Docker Compose Generation

The command generates a docker-compose.yml file on target servers with:

  • Service configuration
  • Environment variables
  • Port mappings
  • Volume mounts
  • Health checks
  • Traefik labels (if enabled)
  • Database services (if configured)

Use Cases

Production deployment with specific version

wheels deploy:push tag=v2.0.0

Deploy pre-built image from CI/CD

# Image already built and pushed by CI
wheels deploy:push tag=build-123 --no-build --no-push

Deploy to staging servers only

wheels deploy:push servers=staging1.example.com destination=staging

Emergency deployment without health checks

wheels deploy:push --no-rolling health-timeout=0

Best Practices

  1. Use semantic versioning: Tag releases with version numbers
  2. Test in staging first: Deploy to staging before production
  3. Monitor deployments: Check logs and health status
  4. Use rolling deployments: Minimize downtime with --rolling
  5. Configure health checks: Ensure proper health check endpoints
  6. Set appropriate timeouts: Adjust timeouts based on app startup time
  7. Use deployment locks: Prevent concurrent deployments

See Also