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

2

5

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?

Gauleiter answered 11/2, 2011 at 9:58 Comment(0)
B
5

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

Breannabreanne answered 11/2, 2011 at 11:8 Comment(0)
U
4

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.

Uniaxial answered 11/2, 2011 at 14:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.