Footprintless::Deployment - A deployment manager
version 1.01
# Standard way of getting a deployment use Footprintless; my $deployment = Footprintless->new()->deployment('deployment'); # Standard deploy procedure $deployment->clean(); $deployment->deploy(); # Deploy to temp instead of the entity configured location my $rebase = { from => '/opt/tomcat', to => '/tmp/tomcat' }; $deployment->clean(rebase => $rebase); $deployment->deploy(rebase => $rebase); # Only deploy selected resources $deployment->deploy(names => ['bar']);
Manages deployments. A deployment is a set of files and directories that are all associated with a single component. For example, if you are using tomcat, a deployment might refer to all of the webapps deployed to the container, and the folders and files that are NOT part of the tomcat container itself.
A simple deployment:
deployment => { clean => ['/opt/app/'], resources => { foo => 'http://download.com/foo.exe', bar => 'http://download.com/bar.exe' }, to_dir => '/opt/app' }
A more complex situation, perhaps a tomcat instance:
deployment => { 'Config::Entities::inherit' => ['hostname', 'sudo_username'], clean => [ '/opt/tomcat/conf/Catalina/localhost/', '/opt/tomcat/temp/', '/opt/tomcat/webapps/', '/opt/tomcat/work/' ], resources => { bar => '/home/me/.m2/repository/com/pastdev/bar/1.2/bar-1.2.war', baz => { coordinate => 'com.pastdev:baz:war:1.0', 'as' => 'foo.war', type => 'maven' } }, to_dir => '/opt/tomcat/webapps' }
Constructs a new deployment configured by $entities
at $coordinate
. The supported options are:
If no resource_manager
is provided, then this value is used when constructing the default provider(s) for the default resource manager.
The command options factory to use. Defaults to an instance of Footprintless::CommandOptionsFactory using the localhost
instance of this object.
The command runner to use. Defaults to an instance of Footprintless::CommandRunner::IPCRun.
The localhost alias resolver to use. Defaults to an instance of Footprintless::Localhost configured with load_all()
.
The resource manager to use. Defaults to an instance of Footprintless::ResourceManager configured to use a Footprintless::MavenProvider if Maven::Agent is available, and a Footprintless::UrlProvider in that order.
Cleans the deployment. Each path in the configuration.clean
entity, will be removed from the destination. If the path ends in a /
, then after being removed, the directory will be recreated. The supported options are:
A hash containing from
and to
where the paths for each item in the clean entity will have the from
portion of their path substituted by to
. For example, if the path is /foo/bar
and rebase is {from =
'/foo', to => '/baz'}>, then the resulting path would be /baz/bar
.
Deploys all the resources listed in the resource
entity to the location specified in the configuration.to_dir
entity. The supported options are:
A list of names of resources that should be deployed. If this option is provided, any names not in this list will be ignored.
A hash containing from
and to
where the paths for each item in the clean entity will have the from
portion of their path substituted by to
. For example, if the path is /foo/bar
and rebase is {from =
'/foo', to => '/baz'}>, then the resulting path would be /baz/bar
.
If truthy, then status information will be provided to the command runner. In order for this information to be useful, the command runner should be supplied with the {err_buffer =
\*STDERR}> runner option so that it will, in turn, be written to STDERR. Also, status is implemented using the pv
command which MAY NOT already be installed. If it is missing, this option will cause the command itself to fail.
Lucas Theisen <lucastheisen@pastdev.com>
This software is copyright (c) 2016 by Lucas Theisen.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Please see those modules/websites for more information related to this module.