# \[ANN\] SwitchTower 1.0.0

**URL:** <https://www.ruby-forum.com/t/ann-switchtower-1-0-0/70373>\
**Category:** Ruby\
**Created:** [February 19, 2006, 6:03am UTC](https://www.ruby-forum.com/t/ann-switchtower-1-0-0/70373 "2006-02-19T06:03:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f17d59/32.png) [@jamis](https://www.ruby-forum.com/u/jamis)\
**Post date:** [February 19, 2006, 6:03am UTC](https://www.ruby-forum.com/t/ann-switchtower-1-0-0/70373/1 "2006-02-19T06:03:02Z")

</div>

SwitchTower is a utility that can execute commands in parallel on  
multiple servers. It allows you to define tasks, which can include  
commands that are executed on the servers. You can also define roles  
for your servers, and then specify that certain tasks apply only to  
certain roles.

Manual: [http://manuals.rubyonrails.org/read/book/17](http://manuals.rubyonrails.org/read/book/17)  
Project: [http://rubyforge.org/projects/switchtower](http://rubyforge.org/projects/switchtower)  
Download: [http://rubyforge.org/frs/?group\_id=1014](http://rubyforge.org/frs/?group_id=1014)  
Install: gem install switchtower

SwitchTower 1.0 fixes several bugs and adds many new features. Here’s  
a quick run-down of some of the more notable recent changes (in no  
particular order):

- Added a :rails\_env variable (which defaults to “production”), so  
that tasks that employ the RAILS\_ENV environment variable can change  
its value, if necessary.

- Make UPPERCASE variables work.

- Only chmod the revisions.log file when it is first created, to  
avoid problems on some unices where a chmod is not allowed unless you  
are the creator of the file.

- Changed the :restart\_via variable to a boolean :use\_sudo variable.  
(Note, this will break your recipes if you are using :restart\_via–  
please change that to :use\_sudo!) Any task that previously used sudo  
will now respect the value of this variable.

- Added spinner, cold\_deploy, and invoke tasks. The spinner task is  
used for starting the application spinner process. The cold\_deploy  
task is used for deploying your application when a spinner is not  
running, and the invoke task is used for executing arbitrary command-  
lines on your servers without needing to write a task for it.

- Fixed the strftime format string that was used in the CVS module,  
to make it Windows compatible.

- Added three new SCM modules: perforce (submitted by Richard  
McMahon), bazaar (submitted by Edd Dumbill), and bazaar-ng (submitted  
by Damien M.).

- Proc-valued variables can be set much more conveniently now. Just  
do “set(:variable) { ‘foo’ }”.

- Added optional :svn\_username and :svn\_password variables, for  
people who’s svn credentials differ from their login credentials.

- Added branch support to the CVS module (courtesy of Jeremy  
Hinegardner).

- Fixed bug where using “put” to replace a file with a shorter file  
would only overwrite the first part of the file.

- Added an extension mechanism so that recipe files may easily import  
third-party tasks and methods. (See [http://manuals.rubyonrails.org/](http://manuals.rubyonrails.org/)  
read/chapter/122)

SwitchTower depends on Net::SSH 1.0.8 (which was also released  
tonight, quietly), so when installing SwitchTower be sure to install  
that as a dependency. (Note that installing via gems takes care of  
this for you, automatically.)

The manual has been updated with the latest changes (though I’m sure  
I may have missed some places). Be sure to check out the complete  
release notes ([http://rubyforge.org/frs/shownotes.php](http://rubyforge.org/frs/shownotes.php)?  
release\_id=4327) for all of the juicy details.

Enjoy!

- Jamis

---

<div class="post-metadata">

**Author:** ![jamis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f17d59/32.png) [@jamis](https://www.ruby-forum.com/u/jamis)\
**Post date:** [February 19, 2006, 7:12am UTC](https://www.ruby-forum.com/t/ann-switchtower-1-0-0/70373/2 "2006-02-19T07:12:55Z")

</div>

Three cheers for Jamis!

Thanks  
-Ezra

On Feb 18, 2006, at 9:01 PM, Jamis B. wrote:

> - Only chmod the revisions.log file when it is first created, to  
> task is used for deploying your application when a spinner is not
> - Proc-valued variables can be set much more conveniently now. Just
> 
> sure I may have missed some places). Be sure to check out the

-Ezra Z.  
WebMaster  
Yakima Herald-Republic Newspaper  
removed\_email\_address@domain.invalid  
509-577-7732

---

<div class="post-metadata">

**Author:** ![jamis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f17d59/32.png) [@jamis](https://www.ruby-forum.com/u/jamis)\
**Post date:** [February 23, 2006, 11:56pm UTC](https://www.ruby-forum.com/t/ann-switchtower-1-0-0/70373/3 "2006-02-23T23:56:30Z")

</div>

Jamis B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

> SwitchTower is a utility that can execute commands in parallel on  
> multiple servers. It allows you to define tasks, which can include  
> commands that are executed on the servers. You can also define roles  
> for your servers, and then specify that certain tasks apply only to  
> certain roles.
> 
> Manual: [http://manuals.rubyonrails.org/read/book/17](http://manuals.rubyonrails.org/read/book/17)  
> Project: [http://rubyforge.org/projects/switchtower](http://rubyforge.org/projects/switchtower)  
> Download: [http://rubyforge.org/frs/?group\_id=1014](http://rubyforge.org/frs/?group_id=1014)  
> Install: gem install switchtower

What is the prefered place for reports/requests?

[~pr]0% switchtower -vvv -r config/deploy.rb -a update\_code  
loading configuration  
/local/ruby-1.8.4/lib/ruby/gems/1.8/gems/switchtower-1.0.1/lib/switchtower/recipes/standard.rb  
loading configuration ./config/deploy.rb

- executing task update\_code
- determining current\_branch…  
/local/ruby-1.8.4/lib/ruby/gems/1.8/gems/switchtower-1.0.1/lib/switchtower/configuration.rb:239:in  
`method_missing': undefined method `local’ for  
#SwitchTower::Configuration:0x1005ee0c8 (NoMethodError)  
from  
/local/ruby-1.8.4/lib/ruby/gems/1.8/gems/switchtower-1.0.1/lib/switchtower/scm/cvs.rb:119:in  
`cvs_local' from /local/ruby-1.8.4/lib/ruby/gems/1.8/gems/switchtower-1.0.1/lib/switchtower/scm/cvs.rb:62:in `current\_branch’  
from  
/local/ruby-1.8.4/lib/ruby/gems/1.8/gems/switchtower-1.0.1/lib/switchtower/scm/cvs.rb:37:in  
`initialize' from /local/ruby-1.8.4/lib/ruby/gems/1.8/gems/switchtower-1.0.1/lib/switchtower/configuration.rb:88:in `[]’  
from  
/local/ruby-1.8.4/lib/ruby/gems/1.8/gems/switchtower-1.0.1/lib/switchtower/configuration.rb:237:in  
`method_missing' from /local/ruby-1.8.4/lib/ruby/gems/1.8/gems/switchtower-1.0.1/lib/switchtower/scm/cvs.rb:72:in `checkout’  
from  
/local/ruby-1.8.4/lib/ruby/gems/1.8/gems/switchtower-1.0.1/lib/switchtower/recipes/standard.rb:72:in  
`load' from /local/ruby-1.8.4/lib/ruby/gems/1.8/gems/switchtower-1.0.1/lib/switchtower/actor.rb:125:in `update\_code’  
from  
/local/ruby-1.8.4/lib/ruby/gems/1.8/gems/switchtower-1.0.1/lib/switchtower/cli.rb:242:in  
`execute_recipes!' from /local/ruby-1.8.4/lib/ruby/gems/1.8/gems/switchtower-1.0.1/lib/switchtower/cli.rb:242:in `execute\_recipes!’  
from  
/local/ruby-1.8.4/lib/ruby/gems/1.8/gems/switchtower-1.0.1/lib/switchtower/cli.rb:217:in  
`execute!' from /local/ruby-1.8.4/lib/ruby/gems/1.8/gems/switchtower-1.0.1/lib/switchtower/cli.rb:12:in `execute!’  
from  
/local/ruby-1.8.4/lib/ruby/gems/1.8/gems/switchtower-1.0.1/bin/switchtower:11  
from /local/ruby/bin/switchtower:18

(Explicitly setting :local is the workaround.)

Is there any plan to nicely support local execution in the future? We  
don’t have major web serving requirements, and it would be a little  
more convenient to me to not have to ssh to localhost, while still  
providing the nice rollback capability and abstraction for if we ever  
do have major web serving requirements.

Steve
