dancerctl icon indicating copy to clipboard operation
dancerctl copied to clipboard

like apachectl for Dancer

=head1 dancerctl

dancerctl - Like apachectl for perl/Dancer apps. Small tool that can start/stop/restart Dancer apps.

=head3 Usage

dancerctl action [appname [environment]]

Where C can be

start, stop, restart status help init startall, stopall, restartall, statusall

C - usually 'development' or 'production' (by default). Default environment is used if no C specified.

Examples under not root user:

dancerctl start|stop|restart|status app [environment] dancerctl startall|stopall|restartall|status|statusall dancerctl help dancerctl init appname path [force]

Examples under root(!) user: [not implemented now]

dancerctl user [action [app [environment]]]

Not implemented now, but will be in future

dancerctl setup [not implemented] dancerctl update [not implemented] dancerctl list [not implemented]

=head3 dancerctl init

C will create config for app with default recommended values. Default config can be placed in Crecommended: section to F</etc/dancerctl.conf> otherwise the C<DATA> section of F script will be used.

dancerctl init appname path [force]

=over

* path counted from user dir: app -> /home/user/app
* when 'force' the config file will be overwritten if exists.

=back

Examples:

example 1:

  dancerctl init app path/to/app

example 2:

  cd path/to/app
  dancerctl init app `pwd`

example 3: config will be recreated

  cd path/to/app
  dancerctl init app `pwd` force

=head2 Configs (ORDER BY priority DESC)

~/.dancerctl/$appname [environment: section] ~/.dancerctl/$appname [root param] /etc/dancerctl.conf

Config format: YAML for the F<~/.dancerctl/$appname> and any ini-style (better YAML too) for the F</etc/dancerctl.conf>

=head3 Config example

See F<app.yml> which should be moved to F</home/user/.dancerctl/> and renamed to F.

=over

* NOTE! Names of parameters in config can be changed in next versions

=back

=head3 Global %ENV params

It is possible to use to global parameters in %ENV:

DANCERCTL_CONF - default config for dancerctl, instead of /etc/dancerctl.conf DANCERCTL_DEBUG - enable/disable debug mode, has more priority, then in dancerctl.conf

Examples: export DANCERCTL_CONF=/path/to/local/dancerctl.conf DANCERCTL_DEBUG=1 dancerctl statusall

=head2 Install

perl 5.10, LConfig::Auto and LYAML::Tiny are required.

curl -L http://cpanmin.us -k | perl - --self-upgrade cpanm Config::Auto YAML::Tiny

cd ~ mkdir dancerctl cd dancerctl git clone git://github.com/knutov/dancerctl.git ./ alias d='~/dancerctl/dancerctl' d help

C was tested under modern version of Ubuntu (11.04). Some parts (like 'status') may not work under different linuxes and OSes (note hardcoded slashes and format of C).

You can get 'dev' branch with latest changes with

git clone git://github.com/knutov/dancerctl.git ./ -b dev

=head2 Copyright

Copyright (c) 2011, Nick Knutov, [email protected], Lhttps://github.com/knutov/dancerctl

=head3 License

BSD 2-Clause License (Lhttp://en.wikipedia.org/wiki/BSD_licenses)

=cut