NAME
Rex::Apache::Build - Build your WebApp Package
DESCRIPTION
With this module you can prepare your WebApp for deployment.
SYNOPSIS
yui_path "./yuicompressor-2.4.6.jar";
get_version_from "webapp/lib/MyApp.pm", qr{\$VERSION=([^;]+);};
get_version_from "webapp/index.php", qr{\$VERSION=([^;]+);};
task "build", sub {
yui compress => "file1.js", "file2.js", "file3.css";
yui compress => glob("public/javascript/*.js"), glob("public/css/*.css");
build;
build "webapp",
path => "webapp/",
version => "1.0";
};
EXPORTED FUNCTIONS
- yui_path($path_to_yui_compressor)
-
This function sets the path to the yui_compressor. If a relative path is given it will search from the path where the Rexfile is in.
- yui($action, @files)
-
Run a yui command.
task "build", sub { yui compress => "file1.js", "file2.js", ...; };
- build([$name, %options])
-
This function builds your package. Currently only tar.gz packages are supported.
# this will a package of the current directory named after the # directory of the Rexfile and append the version provided by # get_version_from() function # This function builds a tar.gz archive. task "build", sub { build; }; # this will build a package of the current directory named "my-web-app" and # append the version provided by get_version_from() function. task "build", sub { build "my-web-app"; }; # this function will build a package of the directory "html", name it # "my-web-app" and append the version "1.0" to it. task "build", sub { build "my-web-app", path => "html", version => "1.0", exclude => ["yuicompressor.jar", "foobar.html"]; };
- get_version_from($file, $regexp)
-
Get the version out of a file.