Multistage and mongrel_cluster.yml

When using multistage, how does one control cwd in
mongrel_cluster.yml?

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

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.

Tasks:
desc “Create mongrel_cluster yaml in shared path”
task :mongrel_cluster_yml do
template = File.read(File.join(File.dirname(FILE),
“deploy/templates”, “mongrel_cluster.erb”))
result = ERB.new(template).result(binding)
run “mkdir -p #{shared_path}/config”
put result, “#{shared_path}/config/mongrel_cluster.yml”
end

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

#{release_path}/config/mongrel_cluster.yml"
end

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


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

Regards


Rafael Garcia Ortega

Thanks! This might work for me!