Separate passwords for svn/ssh via SwitchTower
One of SwitchTower’s assumptions is that the password you use to access your deployment machines is the same password you use to access your source code repository. For many people, this isn’t the case. I’ll be working on making this scenario cleaner in the next release, but in the meantime, you might consider something like this:
1 2 3 4 5 6 7 |
set :svn_user, ENV['USER'] set :svn_password, Proc.new { SwitchTower::CLI.password_prompt('SVN Password: ') } set :repository, Proc.new { "--username #{svn_user} " + "--password #{svn_password} " + "http://svn.blah.com/project" } |
Procs are used for some of the variables so that they aren’t evaluated until the first time they are needed. This way, if you are running a ST task that doesn’t need the svn password, you don’t get prompted for it.
(Thanks to Craig Davey for pointing out that you can put the username and password in the repository line. Nice hack!)