For variables that I need to supply but don't want to check in; I create a 
secrets.rb ignore it with your scm then require it from your deploy.rb

I usually check in a secrets.rb.template that includes the values I expect to 
be set but with bogus content for the values. Just so another developer or 
myself remember what needs to go in there. 

In a new checkout you'd copy secrets.rb.template to secrets.rb fix the values 
in secrets.rb then your back in business. 

On Nov 14, 2011, at 2:09 PM, Craig White <[email protected]> wrote:

> Having now separated 2 deployments into different namespaces, I am struggling 
> trying to figure out how to not have to keep entering credentials (both user 
> & svn) for consecutive activities from a single task. ie...
> 
> namespace deploy do
>  task :cold do
>    system "cap #{stage} deploy:setup"
>    system "cap #{stage} code:tag deploy"
>    system "cap #{stage} i18n:tag deploy"
>  end
> ...
> end
> 
> namespace i18n do
>  task :tag do
>    ...
>  end
> end
> 
> and this near the top of the file (before the namespace)
> set :user, proc{Capistrano::CLI.ui.ask("Your SSH user login: ")}
> set :password, proc{Capistrano::CLI.password_prompt('Your SSH user password:' 
> )}
> set :svn_user, Proc.new { Capistrano::CLI.ui.ask('Your svn username: ') }
> 
> clearly causes it to ask each time, so I have been trying to set constants 
> but that always is a problem
> 
> and I've got this but it never passes the user/pass variables through to 
> namespaces...
> 
> def ask_for_credentials
>  prompter = HighLine.new
> 
>  user = `logname`
>  name_question = <<-EOD.gsub(/^    /, '')
> 
>      
> --------------------------------------------------------------------------------
>  EOD
>  name_question << "    SVN user     : "
> 
>  pass = nil
>  user = prompter.ask(name_question.dup, String){|q| q.default = user}
>  pass_question  = "    SVN password: "
> 
>  while pass.nil? or pass.strip.empty?
>    pass = prompter.ask(pass_question){|q| q.echo = "*"}
>  end
>  [user, pass]
> end
> 
> any suggestions?
> 
> -- 
> Craig White ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [email protected]
> 1.800.869.6908 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ www.ttiassessments.com 
> 
> Need help communicating between generations at work to achieve your desired 
> success? Let us help!
> 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to [email protected]
> * To unsubscribe from this group, send email to 
> [email protected] For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to [email protected]
* To unsubscribe from this group, send email to 
[email protected] For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Reply via email to