Rex
view release on metacpan or search on metacpan
lib/Rex/Commands.pm view on Meta::CPAN
}
sub TRUE {
return 1;
}
sub FALSE {
return 0;
}
sub make(&) {
return $_[0];
}
1;
lib/Rex/Commands/Box.pm view on Meta::CPAN
user => "root",
password => "box",
);
$box->setup(qw/task_to_customize_box/);
};
=cut
sub box(&) {
my $code = shift;
#### too much black magic...
#my ($caller_box) = do {
# my $pkg = caller();
# no strict 'refs';
# \*{ $pkg . "::box" };
#};
my $self = Rex::Box->create;
lib/Rex/Test/Base.pm view on Meta::CPAN
The URL to a base image to be used for the test VM.
=cut
sub base_vm {
my ( $self, $vm ) = @_;
$self->{vm} = $vm;
}
sub test(&) {
my $code = shift;
my $test = __PACKAGE__->new;
$code->($test);
}
=head2 redirect_port($port)
Redirect local $port to the VM's SSH port (default: 2222).
=cut
lib/Rex/Transaction.pm view on Meta::CPAN
};
task 'all', group => 'frontend', sub {
transaction {
do_task [qw/deploy restart_server/];
};
};
=cut
sub transaction(&) {
my ($code) = @_;
my $ret = 1;
Rex::Logger::debug("Cleaning ROLLBACKS array");
@ROLLBACKS = ();
Rex::TaskList->create()->set_in_transaction(1);
eval { &$code(); };
lib/Rex/Transaction.pm view on Meta::CPAN
return $ret;
}
=head2 on_rollback($codeRef)
This will execute C<$codeRef> if a step in the L<transaction|https://metacpan.org/pod/Rex::Transaction#transaction> fails.
=cut
sub on_rollback(&) {
my ($code) = @_;
push(
@ROLLBACKS,
{
code => $code,
connection => Rex::get_current_connection()
}
);
}
( run in 1.010 second using v1.01-cache-2.11-cpan-49f99fa48dc )