The maze book for programmers!

Algorithms, circle mazes, hex grids, masking, weaving, braiding, 3D and 4D grids, spheres, and more!

DRM-Free Ebook

The Buckblog

assorted ramblings by Jamis Buck

Separate passwords for svn/ssh via SwitchTower

16 January 2006 — 1-minute read

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:

set :svn_user, ENV['USER']
set :svn_password, { SwitchTower::CLI.password_prompt('SVN Password: ') }
set :repository, { "--username #{svn_user} " +
             "--password #{svn_password} " +    
             "" }

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!)