We're just getting into the world of capistrano to deploy websites.
Thanks to the excellent getting started docs at capify.org, I was able
to jump right in and create some fairly sophisticated deployment
scripts.

I'm using capistrano 2.1 and have no experience with previous
versions.

One thing that I would like to do is have cap ask for the username to
use when ssh'ing to the server to run tasks.  This would allow any of
our developers to deploy using their own login.  Note that the USER/
USERNAME environment variables won't work, because there's no
guarantee that the users remote login will be the same as their
username on their local machine.

I've tried this:
# Export from svn to test.gon.com
desc "Update dev environment from SVN"
task :deploy_to_dev, :hosts => "[EMAIL PROTECTED]" do
        ......do stuff
end

# Get user's ssh username
set(:ssh_username) do
        print "What is your ssh username? "
        STDOUT.flush
        STDIN.gets.chomp
end

However, doing a "cap --tasks" results in an error:
undefined local variable or method ssh_`username'

So, I moved the set(:ssh_username)....above the task:
# Get user's ssh username
set(:ssh_username) do
        print "What is your ssh username? "
        STDOUT.flush
        STDIN.gets.chomp
end

# Export from svn to test.gon.com
desc "Update dev environment from SVN"
task :deploy_to_dev, :hosts => "[EMAIL PROTECTED]" do
        ......do stuff
end

While this works, it has a side effect of asking for the users
username even when just doing a "cap --tasks".

Any ideas on other ways this could be accomplished?

Thanks

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

Reply via email to