wheels deploy setup

Setup and configure deployment environment for your Wheels application.

Synopsis

wheels deploy setup [environment] [options]

Description

The wheels deploy setup command initializes and configures deployment environments for your Wheels application. It sets up necessary infrastructure, configurations, and dependencies required for successful deployments.

Options

  • --provider - Deployment provider (aws, azure, gcp, docker, traditional)

  • --region - Cloud region for deployment

  • --instance-type - Server instance type/size

  • --database - Database configuration (type, size, replicas)

  • --ssl - Enable SSL/TLS configuration

  • --domain - Domain name for the application

  • --monitoring - Enable monitoring and alerting

  • --backup - Configure automated backups

  • --scaling - Auto-scaling configuration

  • --dry-run - Preview setup without making changes

Examples

Basic setup

wheels deploy setup production

AWS setup with options

wheels deploy setup production \
  --provider aws \
  --region us-east-1 \
  --instance-type t3.medium \
  --ssl --monitoring

Docker setup

wheels deploy setup staging \
  --provider docker \
  --ssl --domain staging.example.com

Preview setup

wheels deploy setup production --dry-run

Setup Process

The setup command performs the following steps:

  1. Environment validation: Checks prerequisites and permissions

  2. Infrastructure provisioning: Creates servers, networks, storage

  3. Security configuration: Sets up firewalls, SSL, access controls

  4. Application setup: Installs dependencies, configures services

  5. Database setup: Creates and configures database

  6. Monitoring setup: Configures logging and monitoring

  7. Backup configuration: Sets up automated backups

  8. Validation: Runs health checks on setup

Provider-Specific Setup

AWS Setup

wheels deploy setup production \
  --provider aws \
  --region us-west-2 \
  --instance-type t3.large \
  --database "rds:postgres:db.t3.small" \
  --ssl --monitoring

Creates:

  • EC2 instances

  • RDS database

  • Load balancer

  • Security groups

  • S3 buckets

  • CloudWatch monitoring

Docker Setup

wheels deploy setup production \
  --provider docker \
  --registry docker.io/myapp \
  --compose-file docker-compose.prod.yml

Creates:

  • Docker containers

  • Networks

  • Volumes

  • Container registry

  • Orchestration setup

Traditional Server Setup

wheels deploy setup production \
  --provider traditional \
  --server prod-server-01.example.com \
  --ssh-key ~/.ssh/id_rsa

Configures:

  • Web server (Apache/Nginx)

  • Application server

  • Database connections

  • File permissions

  • Service management

Configuration Files

Environment configuration

The setup creates environment-specific configuration:

# Generated: config/environments/production.yml
environment:
  name: production
  provider: aws
  region: us-east-1
  instances:
    web:
      type: t3.medium
      count: 2
      auto_scaling: true
  database:
    type: postgres
    instance: db.t3.small
    backup: daily
  ssl:
    enabled: true
    certificate: auto
  monitoring:
    enabled: true
    alerts: true

Database configuration

# Generated: config/database.production.yml
database:
  adapter: postgresql
  host: prod-db.region.rds.amazonaws.com
  port: 5432
  database: myapp_production
  pool: 25
  replica:
    host: prod-db-read.region.rds.amazonaws.com

Use Cases

Multi-environment setup

# Setup all environments
for env in development staging production; do
  wheels deploy setup $env --provider docker
done

High-availability setup

wheels deploy setup production \
  --provider aws \
  --instance-type t3.large \
  --scaling "min:2,max:10,target-cpu:70" \
  --database "rds:postgres:db.t3.large:multi-az" \
  --monitoring --backup

Development environment

wheels deploy setup development \
  --provider docker \
  --minimal \
  --skip-monitoring \
  --skip-backup

Post-Setup Tasks

After setup completes, you should:

  1. Verify configuration

    wheels deploy status --environment production
  2. Test deployment

    wheels deploy push --dry-run
  3. Configure secrets

    wheels deploy secrets set DATABASE_PASSWORD=your-secure-password
  4. Run initial deployment

    wheels deploy exec

Security Considerations

The setup command implements security best practices:

  • Encrypted connections (SSL/TLS)

  • Firewall rules (minimal exposed ports)

  • Access control (IAM/RBAC)

  • Secrets management

  • Network isolation

  • Regular security updates

Monitoring Setup

Monitoring configuration includes:

  • Application metrics

  • Server metrics

  • Database metrics

  • Error tracking

  • Performance monitoring

  • Alerting rules

  • Log aggregation

Best Practices

  1. Use version control: Commit generated configuration files

  2. Test in staging: Always setup staging before production

  3. Document customizations: Keep notes on manual changes

  4. Regular updates: Keep infrastructure updated

  5. Monitor costs: Track cloud spending

  6. Backup configuration: Store setup configuration securely

  7. Automate setup: Use infrastructure as code

Troubleshooting

Setup failures

# Check detailed logs
wheels deploy setup production --verbose

# Retry with specific step
wheels deploy setup production --step database

Permission issues

# Verify credentials
wheels deploy setup production --validate-credentials

# Use specific profile
wheels deploy setup production --aws-profile prod-deploy

Network issues

# Test connectivity
wheels deploy setup production --test-connectivity

# Use specific VPC
wheels deploy setup production --vpc vpc-12345

See Also

Last updated

Was this helpful?