A configurable deploy script


Deployer is a tool that helps to deploy projects of any type to a server with minimal requirements.

Requirements :

The library is a work in progress and could do a lot more things but for the moment it does what I need it to.


Deploying is as simple as :

vendor/bin/deployer server:deploy production

Two commands are available


You can install the library through composer. All you need is to add it as dependency to your composer.json.

    "require-dev": {
        "onigoetz/deployer": "1.0.0-beta1"


There are two ways to configure the deployer, in both cases, the idea is that an array holds the complete configuration, it's easier to maintain an use than a lot of different configuration classes.

The syntax is explained here

In Laravel 4

Add the following lines to your application in config/local/app.php

    'providers' => append_config(

With that part configured you can run ./artisan config:publish onigoetz/deployer

this will copy the default configurations to config/packages/onigoetz/deployer You can find the details of each file in the Configuration section

Then you can run ./artisan server:deploy production to deploy

Standalone launcher

This time the configuration is made in a folder called .deployer

to do this, add deployer to your composer dependencies and do

cp vendor/onigoetz/deployer/src/config .deployer

You can now configure your infrastructure.

Then you can run vendor/bin/deployer server:deploy production to deploy

Configuration Options

The configuration is separated in a few files, each file has a specific purpose


This is an array of sources, the key is the name of the source and has the following options:

Global Options

- strategy
- clone will clone a git repository - upload will duplicate the current repository, zip and upload it.

- path
Where to take the release from

For the upload strategy, specify an absolute path on your machine

For the clone strategy you have two options.

  1. Fill the full path to the repository (like
  2. Provide an array with repository, username and password (the password is optional as it can be requested at runtime)

Clone Specific options

- type
Only git is available at the moment

- branch
master by default

- submodules
true or false if you want to include submodules or not

Upload specific options

- include
an array of paths to include in the build

- exclude
an array of paths to exclude from the build



return array(
    'source_name' => array(
        'strategy' => 'clone',

        'path' => '',
        'type' => 'git',


This is an array of servers, the key is the name of the server and has the following options:

- host
The hostname or IP address

- username
The SSH username to deploy

- password
The SSH password to deploy (optional as it can be requested at runtime)


This file contains the directories where the files will be put.

the structure is as follows :


- root
The main folder

- binaries
The binaries folder, contains all snapshots, current and old ones (binaries by default)

- binary_name
The folder name that will contain the binaries (%G-%m-%d_%H-%M by default) Uses strftime :

- deploy
Symlink to the current version (www by default)




This is an array of environments, the key is the name of the environment and has the following options:

- source
The source name, defined in sources.php

- servers
an array of servers, defined in servers.php

- overrides
an array of overrides, with this you can override : - source - directories

with the same syntax and options as in the corresponding files