Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Deployer Bundle Laravel Package

bugbyte/deployer-bundle

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Steps

  1. Installation Add the package via Composer:

    composer require bugbyte/deployer-bundle:1.0.*
    

    Enable the bundle in app/AppKernel.php:

    $bundles[] = new Bugbyte\DeployerBundle\BugbyteDeployerBundle();
    
  2. Configuration Copy the default config.yml from vendor/bugbyte/deployer-bundle/Resources/config/config.yml to app/config/config.yml and customize it for your deployment targets (e.g., prod, staging).

  3. First Deployment Run the deploy command with a target:

    php app/console bb:deploy deploy prod
    

    For help, use:

    php app/console bb:deploy
    

Implementation Patterns

Core Workflows

  1. Deployment Automation Use the bb:deploy command to automate server-side deployments (e.g., Git pulls, symlink updates, cache clearing). Example workflow:

    # Deploy to production
    php app/console bb:deploy deploy prod
    
    # Rollback if needed
    php app/console bb:deploy rollback prod
    
  2. Environment-Specific Configs Define separate configs for prod, staging, etc., in config.yml:

    bugbyte_deployer:
        servers:
            prod:
                host: user@prod.example.com
                deploy_path: /var/www/prod
                repository: git@github.com:user/repo.git
            staging:
                host: user@staging.example.com
                deploy_path: /var/www/staging
    
  3. Integration with Symfony Tasks Chain deployments with other Symfony commands (e.g., database migrations):

    php app/console doctrine:migrations:migrate --env=prod
    php app/console bb:deploy deploy prod
    

Advanced Patterns

  • Custom Deployment Scripts Extend the bundle by overriding the Deployer class or adding custom tasks in config.yml:

    bugbyte_deployer:
        tasks:
            - 'deploy:prepare'
            - 'deploy:update_code'
            - 'custom:task'  # Your custom script
    
  • Zero-Downtime Deployments Use the shared and writable directories in config.yml to manage symlinks and avoid downtime:

    bugbyte_deployer:
        shared:
            - app/cache
            - app/logs
        writable:
            - app/config/parameters.yml
    

Gotchas and Tips

Pitfalls

  1. Symfony 2.1.x Dependency The bundle is only compatible with Symfony 2.1.x. Attempting to use it with newer versions (e.g., 3.x, 4.x) will fail. Verify your Symfony version first:

    php app/console --version
    
  2. SSH Key Configuration Ensure SSH keys are set up for passwordless authentication to your servers. Test connectivity manually:

    ssh user@prod.example.com
    
  3. Missing deploy.php The underlying bugbyte/deployer package expects a deploy.php file in your project root. If missing, create one with basic tasks or copy from the bundle’s resources.

  4. Permission Issues Deployments may fail if the Symfony user lacks permissions on the remote server. Use chmod or chown to fix:

    ssh user@prod.example.com "chmod -R 755 /var/www/prod"
    

Debugging Tips

  • Verbose Output Enable verbose mode for detailed logs:

    php app/console bb:deploy deploy prod -v
    
  • Dry Runs Test deployments without executing changes:

    php app/console bb:deploy --dry-run deploy prod
    
  • Custom Logging Redirect output to a file for debugging:

    php app/console bb:deploy deploy prod >> deploy.log 2>&1
    

Extension Points

  1. Override Default Tasks Extend the bundle by creating a custom command or service that integrates with Bugbyte\DeployerBundle\Command\DeployCommand.

  2. Add Pre/Post Hooks Use Symfony’s event system to trigger actions before/after deployment (e.g., send Slack notifications):

    # config.yml
    bugbyte_deployer:
        hooks:
            after_deploy: ['app:notify:slack']
    
  3. Custom Deployment Strategies Replace the default Deployer class by binding your own implementation in services.yml:

    services:
        bugbyte_deployer.deployer:
            class: AppBundle\Service\CustomDeployer
            arguments: [@bugbyte_deployer.deployer]
    
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope