# Praise Switchtower (plus a quick question)

**URL:** <https://www.ruby-forum.com/t/praise-switchtower-plus-a-quick-question/51141>\
**Category:** Rails\
**Created:** [December 27, 2005, 6:49am UTC](https://www.ruby-forum.com/t/praise-switchtower-plus-a-quick-question/51141 "2005-12-27T06:49:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![capnmidnight](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/96bed5/32.png) [@capnmidnight](https://www.ruby-forum.com/u/capnmidnight)\
**Post date:** [December 27, 2005, 6:49am UTC](https://www.ruby-forum.com/t/praise-switchtower-plus-a-quick-question/51141/1 "2005-12-27T06:49:45Z")

</div>

Switchtower is really cool once you get it going. Quick question, I do  
a:

% rake deploy  
% rake remote\_exec ACTION=symlink\_pictures

…but what’s the easiest way to combine the two in a single command?

Thanks  
CM

---

<div class="post-metadata">

**Author:** ![capnmidnight](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/96bed5/32.png) [@capnmidnight](https://www.ruby-forum.com/u/capnmidnight)\
**Post date:** [December 27, 2005, 7:13am UTC](https://www.ruby-forum.com/t/praise-switchtower-plus-a-quick-question/51141/2 "2005-12-27T07:13:17Z")

</div>

On 12/26/05, capnmidnight [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> CM  
> Name the task after\_symlink and it will be called automatically.

–  
rick  
[http://techno-weenie.net](http://techno-weenie.net)

---

<div class="post-metadata">

**Author:** ![capnmidnight](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/96bed5/32.png) [@capnmidnight](https://www.ruby-forum.com/u/capnmidnight)\
**Post date:** [December 27, 2005, 4:27pm UTC](https://www.ruby-forum.com/t/praise-switchtower-plus-a-quick-question/51141/3 "2005-12-27T16:27:32Z")

</div>

On Dec 26, 2005, at 11:11 PM, Rick O. wrote:

> > Thanks  
> > CM
> 
> Name the task after\_symlink and it will be called automatically.

You can also invoke multiple tasks using remote\_exec:

rake remote\_exec ACTION=deploy,symlink\_pictures

But as Rick said, in this case, naming symlink\_pictures  
“after\_symlink” (or creating after\_symlink and calling  
symlink\_pictures from it) is probably the most efficient way to go.  
Before ST invokes a task “foo”, it first looks for a task named  
“before\_foo” and invokes it (if it exists). After invoking “foo”, ST  
looks for and invokes “after\_foo”. This makes it easy to add “hooks”  
to customize various tasks.

- Jamis
