<html><head><title>Footprintless::Overlay</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" >
<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
BODY {
background: white;
color: black;
font-family: arial,sans-serif;
margin: 0;
padding: 1ex;
}
A:link, A:visited {
background: transparent;
color: #006699;
}
A[href="#POD_ERRORS"] {
background: transparent;
color: #FF0000;
}
DIV {
border-width: 0;
}
DT {
margin-top: 1em;
margin-left: 1em;
}
.pod { margin-right: 20ex; }
.pod PRE {
background: #eeeeee;
border: 1px solid #888888;
color: black;
padding: 1em;
white-space: pre;
}
.pod H1 {
background: transparent;
color: #006699;
font-size: large;
}
.pod H1 A { text-decoration: none; }
.pod H2 A { text-decoration: none; }
.pod H3 A { text-decoration: none; }
.pod H4 A { text-decoration: none; }
.pod H2 {
background: transparent;
color: #006699;
font-size: medium;
}
.pod H3 {
background: transparent;
color: #006699;
font-size: medium;
font-style: italic;
}
.pod H4 {
background: transparent;
color: #006699;
font-size: medium;
font-weight: normal;
}
.pod IMG {
vertical-align: top;
}
.pod .toc A {
text-decoration: none;
}
.pod .toc LI {
line-height: 1.2em;
list-style-type: none;
}
/*]]>*/-->
</style>
</head>
<body class='pod'>
<!--
generated by Pod::Simple::HTML v3.32,
using Pod::Simple::PullParser v3.32,
under Perl v5.025000 at Wed Aug 22 21:48:31 2018 GMT.
If you want to change this HTML document, you probably shouldn't do that
by changing it directly. Instead, see about changing the calling options
to Pod::Simple::HTML, and/or subclassing Pod::Simple::HTML,
then reconverting this document from the Pod source.
When in doubt, email the author of Pod::Simple::HTML for advice.
See 'perldoc Pod::Simple::HTML' for more info.
-->
<!-- start doc -->
<a name='___top' class='dummyTopAnchor' ></a>
<div class='indexgroup'>
<ul class='indexList indexList1'>
<li class='indexItem indexItem1'><a href='#NAME'>NAME</a>
<li class='indexItem indexItem1'><a href='#VERSION'>VERSION</a>
<li class='indexItem indexItem1'><a href='#SYNOPSIS'>SYNOPSIS</a>
<li class='indexItem indexItem1'><a href='#DESCRIPTION'>DESCRIPTION</a>
<li class='indexItem indexItem1'><a href='#ENTITIES'>ENTITIES</a>
<li class='indexItem indexItem1'><a href='#CONSTRUCTORS'>CONSTRUCTORS</a>
<ul class='indexList indexList2'>
<li class='indexItem indexItem2'><a href='#new(%24entity%2C_%24coordinate)'>new($entity, $coordinate)</a>
</ul>
<li class='indexItem indexItem1'><a href='#METHODS'>METHODS</a>
<ul class='indexList indexList2'>
<li class='indexItem indexItem2'><a href='#clean()'>clean()</a>
<li class='indexItem indexItem2'><a href='#initialize()'>initialize()</a>
<li class='indexItem indexItem2'><a href='#update()'>update()</a>
</ul>
<li class='indexItem indexItem1'><a href='#AUTHOR'>AUTHOR</a>
<li class='indexItem indexItem1'><a href='#COPYRIGHT_AND_LICENSE'>COPYRIGHT AND LICENSE</a>
<li class='indexItem indexItem1'><a href='#SEE_ALSO'>SEE ALSO</a>
<li class='indexItem indexItem1'><a href='#CONFIGURATION'>CONFIGURATION</a>
</ul>
</div>
<h1><a class='u' href='#___top' title='click to go to top of document'
name="NAME"
>NAME</a></h1>
<p>Footprintless::Overlay - An overlay manager</p>
<h1><a class='u' href='#___top' title='click to go to top of document'
name="VERSION"
>VERSION</a></h1>
<p>version 1.29</p>
<h1><a class='u' href='#___top' title='click to go to top of document'
name="SYNOPSIS"
>SYNOPSIS</a></h1>
<pre> # Standard way of getting an overlay
use Footprintless;
my $overlay = Footprintless->new()->overlay('overlay');
$overlay->clean();
$overlay->initialize();
$overlay->update();</pre>
<h1><a class='u' href='#___top' title='click to go to top of document'
name="DESCRIPTION"
>DESCRIPTION</a></h1>
<p>Overlays are a combination of a directory of static files and a directory of templated files that will be merged to an output directory. This is implemented in <a href="http://search.cpan.org/perldoc?Template%3A%3AOverlay" class="podlinkpod"
>Template::Overlay</a>.</p>
<p>Additionally, any folder under the <code>template_dir</code> can contain a <code>.footprintless</code> file containing a <code>clean</code> and/or <code>resources</code> entities:</p>
<pre> return {
clean => [
'foo.jar',
'bar.jar',
'ext/'
],
resources => {
foo => 'com.pastdev:foo:1.0.0',
bar => 'com.pastdev:bar:1.0.0'
}
};</pre>
<p>The <code>clean</code> entity is an arrayref containing a list of paths to clean out. These paths will be added to the path of the directory containing the <code>.footprintless</code> file. The <code>resources</code> entity is a list of resources to download into the same directory as the <code>.footprintless</code> file.</p>
<h1><a class='u' href='#___top' title='click to go to top of document'
name="ENTITIES"
>ENTITIES</a></h1>
<p>A simple overlay:</p>
<pre> overlay => {
base_dir => "/home/me/foo/base",
clean => [
"/opt/tomcat/"
],
hostname => 'localhost',
key => 'T',
os => 'linux',
template_dir => "/home/me/foo/template",
to_dir => '/opt/foo/tomcat'
}</pre>
<p>A more complex example:</p>
<pre> foo => {
hostname => 'test.pastdev.com',
overlay => {
'Config::Entities::inherit' => ['hostname', 'sudo_username'],
base_dir => '/home/me/foo/base',
clean => [
'/opt/foo/tomcat/'
],
key => 'T',
os => 'linux',
resolver_coordinate => 'foo',
template_dir => '/home/me/foo/template',
to_dir => '/opt/foo/tomcat'
},
sudo_username => 'developer',
tomcat => {
'Config::Entities::inherit' => ['hostname', 'sudo_username'],
catalina_base => '/opt/foo/tomcat',
http => {
port => 20080
},
service => {
action => {
'kill' => { command_args => 'stop -force' },
'status' => { use_pid => 1 }
},
command => '/opt/foo/tomcat/bin/catalina.sh',
pid_file => '/opt/foo/tomcat/bin/.catalina.pid',
},
shutdown => {
port => 8505,
password => $properties->{'foo.tomcat.shutdown.password'},
},
trust_store => {
'Config::Entities::inherit' => ['hostname', 'sudo_username'],
file => '/opt/foo/tomcat/certs/truststore.jks',
include_java_home_cacerts => 1,
password => $properties->{'foo.tomcat.trust_store.password'},
}
}
}</pre>
<p>An overlay can obtain base/template content from a resource. When initialize or update are called, the resource will be downloaded (if not already local) and extracted to a temp folder. The <code>base_dir</code> and <code>template_dir</code> paths will be appended to the extract temp folder:</p>
<pre> overlay => {
base_dir => 'base',
clean => [
'/opt/tomcat/'
],
hostname => 'localhost',
key => 'T',
os => 'linux',
resource => 'com.pastdev:app-overlay:zip:package:1.0.0',
template_dir => 'template',
to_dir => '/opt/foo/tomcat'
}</pre>
<p>An overlay can have multiple template folders. If it does, they will be processed in the order they are listed:</p>
<pre> overlay => {
base_dir => 'base',
clean => [
'/opt/tomcat/'
],
hostname => 'localhost',
key => 'T',
os => 'linux',
template_dir => [
'first/template_dir',
'second/template_dir',
],
to_dir => '/opt/foo/tomcat'
}</pre>
<h1><a class='u' href='#___top' title='click to go to top of document'
name="CONSTRUCTORS"
>CONSTRUCTORS</a></h1>
<h2><a class='u' href='#___top' title='click to go to top of document'
name="new($entity,_$coordinate)"
>new($entity, $coordinate)</a></h2>
<p>Constructs a new overlay configured by <code>$entities</code> at <code>$coordinate</code>.</p>
<h1><a class='u' href='#___top' title='click to go to top of document'
name="METHODS"
>METHODS</a></h1>
<h2><a class='u' href='#___top' title='click to go to top of document'
name="clean()"
>clean()</a></h2>
<p>Cleans the overlay. Each path in the <code>clean</code> entity, will be removed from the destination. If the path ends in a <code>/</code>, then after being removed, the directory will be recreated.</p>
<h2><a class='u' href='#___top' title='click to go to top of document'
name="initialize()"
>initialize()</a></h2>
<p>Will call <code>clean</code>, then <code>overlay</code> on an instance of <a href="http://search.cpan.org/perldoc?Template%3A%3AOverlay" class="podlinkpod"
>Template::Overlay</a> configured to this entity.</p>
<h2><a class='u' href='#___top' title='click to go to top of document'
name="update()"
>update()</a></h2>
<p>Will overlay <i>ONLY</i> the templated files. It will not <code>clean</code>, nor copy any files from <code>base_dir</code> like <code>initialize</code> does.</p>
<h1><a class='u' href='#___top' title='click to go to top of document'
name="AUTHOR"
>AUTHOR</a></h1>
<p>Lucas Theisen <lucastheisen@pastdev.com></p>
<h1><a class='u' href='#___top' title='click to go to top of document'
name="COPYRIGHT_AND_LICENSE"
>COPYRIGHT AND LICENSE</a></h1>
<p>This software is copyright (c) 2016 by Lucas Theisen.</p>
<p>This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.</p>
<h1><a class='u' href='#___top' title='click to go to top of document'
name="SEE_ALSO"
>SEE ALSO</a></h1>
<p>Please see those modules/websites for more information related to this module.</p>
<ul>
<li><a href="http://search.cpan.org/perldoc?Footprintless" class="podlinkpod"
>Footprintless</a></li>
<li><a href="http://search.cpan.org/perldoc?Config%3A%3AEntities" class="podlinkpod"
>Config::Entities</a></li>
<li><a href="http://search.cpan.org/perldoc?Footprintless" class="podlinkpod"
>Footprintless</a></li>
<li><a href="http://search.cpan.org/perldoc?Footprintless%3A%3AMixins" class="podlinkpod"
>Footprintless::Mixins</a></li>
<li><a href="http://search.cpan.org/perldoc?Template%3A%3AOverlay" class="podlinkpod"
>Template::Overlay</a></li>
<li><a href="http://search.cpan.org/perldoc?Template%3A%3AResolver" class="podlinkpod"
>Template::Resolver</a></li>
</ul>
<h1><a class='u' href='#___top' title='click to go to top of document'
name="CONFIGURATION"
>CONFIGURATION</a></h1>
<p>This module can optionally be configured to use a customized resolver. To do so, configure a resolver factory in your entities:</p>
<pre> footprintless => {
overlay => {
resolver_factory => 'My::ResolverFactory'
}
}</pre>
<p>The resolver factory must have a <code>new_resolver</code> method that takes a spec and a list of options and returns a <code>Template::Resolver</code>, for example:</p>
<pre> sub new_resolver {
my ($self, $resolver_spec, %resolver_opts) = @_;
return Template::Resolver->new(
$resolver_spec,
%resolver_opts,
additional_transforms => {
random => sub {
my ($resolver_self, $value) = @_;
return $value . rand();
}
});
}</pre>
<!-- end doc -->
</body></html>