Huh. I'm going to miss the capistrano settings feature a lot.

But I had a lot of code that is parameterized with regard to settings, such that there's a default value, but it can be overridden on the command line -- and I'm going to miss that feature from the default/standard recipes too.

I guess it can probably be substituted for with ENV, I'm gonna have to think about it and experiment a bit.

But, hmm, some of the standard recipes are indeed using capistrano 'settings'. For instance, from: https://github.com/capistrano/rails

    Some rails specific options.

set :rails_env, 'staging' # If the environment differs from the stage

So there are still Capistrano 'settings'--they just can't be set or overridden on the command line anymore? This seems unfortunate, it makes Capistrano settings a lot less useful. Perhaps some recipes will start using ENV instead of capistrano settings, so that they can still be set/overridden on the command line -- but then what's the point of capistrano settings?

I wonder if there's a clever way someone can figure out to reintroduce the possibility of setting capistrano settings on the command line, even within the Rake wrapper. It might be a good idea.


On 10/16/13 4:22 PM, Vassilis Rizopoulos wrote:
Well, the new Capistrano is based on rake so you have a few options.
One is the use of environment variables. You can set the before hand or
you can specify them on the command line:

cap stage task VAR=foo

Access in the code is through the ENV Hash:

ENV['VAR']

This is actually what I do and I do it the following way: I put accessor
methods for environment variables in a module. This allows me to add
code to check for definitions and make sure I warn the user if the
parameter is really needed:

module EnvironmentOptions
   def var
     return ENV['VAR']
   end


end


--
--
* 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 unsubscribe from this group and stop receiving emails from it, send
an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

--
--
* 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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to