NAME

Canella - Simple Deploy Tool A La Cinnamon

SYNOPSIS

use Canella::DSL;

role "production" => (
    hosts => [ qw(host1 host2) ],
);

task "setup:perl" => sub {
    my $host = shift;
    remote {
        on_finish { run "rm", "-rf", "xbuild" };
        run "git", "clone", "git://github.com/tagomoris/xbuild.git";
        sudo {
            run "xbuild/perl-install", "5.16.3", "/opt/local/perl-5.16";
        };
    } $host;
};

task "setup:apache" => sub {
    my $host = shift;
    remote {
        sudo {
            run "yum", "install", "apache2";
        }
    } $host;
};

task 'setup:all' => sub {
    call 'setup:perl', 'setup:apache';
};

task syncfiles => sub {
    my $host = shift;
    remote {
        my $dir = get "deploy_to";
        run "cd $dir && git pull";
    } $host;
};

task "restart:app" => sub {
    my $host = shift;
    remote {
        sudo {
            run "svc -h /service/myapp";
        }
    } $host;
};
task "restart:apache" => sub {
    my $host = shift;
    remote {
        sudo {
            run "apachectl restart";
        }
    } $host;
};

task deploy => sub {
    call 'syncfiles', 'restart:app', 'restart:apache';
};

INVOCATION

Based on the config file shown in SYNOPSIS, you can invoke commands like so:

# Run perl setup on production servers
canella --config=/path/to/config.pl production setup:perl

# Run apache setup AND perl setup on production servers
canella --config=/path/to/config.pl production setup:apache setup:perl

# Or, use the shortcut we defined: setup:all
canella --config=/path/to/config.pl production setup:all

# Run deploy (sync files) on production servers
canella --config=/path/to/config.pl production syncfiles

# Restart apps (controlled via daemontools)
canella --config=/path/to/config.pl production restart:app

DESCRIPTION

WARNING: ALPHA QUALITY CODE!

Canella is yet another deploy tool, based on Cinnamon

DIFFERENCES WITH Cinnamon 0.22

SEE ALSO

Cinnamon

LICENSE

Copyright (C) Daisuke Maki.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

Daisuke Maki daisuke@endeworks.jp