What are best practices for deploying a Catalyst application to a production server?
Asked Answered
C

2

9

What is a good way to deploy Catalyst applications to a production server? Currently I simply have a FastCGI dispatch script in the root of the repository and when I want to update the server code, I push the branch to the server. This is quite simple, but not perfect. If the code fails the tests on the server machine (for example because of unsatisfied dependencies), I am left with broken application. How do you deploy your Catalyst applications? Do you have a better way?

Copeland answered 30/10, 2009 at 17:35 Comment(0)
G
10

A combination of a proxy load-balancer and two flip-flop fastcgi applications running alternatively as production and staging applications would be your best bet. What web server are you using? If it happens to be Lighttpd, then have a look at these links:

Goar answered 30/10, 2009 at 21:40 Comment(1)
Unfortunately I am using Apache on a shared hosting machine, which means I am short of options, but thank you for the tip anyway.Copeland
C
3

To deal with the unsatisfied dependencies issue, I use a script that runs svn export for the entire app-tree to a separate directory, sets the environment appropriately and then executes:

perl -MMyApp -e '{print "OK"}'
if [ $? -ne 0 ]
then
    echo "MyApp failed compile, not installing."
    exit 1
fi

That's quite sufficient to ensure any modules installed in dev are available before recycling Apache and/or FastCGI. Once it succeeds the exported code is moved to its final location.

Cavalierly answered 1/11, 2009 at 20:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.