Functions

Deployer provides a lot of helpful functions. Make sure to learn about them!

run(string $command)

Run command on remote server.

cd(string $path)

Sets the working path for the following run functions. Every task restores the working path to the base working path at the beginning of the task.

runLocally(string $command, int $timeout = 60)

Runs a command on your local machine. Default timeout: 60 seconds

upload(string $file, string $uploadFile)

Upload a file from your machine to your deployment machine You can use environment in both $file and $uploadFile - meaning you can type something like this

upload('.deploy/parameters.{{env}}.yml', '{{release_path}}/app/config/parameters.yml');

Which will be translated to something like this

upload('.deploy/parameters.dev.yml', '/var/www/release/current/app/config/parameters.yml');

download(string $localFile, string $deploymentFile)

Download a file from your deployment machine to your machine

write(string $message)

Write message in the console. You can format the message with the tags <info>...</info>, <comment></comment> or <error></error> (see Symfony Console).

writeln(string $message)

Same as the write function, but also writes a new line.

ask(string $message, mixed $default)

Ask the user for input. You need to specify a default value which will be used in quiet mode.

askConfirmation(string $message[, bool $default = false])

Ask the user a yes or no question.

askHiddenResponse(string $message)

Ask the user for a password.

output()

Get the current console output.