(e.g. chef, puppet, cfengine, ...)
(no manual steps, checklist, etc.)
(DB, caching, messaging, etc.)
(written in ruby; various ruby app stacks)
(virtualenv; pip; django apps)
(system perl and CPAN)
use ZZZ::Hello::World;
my $app = sub { ZZZ::Hello::World->run_psgi(@_) };
package ZZZ::Hello::World;
our $VERSION = "1.0";
use Plack::Request;
sub run_psgi {
my $self = shift;
my $req = Plack::Request->new(shift);
my $res = $req->new_response(200);
$res->content_type('text/html');
$res->body("Hello World (@{[scalar localtime]})");
return $res->finalize;
}
1;
use inc::Module::Install; name 'ZZZ-Hello-World'; version '1.0'; requires 'Plack'; requires 'Starman'; WriteAll;
$ carton install $ carton exec -Ilib -- starman -D -p 80 app.psgi
# get perl and carton ready
include_recipe 'perlbrew'
perl_ver = node['hello-world']['perl_version']
perl_carton = "#{perl_ver}@carton"
perlbrew_perl perl_ver
perlbrew_lib perl_carton
perlbrew_run "cpanm Carton" do
perlbrew perl_carton
end
# deploy the app from git package 'git' git "/opt/hello-world" do repository "git://github.com/dagolden/zzz-hello-world.git" reference node['hello-world']['deploy_tag'] end
# install deps and fire it up perlbrew_run "carton install" do cwd "/opt/hello-world" perlbrew perl_carton end perlbrew_run "carton exec -Ilib -- starman -D -p 80 app.psgi" do cwd "/opt/hello-world" perlbrew perl_carton end

$ mkdir my-pantry $ cd my-pantry $ git init $ pantry init (copy in perlbrew and hello-world cookbooks) $ git add . $ git commit -m "added cookbooks" $ pantry create node xdgvm.dyndns.org $ pantry edit node xdgvm.dyndns.org
{
"name" : "xdgvm.dyndns.org",
"run_list" : ["recipe[hello-world]"],
"hello-world": {
"perl_version": "perl-5.14.2",
"deploy_tag": "v1.0"
}
}
{
"name" : "xdgvm.dyndns.org",
"run_list" : ["recipe[perlbrew]", "recipe[hello-world]"],
"perlbrew" : {
"perls" : [ "perl-5.14.2", "perl-5.12.3", "perl-5.10.1" ],
"install_options" : "-D usethreads"
},
"hello-world": {
"perl_version": "perl-5.14.2",
"deploy_tag": "v1.0"
}
}
$ git add . $ git commit -m "configured xdgvm.dyndns.org" $ git tag release-1.0 -m "deploy hello-world 1.0"
$ pantry sync node xdgvm.dyndns.org
