Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Manage Website deployments (for PHP, Perl, Tomcat, ...)
Perl

Merge pull request #7 from dsteinbrunner/patch-1

Hi,

thanks for the patch.
latest commit de1648e54f
@krimdomu krimdomu authored
Failed to load latest commit information.
debian updated buildfiles
doc updated buildfiles
lib/Rex/Apache
t cleanup
.gitignore updated ignore files
ChangeLog abort inject operation with die() if re-pack fails
LICENSE updated license to GPLv3, added LICENSE file and updated manifest
MANIFEST cleanup
MANIFEST.SKIP updated ignore files
Makefile.PL correct Makefile NAME
README.pod updated README

README.pod

rex-apache-deploy is a (R)?ex module to deploy webservers.

You can find (R)?ex under http://rexify.org/

Usage

In your Rexfile use the following commands.

To build a package

 use Rex::Apache::Build;
     
 get_version_from "lib/MyApp.pm", qr{\$VERSION=([^;]+);};
    
 task "build", sub {
    yui compress => glob("public/js/*.js"), glob("public/css/*.css");
        
    # build a package named like the directory
    # and append the version from get_version_from
    build;
          
    # build a package named myapp
    # and append the version from get_version_from
    build "myapp";
         
    # build a package named myapp and append the version 1.5
    build "myapp",
       version => "1.5";
        
    # build a package myapp, with version 1.5 and exclude some files
    # but use the path "./myapp" as package root
    build "myapp",
       version => "1.5",
       path    => "myapp",
       exclude => ["yuicompressor.jar", "README"];
 };

To inject special configuration parameters for different environments

 use Rex::Apache::Inject YAML;

 template_file "inject.conf";
 template_search_for "application.yml";

 desc "Inject Configuration";
 task "inject", sub {

   inject "myapp-1.0.tar.gz",
               pre_pack_hook => sub {
                  run "BUNDLE_PATH=vendor/bundle bundle install";
               },
               post_pack_hool => sub {
                  say "Hello, i'm the post pack hook\n";
               };

 };

Deploy the package

 deploy_to "/path/to/deploy/to";
 document_root "/var/www/html";

 # set this if your package format isn't
 # packagename-version.file-suffix
 # example: myapp-1.2.tar.gz
 #          myapp-1.3.1.zip
 #          myapp-1.3~1.tar.bz2
 #          myapp-1.5.2_1.tar.bz2
 generate_deploy_directory sub {
    return $VERSION;
 };

 desc "Deploy Package";
 task "deploy", group => "fe", sub {
    # just deploy
    deploy;
         
    # or to deploy a specific package
    deploy "myapp-1.0.tar.gz";
 };
Something went wrong with that request. Please try again.