How can I deploy my Catalyst application as a debian package (or suitable alternative)?

573 Views Asked by At

After testing my Catalyst application and deciding to deploy it I would like to package it up so I can easily pull it in on the staging and live servers, manage dependencies and easily roll-back via the flexibility of package versioning. As my production OS is Ubuntu I figured packaging it as a deb package would make most sense.

I am predicting I will have to create a second package of all my perl module dependencies as many are not provided by my distribution, or package them independently - though that may be a lot of work.

Does anyone have any experience of doing this - or a sane, similar alternative?

2

There are 2 best solutions below

0
On BEST ANSWER

To build your own Debian packages out of CPAN packages:

  • Install Debian helper scripts

    sudo apt-get install dh-make-perl

  • Download MODULE from CPAN and build Debian package

    cpan2deb MODULE

0
On

dh-make-perl is actually the right tool to put CPAN modules into Debian packages. Together with apt-file it can even prepare proper dependencies for you.

About being able to "easily roll-back" though requires special attention to versioning or workflows. There are several approaches that might get your job done here:

  • If you can force-downgrade packages you have won already most of the time unless you have very specific maintainer scripts that do jobs on package upgrades - then you will have to make them able to handle the downgrade, too
  • If you have to go the regular upgrade-path, using approaches like using "< newversion>+rollback< oldversion>" or similar might be something to consider.

Dependency-packages are always a good idea for deployments to make sure no required package actually is missing. Also, you might want to invest some time in management frameworks like puppet, they might come handy here, too.