# Multistage and mongrel\_cluster.yml

**URL:** <https://www.ruby-forum.com/t/multistage-and-mongrel-cluster-yml/126987>\
**Category:** Deployment\
**Created:** [January 23, 2008, 11:31pm UTC](https://www.ruby-forum.com/t/multistage-and-mongrel-cluster-yml/126987 "2008-01-23T23:31:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mememe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/977dab/32.png) [@mememe](https://www.ruby-forum.com/u/mememe)\
**Post date:** [January 23, 2008, 11:31pm UTC](https://www.ruby-forum.com/t/multistage-and-mongrel-cluster-yml/126987/1 "2008-01-23T23:31:35Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![mememe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/977dab/32.png) [@mememe](https://www.ruby-forum.com/u/mememe)\
**Post date:** [January 24, 2008, 12:31am UTC](https://www.ruby-forum.com/t/multistage-and-mongrel-cluster-yml/126987/2 "2008-01-24T00:31:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mememe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/977dab/32.png) [@mememe](https://www.ruby-forum.com/u/mememe)\
**Post date:** [January 24, 2008, 5:32pm UTC](https://www.ruby-forum.com/t/multistage-and-mongrel-cluster-yml/126987/3 "2008-01-24T17:32:08Z")

</div>

Thanks! This might work for me!
