App-Padadoy
view release on metacpan or search on metacpan
lib/App/Padadoy.pm view on Meta::CPAN
deplist cartontest remote version update enable logs);
our @remote_commands = qw(init start stop restart config status version); # TODO: create deplist checkout cartontest
our @configs = qw(user base repository port pidfile quiet remote);
# _msg( $fh, [\$caller], $msg [@args] )
sub _msg (@) {
my $fh = shift;
my $caller = ref($_[0]) ? ${(shift)} :
((caller(2))[3] =~ /^App::Padadoy::(.+)/ ? $1 : '');
my $text = shift;
say $fh (($caller ? "[$caller] " : "")
. (@_ ? sprintf($text, @_) : $text));
}
sub fail (@) {
_msg(*STDERR, @_);
exit 1;
}
sub msg {
my $self = shift;
lib/App/Padadoy.pm view on Meta::CPAN
$self->msg("app -> current/app");
symlink 'current/app','app';
$self->msg("Pushing to git repository %s@%s:%s will update",
$self->{user}, hostname, $self->{repository});
}
sub config {
say shift->_config;
}
sub _config {
my $self = shift;
Dump( { map { $_ => $self->{$_} // '' } @configs } );
}
sub restart {
my $self = shift;
lib/App/Padadoy.pm view on Meta::CPAN
sub logs {
my $self = shift;
my $logs = catdir($self->{base},'logs');
run('tail','-F', map { catfile($logs,$_) } qw(error.log access.log));
}
sub version {
say 'This is padadoy version '.($App::Padadoy::VERSION || '??');
exit;
}
1;
__END__
=pod
=head1 NAME
( run in 1.329 second using v1.01-cache-2.11-cpan-96521ef73a4 )