On 3/16/07, Mark Imbriaco <[EMAIL PROTECTED]> wrote:
>
>
> On Mar 16, 2007, at 1:58 PM, James Hughes wrote:
>
> > Hello,
> >
> > I have an app that is deploying to a single server using a two mongrel
> > cluster ala Coda Hale's instructions[1].
> >
> > I want to add another server to the recipe, with a twist. So far I
> > have the following:
> >
> > role :web, "hudson" #, "cartier"
> > role :app, "hudson" #, "cartier"
> >
> > (cartier is commented out for now, but eventually I want to  deploy to
> > both of these. The twist is that I'd like to start the mongrels on
> > hudson in development mode, and cartier in production mode to ensure
> > they hit different backends (LDAP, not db, btw). I see that there is
> > an environment setting in mongrel_cluster.yml, but this looks like a
> > blanket setting for all deployment servers. Any way to delineate the
> > environment per server?
>
> You might try something along these lines:
>
> task :restart do
>    sudo "#{current_path}/script/mongrel_wrapper cluster::restart"
> end
>
> With a mongrel_wrapper script that looks like:
>
> ---- 8< ---------------------------------------------------------------
> #!/bin/sh
>
> if [ `hostname` == 'hudson' ]; then
>    RAILS_ENV=development
> else
>    RAILS_ENV=production
> fi
>
> export RAILS_ENV
> mongrel_rails $1
> ---- 8< ---------------------------------------------------------------
>
> You will want to not have the production variable set in
> mongrel_cluster.yml in this case, since you'll be getting it from the
> environment instead.  Also note that I haven't tested this, but
> something along these lines ought to get the job done for you.

Wondering, does RAILS_ENV override the command line setting? Because
when I comment out the environment variable in mongrel_cluster.yml it
just defaults to "-e production".

Thanks,
James

--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to