[Catalyst] Multiple deployments sharing code, data,
and configuration
Stuart Watt
swatt at infobal.com
Thu Dec 17 16:48:48 GMT 2009
In our application, we have two parts - an indexing system that builds a =
set of databases, and a front end based on Catalyst. The issue we are =
facing is that each generated deployment runs almost exactly the same =
code, apart from needing different database references, and maybe a =
little additional Template-Toolkit stuff to provide custom logos, search =
configuration data, etc.
What we ended up doing was using a new environment variable, =
*_SITE_ROOT, which points to an individual site's deployment base; this =
is effectively combined with *_HOME in a search path for TT files and =
for configuration files. On a few rare occasions we also add a local =
deployment lib directory @INC. This means we can maintain all the =
deployments in parallel, even when they contain different data.
The only substantive change we needed was in our subclass of =
Catalyst::Plugin::ConfigLoader, which overrides find_files to try the =
SITE_ROOT directory first, then HOME, for each file previously =
identified - these are generally the config file with and without the =
local suffix. It's the only way we found of achieving a directory level =
separation between the local deployment and the shared code base.
My question: is there an easier/better way to do this? If not, I'd be =
keen to turn this into a patch, and rename stuff where I get better =
suggestions.
All the best
Stuart
-- =
Stuart Watt
ARM Product Developer
Information Balance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20091217/1cd08=
02d/attachment.htm
More information about the Catalyst
mailing list