Maybe I should try and describe what I'm trying to achieve:

For all cap commands (eg. cap deploy, cap myns:launch_instance, etc) I
want to first prompt the user for a key, and then have access to that
key in all subsequent tasks that are called from the cap command.
However, I only want to prompt for the key once, not before each task
(which is happening if I use an on :before method)

Does that make sense?





On Aug 15, 1:04 pm, Lee Hambley <[email protected]> wrote:
> Chad,
> "only once" = only on one server, or only once, ever?
>
> If the former, you can do a few magic things, ask back on the list and
> someone (maybe me) will help -- if you mean once, ever you should attach it
> to deploy:cold maybe?
>
> -- Lee Hambley
>
> Twitter: @leehambley
> Blog:http://lee.hambley.name/
> Working with Rails:http://is.gd/1s5W1
>
> 2009/8/15 Chad Arimura <[email protected]>
>
>
>
>
>
> > Hi All,
>
> > I'd like to call an on :before task only once before a deployment
> > script.  Is there an easy way to tell it to only run once?  Or
> > possibly set a variable and then skip over the task if the variable is
> > set?
>
> > This didn't work:
>
> > on :before, "mytasks:run_only_once"
>
> > task :run_only_once do
> >  if already_ran.nil?
> >    ..stuff..
> >  else
> >    already_ran = "notnil"
> >  end
> > end
>
> > Thanks for any help!
>
> > Chad
--~--~---------~--~----~------------~-------~--~----~
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.co.uk/group/capistrano?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to