[Catalyst] Deployment in practice

Octavian Râşniţă orasnita at gmail.com
Sun Oct 11 07:49:44 GMT 2009

From: "Bill Moseley" <moseley at hank.org>
2009/10/9 Octavian Râşniţă <orasnita at gmail.com>

> Hi,
> I've recently started to use Mercurial for revision control and the pages
> regarding the deployment of a Catalyst app from the Catalyst wiki also 
> help
> me very much, but I still don't know what would be the best method for
> uploading the files to the server.
> How do you do it?
> Archive the entire app an dupload to the server then change the 
> permissions
> of the files and folders there?
> Or upload the modified files one by one?
> Or generate a tarball on each revision and unarchive and make, make test 
> it
> on the server?

I have a script on a build server that does an svn export of a specific
branch and version  (or latest trunk if no version specified).  The script
then runs the test suite, runs the "build" scripts that generate "minified"
css, javascript, and anything else that prepares the package such as create
a meta file with build info, and then builds a tarball named after the
reversion.  Also, a symlink is created as "latest" on the build server.

Then on target machines (testing, staging, and production) I have a "push"
script that fetches the tarball (based on a specific version or "latest"),
untars it on the machine.  It's untarred into a directory named after the
revision it came from.  Tests are run that verify that it can talk to
whatever it needs (database, services).  Then do a graceful stop of the
existing server, move symbolic links, start the server back up and then use
wget to validate a number of test URLs.  Depending on the update some
servers may get pulled out of the balancer before upgrading to do it in

Pushing a previous version will just update the symlinks if they revesion

Not perfect but seems to work ok for now.

Thank you all for your answers. It was very helpful.
What about the database? If starting from a certain revision you need to 
make some database changes (adding tables, adding/deleting some table 
fields) how can we automate this?

I mean, I think that we could run a script that add some tables and remove 
the unneeded fields from other tables, but if something goes wrong and we 
need to go back to the previous version, we would need the records from 
those fields.

What can we do in these situations? Do the database update and the tests 
manually? Or back-up the entire database and then test the latest version of 
the app?



More information about the Catalyst mailing list