Well, it took me a bit longer than I would have hoped, but your changes have been applied, Ezra. Many thanks for the excellent (excellent!) patch. Tests and all. :) That's rare enough that it really makes a patch stand out.

For those of you that didn't follow along on trac (http:// dev.rubyonrails.org/ticket/6547), Ezra's patch allows user names and port numbers to be encoded in host strings, both for servers and gateways, like:

  set :gateway, "[EMAIL PROTECTED]:4321"
  role :app, "[EMAIL PROTECTED]:1234"

Very nice!

Anyone wanting to play with edge capistrano, you can check it out via svn at:

  http://dev.rubyonrails.org/svn/rails/tools/capistrano

You can build an edge gem by cd'ing to that directory and doing:

1. svn info. Find the line that says "Revision:" and mark the revision number.

2. rake PKG_BUILD=<rev> gem. Replace <rev> with the revision number.

3. Look in the pkg subdirectory. Install that gem file via "gem install pkg/<gem file>"

- Jamis

On Nov 6, 2006, at 1:25 PM, Ezra Zygmuntowicz wrote:


Jamis-

        Great! Thanks for capistrano. And also thanks for all your great
blogging as of recently. Very nice to be able to read advanced rails
content like that. It is rare these days.


Thanks
-Ezra

On Nov 6, 2006, at 7:24 AM, Jamis Buck wrote:

Ezra,

This looks really good (as well as the recent addition to the
ticket where the username can be encoded as well). I'll apply it
today, as soon as the Monday-morning issues at work die down. :)

- Jamis

On Nov 4, 2006, at 11:15 PM, Ezra Zygmuntowicz wrote:



On Nov 3, 2006, at 12:12 PM, Jamis Buck wrote:


On Nov 3, 2006, at 1:10 PM, Jamis Buck wrote:

Ezra,

Capistrano is currently extremely opinionated on this point. There
is setting anywhere you can tweak to make Capistrano use different
SSH

Gah. That should be "There is NO setting anywhere..."

- Jamis


Hey Jamis-

        I was able to come up with a 3 line patch that allows for multiple
ports. All current tests still pass and backwards compatibility is
completely retained. This patch allows for this syntax for defining
roles as well as the old syntax and you can intermix the two and
still use ssh_options[:port].

role :web, "65.74.169.199"
role :app, "65.74.169.199:8029", "65.74.169.199:8030",
"65.74.169.199:8031", "65.74.169.199:32"
role :prod_slave,  "65.74.169.199:8030"
role :db,  "65.74.169.199", :primary => true

ssh_options[:port] = 8888

ssh_options[:port] will be over-ridden for any host that has  :PORT
as part of the string. And any IP's or hostnames that do not
have :PORT in them will use the ssh_options[:port] num or 22 if this
is not set.
        

Does this seem like an exceptable patch Jamis? I am happy to make it a capistrano extension if you don't think it belongs in core cap. But
using "hostname.com:7555"  seems like something that should "just
work" with cap so I would love to see this make it in.

        Should I submit this to the rails track as a [PATCH] ticket?

        Thanks you so much for capistrano. It makes my life a lot easier
maintaining hundreds of Xen instances ;)


ez capistrano $ svn diff
Index: lib/capistrano/ssh.rb
===================================================================
--- lib/capistrano/ssh.rb       (revision 5430)
+++ lib/capistrano/ssh.rb       (working copy)
@@ -27,7 +27,9 @@
                          :password => password_value,
                          :port => port,
                          :auth_methods => methods.shift }.merge
(config.ssh_options)
-        Net::SSH.start(server,ssh_options,&block)
+        Net::SSH.start((server.gsub(/:(\d+)$/,'') || server),
+                       ($1 ? ssh_options.merge({:port=>$1}) :
ssh_options),
+                       &block)
        rescue Net::SSH::AuthenticationFailed
          raise if methods.empty?
          password_value = config.password


ez capistrano $ rake test
(in /Users/ez/_engine_yard/capistrano)
/usr//bin/ruby -Ilib -rubygems "/usr//lib/ruby/gems/1.8/gems/
rake-0.7.1/lib/rake/rake_test_loader.rb" "test/actor_test.rb" "test/
command_test.rb" "test/configuration_test.rb" "test/ssh_test.rb"
"test/scm/cvs_test.rb" "test/scm/subversion_test.rb"
Loaded suite /usr//lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/
rake_test_loader
Started
.................................................................... .
...
............
Finished in 0.027193 seconds.

84 tests, 161 assertions, 0 failures, 0 errors


Cheers-

-- Ezra Zygmuntowicz-- Lead Rails Evangelist
-- [EMAIL PROTECTED]
-- Engine Yard, Serious Rails Hosting
-- (866) 518-YARD (9273)







-- Ezra Zygmuntowicz -- Lead Rails Evangelist
-- [EMAIL PROTECTED]
-- Engine Yard, Serious Rails Hosting
-- (866) 518-YARD (9273)



--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to capistrano- [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/ group/capistrano
-~----------~----~----~----~------~----~------~--~---


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to