2017 © Pedro Peláez
 

symfony-bundle plum-bundle

A Symfony2 deploy bundle.

image

madalynn/plum-bundle

A Symfony2 deploy bundle.

  • Tuesday, April 10, 2012
  • by Aerialls
  • Repository
  • 3 Watchers
  • 27 Stars
  • 7,449 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 3 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

MadalynPlumBundle

The PlumBundle is a deploy bundle using several deployers., (*1)

Installation and configuration

If you use a deps file just add:, (*2)

[plum]
    git=https://github.com/aerialls/Plum.git

[MadalynnPlumBundle]
    git=https://github.com/aerialls/MadalynnPlumBundle.git
    target=bundles/Madalynn/Bundle/PlumBundle

Or by using Git:, (*3)

git clone https://github.com/aerialls/MadalynnPlumBundle.git vendor/bundles/Madalynn/Bundle/PlumBundle
git clone https://github.com/aerialls/Plum.git vendor/plum

Or by Composer, (*4)

"require": {
    "madalynn/plum-bundle": "dev-master"
},

You need to add to your autoload.php: (not necessary if you're using Composer), (*5)

// app/autoload.php
$loader->registerNamespaces(array(
    // ...
    'Madalynn' => __DIR__.'/../vendor/bundles',
    'Plum'     => __DIR__.'/../vendor/plum/src'
));

And add the MadalynnPlumBundle to your Kernel for the dev/test environment only., (*6)

// app/AppKernel.php
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
    // ...
    $bundles[] = new Madalynn\Bundle\PlumBundle\MadalynnPlumBundle();
}

Deployers

By default, Plum provides 2 providers : Plum\Deployer\RsyncDeployer and Plum\Deployer\SshDeployer. Here are the options for each :, (*7)

  • Plum\Deployer\RsyncDeployer
    • dry_run
    • rsync_exclude
  • Plum\Deployer\SshDeployer
    • dry_run
    • commands

You can add your own deployer by using the Plum\Deployer\DeployerInterface interface., (*8)

Configuration example

# app/config/config_dev.yml
madalynn_plum:
    options: # Global options
        dry_run: false
        rsync_exclude: "%kernel.root_dir%/config/rsync_exclude.txt"
        commands:
            - 'php app/console cache:clear --env=prod --no-debug'
    deployers:
        - Plum\Deployer\RsyncDeployer
        - Plum\Deployer\SshDeployer
        - Acme\Deployer\MyCustomDeployer
    servers_file: "%kernel.root_dir%/config/deployment.yml"

The aim here is to seperate the servers configration from the rest. It is then possible to add the deployment.yml to the exclude file., (*9)

# app/config/deployment.yml
servers:
    production:
        host: prod.mywebsite.com
        user: webuser
        dir: /var/www/mywebsite
        port: 2321 # Optional, default 22
        password: myPaSsWoRd # Just for the SSH deployer
        options: # Server options, override the globals
            dry_run: %kernel.debug%
    dev:
        host: dev.mywebsite.com
        user: webuser
        dir: /var/www/mywebsite2

Start a deploy

php app/console plum:deploy production --no-debug

You can specify a custom deployer via an extra parameter, (*10)

php app/console plum:deploy production rsync,ssh

The Versions

10/04 2012

dev-master

9999999-dev

A Symfony2 deploy bundle.

  Sources   Download

MIT

The Requires

 

ssh deploy rsync