CLI Usage

After installation on deployer you will have an ability to run dep command from terminal.

To get list of all available task run dep. You can run it from any subdirectories of you project, deployer will automatically find project root dir.

Deployer

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display this help message
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -f, --file[=FILE]     Specify Deployer file
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  help         Displays help for a command
  init         Initialize deployer system in your project
  list         Lists commands
  run          Run any arbitrary command on hosts
  self-update  Updates deployer.phar to the latest version
  ssh          Connect to host through ssh

Best way to configure your deploy.php to automatically deploy to staging on this command:

dep deploy

So somebody can't accidentally deploy production (for production dep deploy production explicitly stage is required).

You get info about available options and usage use help command:

$ dep help deploy
Usage:
  deploy [options] [--] [<stage>]

Arguments:
  stage                      Stage or hostname

Options:
  -p, --parallel             Run tasks in parallel
  -l, --limit=LIMIT          How many host to run in parallel?
      --no-hooks             Run task without after/before hooks
      --log=LOG              Log to file
      --roles=ROLES          Roles to deploy
      --hosts=HOSTS          Host to deploy, comma separated, supports ranges [:]
  -o, --option=OPTION        Sets configuration option (multiple values allowed)
  -h, --help                 Display this help message
  -q, --quiet                Do not output any message
  -V, --version              Display this application version
      --ansi                 Force ANSI output
      --no-ansi              Disable ANSI output
  -n, --no-interaction       Do not ask any interactive question
  -f, --file[=FILE]          Specify Deployer file
      --tag[=TAG]            Tag to deploy
      --revision[=REVISION]  Revision to deploy
      --branch[=BRANCH]      Branch to deploy
  -v|vv|vvv, --verbose       Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:
  Deploy your project

Overriding configuration options

For example, if your deploy.php file contains this configuration:

set('ssh_multiplexing', false);

And you want to enable ssh multiplexing without modifying file, you can pass -o option to dep command:

dep deploy -o ssh_multiplexing=true

To override multiple config options, pass a few -o args:

dep deploy -o ssh_multiplexing=true -o branch=master

Running arbitrary commands

Deployer comes with command to run any valid command of you server without modifying deploy.php

dep run 'ls -la'

To specify hosts this command have corresponding options:

  --stage=STAGE    Stage to deploy
  --roles=ROLES    Roles to deploy
  --hosts=HOSTS    Host to deploy, comma separated, supports ranges [:]

Getting help

You can get more info about any commands by help command:

dep help [command]

Autocomplete

Deployer comes with autocomplete script for bash/zsh/fish, so you don't need to remember all tasks and options. To install run following command:

dep autocomplete

And follow instructions.