How to manage the development, build, and deployment of Perl applications?

I have yet to find a satisfactory way to manage the development, build, and deployment of my Perl applications. I would like to hear how you solved this problem and / or what you would like to have in the application build system that you do not have.

Please describe the type of your application (this is a web application, it runs on the server or binds it using PAR or PerlApp so that you can work on systems without loss).

Key things a build system should provide:

  • Library control.
    • It should be possible to check the library distribution in my dev directory to use it in my build.
    • It should be easy to execute perl with an @INC value that the corresponding directories will use.
    • It should be possible to get a list of modules that are obtained from the perl install system.
  • Makefile / Build Integration
    • It is easy to do a global test throughout the application by issuing only one make test or similar command.
  • Version control
    • Structure
    • should not interfere with the normal use of CVS, SVN and another version of the control system.
  • Cross platform
    • The system should work at least on Win32 and Unix.
    • Ideally, the tools should function the same in all places where perl works.
  • Single Perl Installation
    • You do not need to install perl in a special directory as part of your environment setup.
  • Easy start
    • Launching an application should be mainly an automated process. Something along the lines of the :: Starter or h2xs module should be available to build the basic structure and create any standard files.

Cross reference to Perlmonks .

+45
perl
Mar 17 '09 at 20:53
source share
2 answers

There is a lot that I could write about it

  • Library Management - I create my own versions of CPAN only with the modules I want. Recent versions of App :: Cpan have several features, such as the -j option to download one-time configurations to help with this. After that, you can distribute it on your thumb drive or CD-ROM, which has all the modules, CPAN.pm configuration and everything else that you need. With a little programming, you create a run_me script to make things happen.

  • Makefile / Build integration - I do not integrate Make files. This is the path to disaster. Instead, I am testing integration with a top-level application module that automatically checks all its dependencies. The -t switch for the cpan command is useful for testing the module in the current working directory:

    cpan -t.

There are various interaction testing schemes that you can also use. You install PERL5LIB on something empty (only with the main modules in hard-coded @INC directories), so cpan should install everything from scratch.

  1. Version control - it doesn't really matter what you use. Most things have some kind of export where you can get everything without source control materials. Git is very good, because in normal cases it has a minimum of pollution.

  2. Cross platform - everything I mentioned works fine on Windows and Unix.

  3. Single Perl install - this part is more complicated, and I think that you are mistaken. At any time, when several things must depend on the same perl, someone is going to mess it up for others. I definitely recommend not using the Perl system to develop applications so that you don't mess up the system. At a minimum, each application must install all non-core modules in its own directories so that they do not compete with other applications.

  4. Ease of startup is just a programming issue.

BONUS: I do not use Module :: Starter. This is the wrong way to go because you have to depend on what Module :: Starter thinks you should do. I use Distribution :: Cooker , which simply takes the Template Toolkit template directory and processes them to provide them with its distribution directory. You can do whatever you like. How you get the source templates is up to you.

+18
Mar 18 '09 at 20:06
source share

I am working on a rather small web application, and we are just working on improving our deployment (improving it from โ€œspend a day, setting up all the modules we need on Windows, and then throwing files on it until everything worksโ€, so some improvements).

We have three things we need to do to set up our site:

  • A Perl module created using Module::Starter containing a Config module that contains configuration parameters for the entire site. When installing this module (using MakeMaker PREREQ_PM to verify that all the modules we need are already installed). Any modules that should not be installed before this module can be installed.
  • Several SQL files that must be run to tune the database.
  • CGI Perl files that make up the website. As long as Apache points to them, the website "just works." This includes the general code modules used by all Perl files.

Deployment is what I pull from all branches of Git and pack the version. Then we can pass this for testing either locally or to an Amazon EC2 instance. As soon as we are happy to publish, we either install it on top of the latest version, or transfer the database to a testing instance, and make it a new instance.

Comparing this with your criteria:

  • Library Control: Multiple. We use CPAN modules quite widely. To try the new version, we update our own version of the module before performing this update on a production server. We manually maintain the list, but since our code base is rather small, it is easy to determine which modules are used (for example, through grep for lines starting with use ).
  • Makefile / Build Integration: Yes. Any files related to the Makefile are executed by our EU :: MM installation. We do not have global tests, but since our entire test package recently appeared in the same folder, we hope that you will soon have the opportunity to run prove directly.
  • Version Compatibility: Yes. All our source code is contained in one folder without unnecessary duplication.
  • Cross platform: Yes. We have a lot of weird things going on in MakeMaker to let us do this, but as a startup, having cross-platform code gives us valuable flexibility. We try to make the most of the core Perl modules and tools, as well as the Pure Perl modules from CPAN.
  • Install Single Perl: Yes. We can process Perl from anywhere and install in any settings if all the tools of our own Perl module can work - it took a lot of effort to get CPAN , EU::MM , while others work well on all systems. it seems embarrassing to spend it.
  • Easy start: not really. This system evolved (that is, it was not developed intelligently) from one folder of all source files and a text file with a list of modules that need to be installed. While formalizing testing for installed modules is a huge improvement, we still need something like a day to install. We basically installed our preliminary modules (not all of them are easy to install on Windows). I hope to use the Perl Win32 community to try and troubleshoot problematic CPAN modules.

Keep in mind this is a really simple website, no XS, no complicated web framework, or any such. We also supported this setting in only two versions, so we lack experience in how this will work, as the code becomes more complex and our deployment platforms become more diverse. I would really appreciate any suggestions or comments in our system.

+7
Mar 18 '09 at 6:20
source share



All Articles