[Catalyst] deployment with 3-tiered server setup: How to handle config?

Neo [GC] neo at gothic-chat.de
Tue Apr 21 07:55:28 GMT 2009


Hi Jens,

here we use a very simple solution to include different .yml-files with 
db-config and stuff. For each project (we run several Catalyst instances 
on one production server and some development-servers) we have an own 
.yml stored in our repository. The name of the .yml is the same as the 
directory where the instance is stored, so Catalyst reads out its dir 
and so determines the correct config-file.

For example, Catalyst is stored in:
/usr/local/httpd/productive1/MyApp
the yml would be
/usr/local/httpd/productive1/MyApp/productive1.yml

This is a kinda hacked solution, but does work very well. :)

In the MyApp.pl we have:
__PACKAGE__->config->{'home'}         =~ m/\/([^\/]+)\/MyApp/;
__PACKAGE__->config->{dbconnect}     = YAML::LoadFile( 
__PACKAGE__->path_to($1 . '.yml') );
(several config directives)

In the model-file we also have:
CRM4->config->{'home'} =~ m/\/([^\/]+)\/MyApp/;
my $connectData = YAML::LoadFile( MyApp->path_to($1 . '.yml') );
(database connection info)


Regards,
Neo [GC] / Tom Weber [DuO]


Jens Schwarz schrieb:
> Hi,
>
> I am planing to have a 3-tiered catalyst setup: one development server, one test server and one production server. Each of those has of course different setups (mysql-users, hostnames, apache configs, etc). How can I create a catalyst application that can cope with these different settings without having to manually alter the settings on each system? (My app is under subversion control.). Is there a 'best practice'?
>
> Thanks
>
> Jens
>   



More information about the Catalyst mailing list