Rake remote_exec on Windows


#1

I am using the shovel deploy.rb from http://nubyonrails.com/pages/shovel
I have SwitchTower-ized my app, copied the shovel deploy.rb file and put
my settings in it.

But when I run “rake remote_exec ACTION=setup_lighty” from the local app
root it has no effect. It should prompt for a password for at least
throw an error? I just get returned to the DOS prompt.

If I do “rake remote_exec ACTION=random_text” it does exactly the same
so I’m thinking the issue is with remote_exec and not my deploy.rb file?

Any suggestions…

Cheers K.


#2

On 12/16/05, Kris L. removed_email_address@domain.invalid wrote:

so I’m thinking the issue is with remote_exec and not my deploy.rb file?
Posted via http://www.ruby-forum.com/.


Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails

I thought switchtower was not useable in windows due to rpc and
non-posix
issues ?


#3

On Dec 16, 2005, at 8:40 AM, Peter F. wrote:

Joyeux Noël

Peter F.

You can’t use switchtower to deploy TO a windows box, but it should
work fine deploying FROM a windows box.

In the past, others have had this problem because Windows doesn’t
understand that the switchtower executable is executable. Can the OP
look to see where switchtower was installed? Possibly try running the
following from the DOS prompt:

switchtower --help

If you get a “command not found” error, then it is likely that the
switchtower executable is either not in your path, or the
switchtower.cmd file is missing.


#4

On Dec 16, 2005, at 10:10 AM, Kris L. wrote:

Thanks, I am deploying to Textdrive from Windows, so should be OK with
regards to posix.

Typing switchtower --help works… I get the help stuff.

I have used switchtower --apply-to . to get the orignal deploy.rb
anyway
so im guessing Windows knows where it is and will execute it.

Is remote_exec part of SwitchTower?

No, remote_exec is a rake task that invokes switchtower (you can see
it in lib/tasks/switchtower.rake).

If that remote_exec task isn’t working, but switchtower is, you can
always use switchtower directly:

switchtower -vvvv -r config/deploy -a setup_lighty

(-vvvv means “be very verbose”, -r gives the path to the recipe file,
and -a is which action to invoke. You can give -a multiple times to
invoke multiple actions.)

Regarding the remote_exec rake task… If switchtower is in your path
and is executable, then I’m not sure what’s going on–I haven’t used
Windows in ages. :frowning: Any switchtower-savvy Windows users around that
can help troubleshoot this one?

  • Jamis

#5

Thanks, I am deploying to Textdrive from Windows, so should be OK with
regards to posix.

Typing switchtower --help works… I get the help stuff.

I have used switchtower --apply-to . to get the orignal deploy.rb anyway
so im guessing Windows knows where it is and will execute it.

Is remote_exec part of SwitchTower?

Jamis B. wrote:

You can’t use switchtower to deploy TO a windows box, but it should
work fine deploying FROM a windows box.


#6

I am running switchtower from Windows to TextDrive with no problems.

I ran into this problem as well. In my case, I had to add the ‘.cmd’
to the end of the switchtower commands in the
lib/tasks/switchtower.rake file.

For instance, change:

system “switchtower -vvvv -r config/deploy #{actions}”

To:

system “switchtower.cmd -vvvv -r config/deploy #{actions}”

And although you didn’t ask, you will need to define your own restart
task for TextDrive (this is for lighttpd).

First create a script on your host to restart lighttpd. In my case, I
called it lighttpdctl and placed it in a scripts directory off my home
directory of my TextDrive account. Here is the snippet I used for the
script:

http://textsnippets.com/posts/show/241

Then you will need to define a restart task in your config/deploy.rb.
Here is mine:

desc “Restart the web server”
task :restart, :roles => :app do
run “/home/your_account/scripts/lighttpdctl restart”
end

Good Luck,
Tom


#7

Thanks Tom, that worked a treat.

I just need to tweek the shovel delpoy.rb as I want each Rails app in a
folder named after the Project not URL.

Shovel makes folders like /sites/domain.com/
but I want /sites/AppName/

Tom D. wrote:

And although you didn’t ask, you will need to define your own restart
task for TextDrive (this is for lighttpd).

It appears lighttpdctl is created for you.

Thanks again, K.