Reply to comment

Capistrano: Set Subversion User at Deployment

When deploying a Rails application using Capistrano, I discovered I needed a way to specify the username and password for Subversion and I didn't want to hardcode this information. I found an excellent suggestion on Jonathan.inspect. I didn't follow his advice exactly, but I ended up with something fairly close that I added to my deploy.rb script:

# Setup prompts for Subversion username/password
set :svn_user, ENV['svn_user'] if ! ENV['svn_user'].nil?
set :svn_user, Proc.new { Capistrano::CLI.password.prompt("SVN user: ") } if ENV['svn_user'].nil?
set :svn_password, Proc.new { Capistrano::CLI.password.prompt("SVN password for '#{svn_user}': ") }
set :repository,
  Proc.new { "--username #{svn_user} " +
             "--password #{svn_password} " +
             "http://myserver/mypath" }

Reply

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <bash>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <java5>, <javascript>, <lisp>, <php>, <python>, <rails>, <ruby>, <sql>. The supported tag styles are: <foo>, [foo].

More information about formatting options