Multistage and mongrel_cluster.yml

When using multistage, how does one control cwd in

Or do you just end up using different mongrel_cluster files, each with
a different cwd setting, and then setting :mongrel_conf accordingly in

me escribió:

Perhaps theses taks and template help you. Normally, I put it in
deploy.rb because are common in all stages, only change path and then
use shared_path variable.

desc “Create mongrel_cluster yaml in shared path”
task :mongrel_cluster_yml do
template =,
“deploy/templates”, “mongrel_cluster.erb”))
result =
run “mkdir -p #{shared_path}/config”
put result, “#{shared_path}/config/mongrel_cluster.yml”

desc "Make symlink for mongrel_cluster yaml"
task :symlink_mongrel_cluster_yml do
  run "ln -nfs #{shared_path}/config/mongrel_cluster.yml


Templates (config/deploy/templates/mongrel_cluster.erb):

user: <%= mongrel_username %>
group: <%= mongrel_group %>
cwd: <%= deploy_to %>/current
port: “<%= mongrel_port %>”
environment: production
pid_file: <%= shared_path %>/log/
log_file: <%= shared_path %>/log/mongrel.log
servers: <%= mongrel_servers %>


Rafael Garcia Ortega

Thanks! This might work for me!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs