Activator

 view release on metacpan or  search on metacpan

bin/activator.pl  view on Meta::CPAN

#!/usr/bin/perl

use strict;
use warnings;

use Activator::Registry;
use Activator::Config;
use Activator::Log qw( :levels );
use Exception::Class::TryCatch;
use Data::Dumper;
use Template;
use File::Find;

=head1 NAME

activator.pl - setup and manage services with an Activator project.

=head1 SYNOPSIS

activator.pl [OPTIONS] ACTION project-name

 Actions
  sync : sync user codebase to target install base

 Options:
  --restart : (re)start the webserver after performing <ACTION>
  --log_level : One of TRACE, DEBUG, INFO, WARN, ERROR, FATAL (see L<Activator::Log>)
  --sync_dir : ignore sync_dir setting from configuration, use this.

 Todo:
  --activator_codebase=<path> : use alternate Activator codebase (for Activator development)

See L<Activator::Tutorial> for a description of how to configure an Activator project.

=cut

# $config, $args, $project, $action and the current apache pid are globally interesting
my ( $config, $args, $project, $action, $httpd_pid );

try eval {
    # Act::Config requires that project be set via an option or be the
    # last arg, hence the flag after undef below
    $config = Activator::Config->get_config( \@ARGV, undef, 1 );
};

if ( catch my $e ) {
    die( "Error while processing command line options: $e" );
}

my $log_level = $config->{log_level} || 'WARN';
if ( $config->{v} || $config->{verbose} ) {
    Activator::Log->level( 'INFO' );
}

$action  = $ARGV[-2];
$project = $ARGV[-1];

if ( $action eq 'sync' ) {
    &sync( $project );
}
else {
    ERROR("'$action' action not supported");
    exit(1);
}

if ( $config->{restart} ) {
    &restart( $project );
}

sub sync {

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.162 second using v1.00-cache-2.02-grep-82fe00e-cpan-2c419f77a38b )