BeSimpleDeploymentBundle is a project mainly written in PHP, it's free.
NOT MAINTAINED - A Symfony 2 bundle to ease deployment and shedule tasks within
Up to date thanks to jonaswouters
Get the sources via GIT
Use clone method if not using GIT for your project
git clone git://github.com/besimple/DeploymentBundle.git vendor/BeSimple/DeploymentBundle
Use submodule method if this is the case
git submodule add git://github.com/besimple/DeploymentBundle.git vendor/BeSimple/DeploymentBundle
Register bundle in AppKernel
class
// app/AppKernel.php
$bundles = array(
// ...
new BeSimple\DeploymentBundle\BeSimpleDeploymentBundle(),
// ...
);
Add besimple_deployment
entry to your config file
# app/config.yml
be_simple_deployment:
rsync: ~
ssh: ~
rules: ~
commands: ~
servers: ~
Add BeSimple
namespace to autoload
// app/autoload.php
$loader->registerNamespaces(array(
// ...
'BeSimple' => __DIR__.'/../vendor',
// ...
));
be_simple_deployment:
rsync:
delete: true
ssh:
pubkey_file: /home/me/.ssh/id_rsa.pub
privkey_file: /home/me/.ssh/id_rsa
passwphrase: secret
rules:
eclipse:
ignore: [.settings, .buildpath, .project]
git:
ignore: [.git, .git*, .svn]
symfony:
ignore: [/app/logs/*, /app/cache/*, /web/uploads/*, /web/*_dev.php]
commands:
cache_warmup:
type: symfony
command: cache:warmup
fix_perms:
type: shell
command: ./bin/fix_perms.sh
servers:
staging:
host: localhost
username: login
password: passwd
path: /path/to/project
rules: [eclipse, symfony]
commands: [cache_warmup, fix_perms]
production:
# ...
To be continued.
To be continued.
Rules can be declared as templates for reuse in your servers configuration. Some templates are already bundled by default. The following parameters can be used :
Here is the full list of parameters :
The simpliest way to deploy your application is to use the command line, go into your project root folder and type the following commands :
# Test your deployment :
./app/console deployment:test [server]
# Launch your deployment :
./app/console deployment:launch [server]
You can use the verbose option (-v
) to get all feedback from rsync and
remote ssh commands.
You can also use the deployment feature within your controller by invoking the 'deployment' service :
// Test your deployment :
$this->get('besimple_deployment')->test([$server]);
// Launch your deployment :
$this->get('besimple_deployment')->launch([$server]);
You can connect many events to know what's happening.
stdout
or stderr
line.stdout
or stderr
line.