Canolla::DSL - DSL For Canolla File
use Canolla::DSL;
Executes the given task name
Returns the current task object.
Returns the current remote object, if available
Return the variable of the parameter pointed by $name. Parameters can be set by calling set(), or by specifying them from the canella command line.
set()
Executes the given \&code at the end of the task.
\&code
TODO: Currently this does not run the commands remotely even when you set on_finish() inside remote().
TODO: Order of execution is not guaranteed. Need to either fix it or document it
role 'www' => ( hosts => [ qw(host1 host2 host3) ] ); role 'www' => ( hosts => sub { ... dynamically load hosts }, ); role 'www' => ( hosts => ..., params => { ... local parameters ... } );
Specifies that within the given block \&code, run() commands are run on the host specified by $host
run()
$host
Executes @cmd. If called inside a remote() block, the command will be executed on the remote host. Otherwise it will be executed locally
@cmd
remote()
Executes @cmd, but always do so on the local machine, regardless of context.
Calls Net::OpenSSH::scp_get on the currently connected host. Must be called inside a remote() block
Calls Net::OpenSSH::scp_put on the currently connected host. Must be called inside a remote() block
Sets the parameter $name to point to $value
$name
$value
All run() requests will be executed with a "sudo" appended.
remote { sudo { run "ls" }; } $host;
is equivalent to ssh $host 'sudo ls'
Register a document (POD) section for this deploy file, which will be displayed in 'help' mode.
Section name "SYNOPSIS" is treated differently: it is displayed at the top. All other sections are appended later in the displayed message.
Declare a new task. There's no notion of hierarchical tasks, but you can always declare them by hand:
task "setup:perl" => sub { ... }; task "setup:nginx" => sub { ... };
In the second form, you can pass more parameters to the task:
Required. The task code.
Optional parameter to set description/documentation for this task, which will be used for help and dump modes
1 POD Error
The following errors were encountered while parsing the POD:
=over without closing =back
To install Canella, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Canella
CPAN shell
perl -MCPAN -e shell install Canella
For more information on module installation, please visit the detailed CPAN module installation guide.