How can I package my dependencies for Perl applications for deployment?

I am working on a Perl application that is designed to be deployed with Module::Build

. I needed to install several modules via CPAN because they were not available through the Ubuntu Package Manager, or rather the internal apt-get mirror used by all of our servers. While this is all well and good on our development server, IT is (understandably) reluctant to run code on production machines that are not cached or otherwise controlled internally.

Since we don't currently have a CPAN mirror, this basically means I need to get all of these non-Ubuntu modules in one place so they can be archived and / or pushed into version control. The ideal solution would be to test the utility outside of source control, change a couple of config variables for the databases, and maybe run a build / install command and do that. Fortunately, the development server is a clone of the production server, so modules using XS or other architecture-specific features shouldn't cause problems.

I think the cleanest way to deal with this is to check the source files for the modules I need and install Module::Build

to use them to resolve their dependencies instead of looking for CPAN, but I don't see a way to do this.It's something that can I do, or is there another way to round off all the modules I need for a practically offline deployment?

+3


source to share


3 answers


As mentioned in the comments above, Pinto can suit your needs as it creates your own CPAN repo.

The Pinto has two main purposes. First, Pinto seeks to address the instability problem in CPAN mirrors. Distribution archives are constantly being added and removed from CPAN, so if you use it to build a system or application, you cannot get the same result twice. Second, Pinto seeks to encourage developers to use the CPAN toolkit to build, test, and manage dependencies for their local software, even if they never plan to release it on CPAN.

Pinto accomplishes these tasks by providing the tools to create and manage your own distribution archive repositories. These repositories can contain any distribution archives you like and can be used with the standard CPAN bundle. The tools also support various operations that allow you to solve common problems that arise during development.


Second answer



Alternatively, if you are going to deploy only in Ubuntu, you can turn on CPAN modules - and in your own Debian packages with dh-the make-perl , then you can place them in your own repo reprepro . The beauty is that you can update packages and execute

apt-get update
apt-get upgrade

      

on client computers if they have their own repo as source

+3


source


Check Stratopan and Carton .

Also see:



+1


source


I'm not sure how common this is, but I've used perlbrew and Pinto together to solve some of the problems you're talking about.

  • With perlbrew, I do not interact with "system" perl. There is a perl application and a perl system, and there is no risk for me to install a later version of a module that interferes in some way with anything the perl system was doing.

  • With Pinto, I have archived versions of CPAN modules that I know will work.

When I deploy, I create perlbrew perl (with an alias like "prod" or whatever) and then I install all the necessary modules in perlbrew perl using the Pinto repository. I am currently facilitating this with the cpan bundle module (this module is also included in the Pinto repository), so you can just install the package from the repository and it will push all your dependencies automatically.

0


source







All Articles