Canella
view release on metacpan or search on metacpan
lib/Canella/TaskRunner.pm view on Meta::CPAN
$ctx->parameters->set($param_key, $role->parameters->get($param_key));
}
my $block_ctx = guard {
my $params = $ctx->parameters;
foreach my $param_key (keys %tmp_key) {
debugf("Restoring paramter value for %s", $param_key);
$params->set($param_key, $tmp_key{$param_key});
}
};
my @coros;
foreach my $host (@$hosts) {
push @coros, async {
my ($ctx, $host, $tasks) = @_;
$ctx->stash(current_host => $host);
foreach my $task (@$tasks) {
$ctx->call_task($task);
}
} $ctx, $host, $tasks;
if (@coros >= $concurrency) {
$_->join for @coros;
@coros = ();
}
}
$_->join for @coros;
infof "All done!";
}
1;
script/canella view on Meta::CPAN
canella [-C num] [-s key=value ...] [ --mode=xxxx ] -c etc/deploy.pl role task [task ...]
=head1 OPTIONS
=head2 C< -c | --config > String
Specifies the configuration file. Required.
=head2 C< -C | --concurrency > Integer
Specifies the number of coroutine threads to run concurrently.
The default number for this option is 8
=head2 C< --mode> String
Changes the operation mode.
When "dump" mode is specified, dumps the tasks, roles, parameters, and config file name in JSON format.
When "help" mode is specified, shows some help message describing the specified deploy file
( run in 0.534 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )